New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Param store config #308

Closed
wants to merge 4 commits into
base: master
from

Conversation

Projects
None yet
9 participants
@jkuipers
Contributor

jkuipers commented Mar 23, 2018

Here's a contribution to address #207.
This code provides Spring Cloud centralized configuration support for the AWS Parameter Store by creating a PropertySourceLocator at bootstrap time that reads hierarchical configuration parameters.
Similar to Spring Cloud Config and the Consul Config support, shared configuration and overrides with profile-specific properties are supported.
Encrypted values are decrypted.

Currenty there's no support for publishing EnvironmentChangedEvents when updates are made to the parameters that make up combined PropertySources:
AFAICT the only way to that efficiently (i.e. without continuously polling all properties) would involve integrating with CloudWatch events, which I thought to be too complex for an initial implementation.

I first added my BootstrapConfiguration to the existing autoconfiguration module, but that module has a hard dependency on the context module and configures things I don' personally care for when I just want the Parameter Store integration.
That would also prevent me from running an application locally while still retrieving its config from the Parameter Store.
I therefore added autoconfiguration for this new module to its starter instead.

I've provided some documentation and a simple test: coming up with all this was already a significant amount of work, so I'd like some feedback first before putting in any more.
Please let me know what you think!

jkuipers added some commits Mar 21, 2018

Move param-store-config autoconfig to starter
The spring-cloud-aws-autoconfigure has a non-optional dependency on
spring-cloud-aws-context, so depending on it triggers all sorts of
unwanted autoconfiguration. Excluding the -context module from the
param-store starter doesn't work either, as some autoconfiguration
classes import classes from the -context module.
Therefore we simply provde our own (Spring Cloud) autoconfiguration in
the starter.

@jkuipers jkuipers changed the title from Param store config - #207 to Param store config Mar 23, 2018

@aemruli

This comment has been minimized.

Collaborator

aemruli commented Mar 26, 2018

first of all thanks @jkuipers will have a look this week and comment on this.

@SaikiranDaripelli

This comment has been minimized.

SaikiranDaripelli commented Apr 11, 2018

@aemruli Any update on this?

@devinsba

My team has an internal version of this, would love to adopt an upstream one if this gets merged. 👍

`PropertySource` when the application is started. The Parameter Store Configuration allows you to use this mechanism
with the https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-paramstore.html[AWS Parameter Store].
Simply add a dependency on the `pring-cloud-starter-aws-parameter-store-config` starter module to activate the support.

This comment has been minimized.

@devinsba

devinsba Apr 16, 2018

Contributor

nit: spelling

@jkuipers

This comment has been minimized.

Contributor

jkuipers commented Apr 25, 2018

Would be nice to get an update on this: BTW, I'm running (another version of) this code in production right now, so it's proving itself as I'm typing this ;)

@masayuki038

This comment has been minimized.

masayuki038 commented Apr 27, 2018

I would like this too, please. What is the current status?

@joshualo

This comment has been minimized.

joshualo commented May 2, 2018

We have integrated this package into several of our projects and it works well. Hoping to get any update on the status of this PR.

@Jarec

This comment has been minimized.

Jarec commented May 3, 2018

+1

@gamov

This comment has been minimized.

gamov commented May 22, 2018

This is a great addition to spring-cloud-aws, IMO.

GetParametersByPathResult paramsResult = source.getParametersByPath(paramsRequest);
for (Parameter parameter : paramsResult.getParameters()) {
String key = parameter.getName().replace(context, "").replace('/', '.');
properties.put(key, parameter.getValue());

This comment has been minimized.

@devinsba

devinsba May 24, 2018

Contributor

Might it be good to handle KMS encrypted parameters here?

This comment has been minimized.

@jkuipers

jkuipers May 24, 2018

Contributor

They're already decrypted: withWithDecryption(true) takes care of that, assuming your service has the necessary authorities to do so.

@dsyer

This comment has been minimized.

Contributor

dsyer commented May 25, 2018

Merged in 24e2f81. I also re-deployed 2.0.0.RC2 to include this commit.

@jkuipers

This comment has been minimized.

Contributor

jkuipers commented May 25, 2018

Thanks for merging this Dave!

@jkuipers jkuipers deleted the jkuipers:param-store-config branch Jul 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment