From 99bc16b9b4bd8b9cf3f4b2485173926fae3ee6fc Mon Sep 17 00:00:00 2001 From: timburke-hackit <61045197+timburke-hackit@users.noreply.github.com> Date: Mon, 13 Nov 2023 15:52:24 +0000 Subject: [PATCH] Move addresses api export bucket (#1503) * Revert "move bucket (#1501)" This reverts commit 4b58732d674f8ee345bac0021ef32a38c79db91e. * move export bucket out of db_snapshot_to_s3 module * revert changes to liberator bucket paths * add aws_api_account provider --- terraform/core/10-aws-s3-buckets.tf | 26 ++++++++++++++++++++++++++ terraform/core/29-db-snapshot-to-s3.tf | 5 +++++ 2 files changed, 31 insertions(+) diff --git a/terraform/core/10-aws-s3-buckets.tf b/terraform/core/10-aws-s3-buckets.tf index fa0cec729..9115b3c5b 100644 --- a/terraform/core/10-aws-s3-buckets.tf +++ b/terraform/core/10-aws-s3-buckets.tf @@ -468,3 +468,29 @@ resource "aws_s3_bucket_server_side_encryption_configuration" "deprecated_rds_ex bucket_key_enabled = true } } + +module "addresses_api_rds_export_storage" { + source = "../modules/s3-bucket" + + tags = module.tags.values + project = var.project + environment = var.environment + identifier_prefix = local.identifier_prefix + bucket_name = "RDS Export Storage" + bucket_identifier = "rds-export-storage" + + providers = { + aws = aws.aws_api_account + } +} + +resource "aws_s3_bucket_server_side_encryption_configuration" "addresses_api_rds_export_storage" { + bucket = module.addresses_api_rds_export_storage.bucket_id + + rule { + apply_server_side_encryption_by_default { + sse_algorithm = "aws:kms" + } + bucket_key_enabled = true + } +} diff --git a/terraform/core/29-db-snapshot-to-s3.tf b/terraform/core/29-db-snapshot-to-s3.tf index cd63f5ba6..75349cca6 100644 --- a/terraform/core/29-db-snapshot-to-s3.tf +++ b/terraform/core/29-db-snapshot-to-s3.tf @@ -39,3 +39,8 @@ moved { from = module.db_snapshot_to_s3.module.rds_export_storage.aws_s3_bucket.bucket to = module.db_snapshot_to_s3[0].module.rds_export_storage.aws_s3_bucket.bucket } + +moved { + from = module.db_snapshot_to_s3[0].module.rds_export_storage.aws_s3_bucket.bucket + to = module.addresses_api_rds_export_storage.aws_s3_bucket.bucket +}