Describe the bug
Not entirely sure this is a bug or I'm missing something very trivial but when starting my app with a profile the secret manager still tries to fetch a secret with the values it finds in the application.yml which makes it impossible to test the app locally.
Sample
Spring Boot 2.4.2
spring-cloud-starter-aws-secrets-manager-config 2.3.0-RC2
Two property files
application.yml
application-dev.yml
I just need to fetch one secret entry from AWS Secret Manager so I have defined this in the application.yml
When I start the app with the -Dspring.profiles.active=dev the library tries to fetch the secret first using the value in application.yml and off course fails because the endpoint will be the default aws one.
I have tried using only spring.config.import: 'aws-secretsmanager:' since the doc says it will fetch the secret for the active profile but it still tries to fetch the secret using the endpoint in the application.yml file
Why is the library still trying to load the secret using the application.yml when the app is started with the dev profile ?
Is there a way to 'only' fetch the secret for the profile that is currently active ?
Type: Bug
Component: "Secrets Manager"
Describe the bug Not entirely sure this is a bug or I'm missing something very trivial but when starting my app with a profile the secret manager still tries to fetch a secret with the values it finds in the application.yml which makes it impossible to test the app locally.
Sample Spring Boot 2.4.2 spring-cloud-starter-aws-secrets-manager-config 2.3.0-RC2
Two property files
I just need to fetch one secret entry from AWS Secret Manager so I have defined this in the
application.yml
And I'm amending the endpoint for the dev profile (in
application-dev.yml
) in order to use localstackWhen I start the app with the
-Dspring.profiles.active=dev
the library tries to fetch the secret first using the value inapplication.yml
and off course fails because the endpoint will be the default aws one.I have tried using only
spring.config.import: 'aws-secretsmanager:'
since the doc says it will fetch the secret for the active profile but it still tries to fetch the secret using the endpoint in theapplication.yml
fileWhy is the library still trying to load the secret using the application.yml when the app is started with the dev profile ? Is there a way to 'only' fetch the secret for the profile that is currently active ?