Skip to content

Commit

Permalink
FIX archive variable assignments
Browse files Browse the repository at this point in the history
  • Loading branch information
ramesh-maddegoda committed Aug 15, 2024
1 parent 556e73e commit 5fb13fa
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
10 changes: 5 additions & 5 deletions terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions terraform/terraform-modules/archive/archive.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}
9 changes: 4 additions & 5 deletions terraform/terraform-modules/archive/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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-<venue-name>"
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-<venue-name>"
type = string
sensitive = true
Expand All @@ -22,4 +22,3 @@ variable "pds_nucleus_cold_archive_name_postfix" {




0 comments on commit 5fb13fa

Please sign in to comment.