-
-
Notifications
You must be signed in to change notification settings - Fork 303
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
Simplify using Localstack with ParameterStore and SecretsManager #1080
Comments
@rieckpil @spencergibb perhaps you have some ideas how this can be done in a better way? The issue is, Parameter Store and Secrets Manager integrations run in the bootstrap phase - for |
Good point, I guess I'm lacking some in-depth knowledge of the Spring bootstrap phase here, maybe @sbrannen has a quick idea |
I don't have anything else to add. Maybe @philwebb might. |
Hi, So far there is no issues with spring-cloud-aws but if |
@eddumelendez thanks for chiming in. With Considering that the amount of boilerplate required to use bootstrap context initializers in tests is so high, I think sticking to Perhaps we can provide a static method like this just to make it a bit simpler: static void configureLocalStack(DynamicPropertyRegistry registry, LocalStackContainer localstack) {
registry.add("spring.cloud.aws.credentials.access-key", localstack::getAccessKey);
registry.add("spring.cloud.aws.credentials.secret-key", localstack::getSecretKey);
registry.add("spring.cloud.aws.region.static", localstack::getRegion);
registry.add("spring.cloud.aws.endpoint", localstack::getEndpoint);
} Sample usage: @Container
private static LocalStackContainer localstack = new LocalStackContainer(
DockerImageName.parse("localstack/localstack:3.2.0"));
@DynamicPropertySource
static void properties(DynamicPropertyRegistry registry) {
configureLocalStack(registry, localstack);
} |
Sorry, not off the top of my head. The bootstrap logic is always quite difficult to get right. |
@ServiceConnection
support that's being added in #1075 does not help with ParameterStore and SecretsManager, as those integration are initiated in the bootstrap phase, before service connection related factories kick in.We can provide a
BootstrapRegistryInitializer
implementation for Localstack:that can be used like this:
The text was updated successfully, but these errors were encountered: