Skip to content

⚠️ Convert secret module to create multiple secrets#877

Merged
lorenyu merged 2 commits intomainfrom
lorenyu/secrets
Feb 22, 2025
Merged

⚠️ Convert secret module to create multiple secrets#877
lorenyu merged 2 commits intomainfrom
lorenyu/secrets

Conversation

@lorenyu
Copy link
Copy Markdown
Contributor

@lorenyu lorenyu commented Feb 21, 2025

Ticket

Resolves #642

Changes

  • Rename modules/secret to modules/secrets with the following changes:
    • Accept multiple secrets instead of a single secret
    • Accept the service name
    • Outputs multiple secret arns instead of a single secret arn
  • Refactor service layer root modules based on module changes

⚠️ (Optional) migration notes

For secrets with manage_method="generated", if you want to avoid regenerating the secrets, you can move the secrets to the new location with:

terraform -chdir=infra/<APP_NAME>/service state mv 'module.secrets["<SECRET_NAME>"].aws_ssm_parameter.secret[0]' 'module.secrets.aws_ssm_parameter.secrets["<SECRET_NAME>"]'
terraform -chdir=infra/<APP_NAME>/service state mv 'module.secrets["<SECRET_NAME>"].random_password.secret[0]' 'module.secrets.random_password.secrets["<SECRET_NAME>"]'    

Context for reviewers

Testing instructions, background context, more in-depth details of the implementation, and anything else you'd like to call out or ask reviewers.

Testing

See navapbc/platform-test#180

@lorenyu lorenyu merged commit 8d7ab07 into main Feb 22, 2025
9 checks passed
@lorenyu lorenyu deleted the lorenyu/secrets branch February 22, 2025 00:06
@lorenyu lorenyu changed the title Convert secret module to create multiple secrets ⚠️ Convert secret module to create multiple secrets Feb 22, 2025
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.

Convert secret module to create multiple secrets

1 participant