Repository navigation
Strip the Parameter Store path only from the start of parameter names - #1715
Open
sharanggupta wants to merge 1 commit into
Open
sharanggupta wants to merge 1 commit into
sharanggupta wants to merge 1 commit into
Conversation
ParameterStorePropertySource removed the parameter path from each parameter name with String.replace, which removes every occurrence of the path. With the root path, `aws-parameterstore:/`, every '/' was removed, so `/config/myservice/key1` became `configmyservicekey1` instead of `config.myservice.key1`. A name that repeats the path, such as `/config/myservice/legacy/config/myservice/key1` under `/config/myservice/`, lost the inner occurrence as well and became `legacykey1`. Remove the path only when it is the leading part of the name.
sharanggupta
requested review from
MatejNedic,
maciejwalkowiak and
tomazfernandes
as code owners
October 15, 2026 11:03
5 of 9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📢 Type of change
📜 Description
ParameterStorePropertySourcederives each property name by removing the parameter path from the parameter name. It usedString.replace, which removes every occurrence of the path, not only the leading one:aws-parameterstore://config/myservice/key1configmyservicekey1config.myservice.key1aws-parameterstore:/config/myservice//config/myservice/legacy/config/myservice/key1legacykey1legacy.config.myservice.key1With the root path every
/disappeared, so nested parameters could not bind to anything sensible. The path is now removed only when it is the start of the name.Names that contain the path only at the start, which is the usual case, resolve exactly as before. A path without a trailing
/also behaves as before (see #1406 and #1714 for the warning about that case). The?prefix=and?extension=handling is unchanged.Behaviour change to be aware of: an application that imports the root path, or that has parameter names repeating the path, and that relied on the mangled names above (for example
${configmyservicekey1}) will see those properties under the corrected names instead.💡 Motivation and Context
I found this while working on #1406 in the same class. I did not find an existing issue for it.
💚 How did you test it?
Test first: the two new
ParameterStorePropertySourceTestcases failed before the change withconfigmyservicekey1andlegacykey1, and pass with it../mvnw -pl spring-cloud-aws-parameter-store -am verifypasses, including Spotless.📝 Checklist
🔮 Next steps
None planned.