Replies: 4 comments 16 replies
-
This isn't currently possible and I am not sure if ever will be. Do other |
Beta Was this translation helpful? Give feedback.
-
Hi @jobas2007, I'm facing the same problem, did you find a solution? |
Beta Was this translation helpful? Give feedback.
-
To summarize - the issue is that when multiple secrets containing JSON properties are imported, and same keys exist in both secret JSONs then value from one secret overwrites the other. For example
{ "username": "postgres" }
{ "username": "root" } I am thinking how this can be solved. We could add a prefix option: spring:
config:
import: aws-secretsmanager:/secrets/first-secret?prefix=first,aws-secretsmanager:/secret/second-secret?prefix=second Then they would be imported as:
What do you think about it? Perhaps there is more idiomatic way to do it with Spring Boot? @spencergibb @wilkinsona your suggestion would be appreciated. |
Beta Was this translation helpful? Give feedback.
-
We have PR ready #622 |
Beta Was this translation helpful? Give feedback.
-
label:"component: secrets-manager"
** also did put on stack overflow - https://stackoverflow.com/questions/72264774/retrieve-multiple-aws-secrete-in-spring-boot-app-that-have-same-keys
Have a spring boot app (with starter parent at 2.4.8).
The app is connecting to multiple data sources, and the automated Jenkins job being used to create secrets across company does it such a way that although secrets names are different(per app/source) but they all have same value underneath - 'username' and 'password' text.
For example:
First secret would be '/secret/rds/dev/foo/foo_app_user' with value:
username : user1
password: pass1
second secret would be '/secret/snowflake/dev/hoo/hoo_app_user' with value:
username : user2
password: pass2
Trying to figure out how can they both be imported using spring config import, while still being able to be used distinctively in properties/yaml file (NOTE: already have tried with optional also)
`
...
....
Beta Was this translation helpful? Give feedback.
All reactions