Description
Creating an issue from this as version 2.x of spring-cloud-aws had great support for Spring profile-based parameter retrieval, including using multiple profiles. In 3.x the support for spring profiles has been completely removed. A seemingly popular workaround has been posted to StackOverflow that leverages the spring.profiles.active
property. That solution looks like this:
spring:
config:
import:
- aws-parameterstore:/config/app_${spring.profiles.active}/
The problem with this approach is that parameters can only be retrieved for a single profile and only if there is one active profile. Even if you only want to load parameters based on one of multiple active profiles, the presence of additional profiles breaks the import string.
Would really like to see more complete profile support reintroduced into newer versions of this library.
Discussed in #1340
Originally posted by jaroslaw-blazkow February 5, 2025
Hi, I'm trying to migrate to the newest awspring libraries, but I cannot find solution for the new approach with specifying paramstore variables.
I've tried to use
spring.config.import: "aws-parameterstore:"
in bootstrap.yml but it seems its not longer supported with default resolvers with aws.parameterstore.separator
, etc. and left unbound, so I found out this solution:
spring:
config:
import:
- aws-parameterstore:/config/app_${spring.profiles.active}
but the problem is, that I've got couple profiles active. How to solve it?