Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for multiple ENV variables sharing the same bref-ssm: parameters #9

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

selfsimilar
Copy link

In the unlikely (but definitely encountered) event that multiple ENV variables share the same bref-ssm: parameter, prior to this fix, only the first declared ENV variable would be replaced. Subsequent ENV variables would contain the bref-ssm:/example token.

This simple fix is to iterate over $envVarsToDecrypt instead of $parameters, since there's no guarantee of a 1:1 relationship.

The biggest change is a refactor to the tests. I had to slot the new test before test throws a clear error message on missing permissions() because I couldn't get SOME_VARIABLE=bref-ssm:/app/test to clear before running the next test. I spent some time trying to clear the set ENV variables (setenv('SOME_VARIABLE');) but that didn't seem to help. Regardless, the tests run clean now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant