[NDH-583] Tracking Secret Rotation Lambda #289
Closed
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.
Important
I did not run
terraform applyon this yet. This is just to show the code that I've been working on. Not sure the best practices but I can runterraform applywhen approved. Or does it run automatically innpd_opsbuilds?Tracking Secret Rotation Lambda
Jira Ticket #583
Problem
We had a rotation lambda that handles the rotation of a postgres user secret. This was not tracked in source control since it was created via ClickOps
Solution
Use
terraform importto import the actual states and write terraform code to match it so that as little changes as possible show up meaning that the terraform matches the actual AWS state.Result
Terraform has been created that matches AWS state. We now track secret rotation within source
Some important notes regarding the summary line:
terraform apply. Not sure the best way to handle thisTest Plan
terraform -chdir=envs/dev planon theinfrastructuredirectory and check the drift