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, clean up & update database backups bucket TF. #1795

Merged
merged 2 commits into from
Nov 1, 2023
Merged

Conversation

sengi
Copy link
Contributor

@sengi sengi commented Oct 31, 2023

  • Update to Terraform 1.0 syntax.
  • Use current version of Terraform and providers. Module is now deployable from arm64.
  • Use current (non-deprecated) resources for configuring S3 buckets and replication.
  • Remove disused IAM policies.
  • Enable access logging on the database-backups-replica bucket.

Already applied in all three environments (via TF 0.13).

This a prerequisite for enabling timelock, since our replication config needs to be in order before filing the ticket with Amazon to enable Object Lock on existing S3 buckets.

It's probably easier to read the new files than to read the diff.

@sengi sengi requested a review from samsimpson1 October 31, 2023 19:55
- Update to Terraform 1.0 syntax.
- Use [standard module structure].
- Use current version of Terraform and providers. Module is now
  deployable from arm64.
- Use current (non-deprecated) resources for configuring S3 buckets and
  replication.
- Avoid unchecked templating; use aws_iam_policy_document resource so
  that IAM policies are at least somewhat validated at plan time and
  some common gotchas are no longer possible (like silently dropping
  duplicate JSON keys).
- Remove disused IAM policies.
- Enable access logging on the database-backups-replica bucket.
- Add the [necessary permissions] over the source bucket to the
  replication role so that replication will still work once Object Lock
  is enabled.

Already applied in all three environments (via TF 0.13).

[necessary permissions]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock-managing.html#object-lock-managing-replication
[standard module structure]: https://developer.hashicorp.com/terraform/language/modules/develop/structure
@sengi sengi merged commit 27b7bba into main Nov 1, 2023
1 check passed
@sengi sengi deleted the sengi/timelock branch November 1, 2023 12:26
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.

2 participants