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

Add aws-secretsmanager: prefix config import #721

Merged
merged 10 commits into from
Dec 4, 2020

Conversation

eddumelendez
Copy link
Contributor

@eddumelendez eddumelendez commented Nov 13, 2020

In spring-boot 2.4, Volume Mounted Config Directory Trees was
added. This commit introduces the prefix aws-secretsmanager: which
will resolve the values given the configuration properties supported
by secrets manager integration. Also, if keys are added after the
prefix then just these will be resolved.

Use: aws-secretsmanager: or aws-secretsmanager:my-secret-key or
aws-secretsmanager:my-secret-key;my-anoter-secret-key

Closes gh-655
Closes gh-515

@github-actions github-actions bot added component: secrets-manager Secrets Manager integration related issue type: dependency-upgrade A dependency upgrade labels Nov 13, 2020
In `spring-boot` 2.4, `Volume Mounted Config Directory Trees` was
added. This commit introduces the prefix `aws-secretsmanager:` which
will resolve the values given the configuration properties supported
by secrets manager integration. Also, if keys are added after the
prefix then just these will be resolved.

Use: `aws-secretsmanager:` or `aws-secretsmanager:my-secret-key` or
`aws-secretsmanager:my-secret-key;my-anoter-secret-key`

Closes spring-atticgh-655
@eddumelendez eddumelendez added this to the 2.3 milestone Nov 14, 2020
@eddumelendez eddumelendez marked this pull request as ready for review November 14, 2020 06:09
@github-actions github-actions bot added the type: documentation A documentation update label Nov 14, 2020
Copy link
Contributor

@maciejwalkowiak maciejwalkowiak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @eddumelendez! I left few comments - we need to figure out the proper handling of optional config data import.

Btw, Vault integration could be helpful reference for us in general for this feature: spring-cloud/spring-cloud-vault@451ccb0

It would be great if you could add Javadocs but they can be also added later. Once this one is merged I will create a PR with a sample that I did to verify how/if it works.


However, starting at `spring-cloud-aws` `2.3`, allows import default aws' secretsmanager keys
(`spring.config.import=aws-secretsmanager:`) or individual keys
(`spring.config.import=aws-secretsmanager:secret-key;other-secret-key`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to document that it can be used with optional prefix.

spring-cloud-starter-aws-secrets-manager-config/pom.xml Outdated Show resolved Hide resolved
eddumelendez and others added 2 commits November 24, 2020 23:12
…org/springframework/cloud/aws/autoconfigure/secretsmanager/AwsSecretsManagerConfigDataLocationResolver.java

Co-authored-by: Maciej Walkowiak <walkowiak.maciej@yahoo.com>
@maciejwalkowiak
Copy link
Contributor

failFast and optional did not work well for me. I fixed it and polished but I can't create a PR to your branch cause you pushed it into your fork, so please take a look at the commit: 21011e6 and maybe cherry pick it

@eddumelendez eddumelendez merged commit e976243 into spring-attic:2.3.x Dec 4, 2020
maciejwalkowiak added a commit to awspring/spring-cloud-aws that referenced this pull request Dec 19, 2020
…ud-aws#721)

In `spring-boot` 2.4, `Volume Mounted Config Directory Trees` was
added. This commit introduces the prefix `aws-secretsmanager:` which
will resolve the values given the configuration properties supported
by secrets manager integration. Also, if keys are added after the
prefix then just these will be resolved.

Use: `aws-secretsmanager:` or `aws-secretsmanager:my-secret-key` or
`aws-secretsmanager:my-secret-key;my-anoter-secret-key`

Closes spring-attic/spring-cloud-aws#655
Closes spring-attic/spring-cloud-aws#515

Co-authored-by: Maciej Walkowiak <walkowiak.maciej@yahoo.com>
juho9000 pushed a commit to juho9000/spring-cloud-aws that referenced this pull request Apr 29, 2021
…ud-aws#721)

In `spring-boot` 2.4, `Volume Mounted Config Directory Trees` was
added. This commit introduces the prefix `aws-secretsmanager:` which
will resolve the values given the configuration properties supported
by secrets manager integration. Also, if keys are added after the
prefix then just these will be resolved.

Use: `aws-secretsmanager:` or `aws-secretsmanager:my-secret-key` or
`aws-secretsmanager:my-secret-key;my-anoter-secret-key`

Closes spring-attic/spring-cloud-aws#655
Closes spring-attic/spring-cloud-aws#515

Co-authored-by: Maciej Walkowiak <walkowiak.maciej@yahoo.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
component: secrets-manager Secrets Manager integration related issue type: dependency-upgrade A dependency upgrade type: documentation A documentation update
Development

Successfully merging this pull request may close these issues.

2 participants