diff --git a/terraform/main.tf b/terraform/main.tf index a6d0540..6cefdc5 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -9,11 +9,11 @@ module "common" { # Terraform module to create archive for PDS Nucleus module "archive" { - source = "./terraform-modules/archive" - pds_node_names = var.pds_node_names - depends_on = [module.common, module.ecs_ecr] - pds_nucleus_hot_archive_name_postfix = var.pds_nucleus_hot_archive_name_postfix - pds_nucleus_cold_archive_name_postfix = var.pds_nucleus_cold_archive_name_postfix + source = "./terraform-modules/archive" + pds_node_names = var.pds_node_names + depends_on = [module.common, module.ecs_ecr] + pds_nucleus_hot_archive_bucket_name_postfix = var.pds_nucleus_hot_archive_bucket_name_postfix + pds_nucleus_cold_archive_bucket_name_postfix = var.pds_nucleus_cold_archive_bucket_name_postfix } # The Terraform module to create the PDS Nucleus Baseline System (without any project specific components) diff --git a/terraform/terraform-modules/archive/archive.tf b/terraform/terraform-modules/archive/archive.tf index ae3ccaf..404a2e9 100644 --- a/terraform/terraform-modules/archive/archive.tf +++ b/terraform/terraform-modules/archive/archive.tf @@ -4,12 +4,12 @@ resource "aws_s3_bucket" "pds_nucleus_hot_archive" { count = length(var.pds_node_names) # convert PDS node name to S3 bucket name compatible format - bucket = "${lower(replace(var.pds_node_names[count.index], "_", "-"))}-${var.pds_nucleus_hot_archive_name_postfix}" + bucket = "${lower(replace(var.pds_node_names[count.index], "_", "-"))}-${var.pds_nucleus_hot_archive_bucket_name_postfix}" } # Create a cold archive for each PDS Node resource "aws_s3_bucket" "pds_nucleus_cold_archive" { count = length(var.pds_node_names) # convert PDS node name to S3 bucket name compatible format - bucket = "${lower(replace(var.pds_node_names[count.index], "_", "-"))}-${var.pds_nucleus_cold_archive_name_postfix}" + bucket = "${lower(replace(var.pds_node_names[count.index], "_", "-"))}-${var.pds_nucleus_cold_archive_bucket_name_postfix}" } diff --git a/terraform/terraform-modules/archive/variables.tf b/terraform/terraform-modules/archive/variables.tf index 58d3ddc..307abe1 100644 --- a/terraform/terraform-modules/archive/variables.tf +++ b/terraform/terraform-modules/archive/variables.tf @@ -4,15 +4,15 @@ variable "pds_node_names" { sensitive = true } -variable "pds_nucleus_hot_archive_name_postfix" { - description = "The postfix of the name of the hot archive" +variable "pds_nucleus_hot_archive_bucket_name_postfix" { + description = "The postfix of the name of the hot archive s3 bucket" default = "hot-archive-" type = string sensitive = true } -variable "pds_nucleus_cold_archive_name_postfix" { - description = "The postfix of the name of the cold archive" +variable "pds_nucleus_cold_archive_bucket_name_postfix" { + description = "The postfix of the name of the cold archive s3 bucket" default = "cold-archive-" type = string sensitive = true @@ -22,4 +22,3 @@ variable "pds_nucleus_cold_archive_name_postfix" { -