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

move bucket creation out of liberator module #1498

Merged
merged 4 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions terraform/core/36-liberator-import.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,29 @@ module "liberator_dump_to_rds_snapshot" {
vpc_id = data.aws_vpc.network.id
}

module "liberator_db_snapshot_to_s3" {
count = 1
source = "../modules/db-snapshot-to-s3"
tags = module.tags.values
project = var.project
environment = var.environment
identifier_prefix = "${local.identifier_prefix}-dp"
lambda_artefact_storage_bucket = module.lambda_artefact_storage.bucket_id
zone_kms_key_arn = module.landing_zone.kms_key_arn
zone_bucket_arn = module.landing_zone.bucket_arn
zone_bucket_id = module.landing_zone.bucket_id
rds_export_storage_bucket_arn = module.rds_export_storage.bucket_arn
rds_export_storage_bucket_id = module.rds_export_storage.bucket_id
rds_export_storage_kms_key_arn = module.rds_export_storage.kms_key_arn
rds_export_storage_kms_key_id = module.rds_export_storage.kms_key_id
service_area = "parking"
rds_instance_ids = [for item in module.liberator_dump_to_rds_snapshot : item.rds_instance_id]
workflow_name = aws_glue_workflow.parking_liberator_data.name
workflow_arn = aws_glue_workflow.parking_liberator_data.arn
backdated_workflow_name = aws_glue_workflow.parking_liberator_backdated_data.name
backdated_workflow_arn = aws_glue_workflow.parking_liberator_backdated_data.arn
}

resource "aws_glue_workflow" "parking_liberator_data" {
# Components for this workflow are managed mainly in etl/38-aws-glue-job-parking.tf by parking officers
# There are couple of other resources that are part of the ingestion process, but the core ETL configuration is in the file mentioned above
Expand Down Expand Up @@ -82,3 +105,8 @@ module "liberator_rds_snapshot_to_s3" {
backdated_workflow_name = aws_glue_workflow.parking_liberator_backdated_data.name
backdated_workflow_arn = aws_glue_workflow.parking_liberator_backdated_data.arn
}

moved {
from = module.liberator_db_snapshot_to_s3[0].module.rds_export_storage.aws_s3_bucket.bucket_id
to = module.deprecated_rds_export_storage.aws_s3_bucket.bucket_id
}
12 changes: 0 additions & 12 deletions terraform/modules/db-snapshot-to-s3/10-s3.tf
Original file line number Diff line number Diff line change
@@ -1,13 +1 @@
module "rds_export_storage" {
source = "../s3-bucket"

tags = var.tags
project = var.project
environment = var.environment
identifier_prefix = var.identifier_prefix
bucket_name = "RDS Export Storage"
bucket_identifier = "rds-export-storage${var.aws_account_suffix}"
role_arns_to_share_access_with = [
aws_iam_role.rds_snapshot_to_s3_lambda.arn
]
}
Loading