Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

AWS Parameter Store with Hoxton SR8+ doesn't override properties when using multiple profiles #772

Open
peteguyatt opened this issue Apr 28, 2021 · 6 comments
Labels
component: parameter-store Parameter Store integration related issue type: bug A general bug

Comments

@peteguyatt
Copy link

Type: Bug

Component:

Parameter Store

Describe the bug
When using multiple active profiles with spring cloud Hoxton SR10 and boot 2.3.9 we have noticed that property order seems to have changed, for example if we have two properties set E.g.

spring.profiles.active=profile_a,profile_b

Parameter Store configured as:

application/profile_a/app.secret-key: abc-123
application/profile_b/app.secret-key: efd-213

and in our bean we have

@Value("${app.secret-key}")
private String secretKey; 

the value resolved will be abc-123 instead of efd-213

I looked through the commit history for AwsParamStorePropertySourceLocator and the issue seems to have been introduced in 582fdc6 where the Collections.reverse has been removed due to switching to using a LinkedHashSet

This looks like an accidental bug to me and the same bug exists in master and the 2.3.x branch

@github-actions github-actions bot added type: bug A general bug status: waiting-for-triage An issue we've not yet triaged labels Apr 28, 2021
peteguyatt added a commit to peteguyatt/spring-cloud-aws that referenced this issue Apr 28, 2021
peteguyatt added a commit to peteguyatt/spring-cloud-aws that referenced this issue Apr 28, 2021
@maciejwalkowiak
Copy link
Contributor

maciejwalkowiak commented Jul 21, 2021

@MatejNedic can you take a look at this one? We should fix it in both 2.2.x in this repo and 2.3.x in awspring. This PR too.

@maciejwalkowiak maciejwalkowiak added component: parameter-store Parameter Store integration related issue and removed status: waiting-for-triage An issue we've not yet triaged labels Jul 21, 2021
@WtfJoke
Copy link

WtfJoke commented Oct 19, 2021

I think I experience the same issue with both (secretsmanager and the parameter store).

In my case the least specific one always wins (eg. /config/application over /config/application_profile and both over /config/service)

Do you need a sample project? I might can extend the sample project. Or can I help in some other way to solve this issue? Should I test the PR?

EDIT: Woops, I thought I was in the new repo, there is an issue already open --> awspring/spring-cloud-aws#169

@peteguyatt
Copy link
Author

@WtfJoke You're correct the same issue exists with secrets manager too @maciejwalkowiak & @MatejNedic any chance of getting this merged in?

@peteguyatt
Copy link
Author

I'm happy to create a separate PR for the secrets manager fix too if there is a appetite for this

@WtfJoke
Copy link

WtfJoke commented Nov 3, 2021

@peteguyatt the PR awspring/spring-cloud-aws#195 contains fixes for both (secrets manager and parameter store).

Its probably better if we discuss in the new (migrated) issue 👍

@peteguyatt
Copy link
Author

@WtfJoke Thanks for porting the fix to the new repo and fixing secrets manager while you were at it, would you mind adding me as a contributor to the unit tests/PR in general?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
component: parameter-store Parameter Store integration related issue type: bug A general bug
Development

No branches or pull requests

3 participants