I have a requirement to retrieve credentials from AWS Secret Manager, and I found that I need to add the gradle dependency for the following starter
spring-cloud-starter-aws-secrets-manager-config
Also, i found that I need to add the following settings in Bootstrap.yml
Property Configurations
I'm unclear how secret key could be accessed in my Spring Boot Application if someone could chime in much appreciated.
If you are using springboot 2.4+ the bootstrap method has been deprecated. The new way of integrate aws secret manager is this:
Add the following dependency to your app:
<dependency>
<groupId>io.awspring.cloud</groupId>
<artifactId>spring-cloud-starter-aws-secrets-manager-config</artifactId>
<version>${version}</version>
</dependency>
Add the following configuration:
spring.config.import: aws-secretsmanager:<your secret name in aws>
That's it!
The answer above maybe wrong.
The configuration store in secret manager should be:
key: /secret/application
value: {"username":"test"}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With