1

I am integrating the spring-cloud-aws-secrets-manager-config module with my SpringBoot application to fetch secrets from AWS Secrets Manager.

I have following two secrets in AWS Secrets Manager.

  1. /myapp/dbcredentials
  2. /myapp/apikey

Now, with bootstrap.yml, I am able to fetch either of these two secrets. Not both.

bootstrap.yml

aws:
  secretsmanager:
    prefix: /myapp
    defaultContext: application
    profileSeparator: _
    failFast: false
    name: dbcredentials
    enabled: true

What will be the configuration in bootstrap.yml to fetch both the secrets?

archis99
  • 15
  • 5
  • To retrieve secrets from Secrest Manager from a Sprig App, look at using the AWS SDK for Java Secrets Manager API over this 3rd party API. Using the Official AWS Java API has benefits such as you are supported by the AWS SDK Team. https://github.com/awsdocs/aws-doc-sdk-examples/tree/master/javav2/example_code/secretsmanager – smac2020 Jun 21 '21 at 14:19

1 Answers1

0

Starting from Spring cloud AWS 2.3, spring.config.import could be used to load more than one secrets

spring.config.import=aws-secretsmanager:secret-key;other-secret-key

https://docs.awspring.io/spring-cloud-aws/docs/2.3.0/reference/html/index.html#integrating-your-spring-cloud-application-with-the-aws-secrets-manager

Hope this helps !