From 3cfcf3c9124a37a9106ba15e4a132770b9f88972 Mon Sep 17 00:00:00 2001 From: Lucas Telles Date: Tue, 22 Oct 2024 17:20:17 -0300 Subject: [PATCH 01/11] [DOP-2325] Increase bucket module version --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 32271b60..83221bf3 100644 --- a/main.tf +++ b/main.tf @@ -211,7 +211,7 @@ module "security-group" { module "s3-storage" { source = "app.terraform.io/indico/indico-aws-buckets/mod" - version = "3.3.1" + version = "4.0.0" force_destroy = true # allows terraform to destroy non-empty buckets. label = var.label kms_key_arn = module.kms_key.key.arn From 912f29af70b83d58c73d66c0f5e74fef6addde5e Mon Sep 17 00:00:00 2001 From: Lucas Telles Date: Thu, 24 Oct 2024 16:24:23 -0300 Subject: [PATCH 02/11] test moved block --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 83221bf3..d15e8722 100644 --- a/main.tf +++ b/main.tf @@ -211,7 +211,7 @@ module "security-group" { module "s3-storage" { source = "app.terraform.io/indico/indico-aws-buckets/mod" - version = "4.0.0" + version = "4.0.1" force_destroy = true # allows terraform to destroy non-empty buckets. label = var.label kms_key_arn = module.kms_key.key.arn From ef1b8f957a0d0f4c115b9e416f6300534a74a76f Mon Sep 17 00:00:00 2001 From: Lucas Telles Date: Thu, 24 Oct 2024 16:26:34 -0300 Subject: [PATCH 03/11] test moved block --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index d15e8722..3abfa171 100644 --- a/main.tf +++ b/main.tf @@ -211,7 +211,7 @@ module "security-group" { module "s3-storage" { source = "app.terraform.io/indico/indico-aws-buckets/mod" - version = "4.0.1" + version = "4.0.2" force_destroy = true # allows terraform to destroy non-empty buckets. label = var.label kms_key_arn = module.kms_key.key.arn From 7ea2bb4bf62722a48d0cec05edc5adf7fd18b20e Mon Sep 17 00:00:00 2001 From: Lucas Telles Date: Thu, 24 Oct 2024 16:30:31 -0300 Subject: [PATCH 04/11] test moved block --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 3abfa171..d15e8722 100644 --- a/main.tf +++ b/main.tf @@ -211,7 +211,7 @@ module "security-group" { module "s3-storage" { source = "app.terraform.io/indico/indico-aws-buckets/mod" - version = "4.0.2" + version = "4.0.1" force_destroy = true # allows terraform to destroy non-empty buckets. label = var.label kms_key_arn = module.kms_key.key.arn From 9b70b27def575cb2c0d583e44503ed69301e6ce9 Mon Sep 17 00:00:00 2001 From: Lucas Telles Date: Thu, 24 Oct 2024 17:45:28 -0300 Subject: [PATCH 05/11] test moved block --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index d15e8722..3abfa171 100644 --- a/main.tf +++ b/main.tf @@ -211,7 +211,7 @@ module "security-group" { module "s3-storage" { source = "app.terraform.io/indico/indico-aws-buckets/mod" - version = "4.0.1" + version = "4.0.2" force_destroy = true # allows terraform to destroy non-empty buckets. label = var.label kms_key_arn = module.kms_key.key.arn From 4b84e1d694e3752660f3c5b68cec7e339e8375ca Mon Sep 17 00:00:00 2001 From: Lucas Telles Date: Thu, 24 Oct 2024 17:50:39 -0300 Subject: [PATCH 06/11] test moved block --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 3abfa171..73f8c109 100644 --- a/main.tf +++ b/main.tf @@ -211,7 +211,7 @@ module "security-group" { module "s3-storage" { source = "app.terraform.io/indico/indico-aws-buckets/mod" - version = "4.0.2" + version = "4.0.3" force_destroy = true # allows terraform to destroy non-empty buckets. label = var.label kms_key_arn = module.kms_key.key.arn From 9122bc73c6967bf1a41daf052e2f8afc85776bbc Mon Sep 17 00:00:00 2001 From: Lucas Telles Date: Thu, 24 Oct 2024 18:10:56 -0300 Subject: [PATCH 07/11] test moved block --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 73f8c109..5bcd89e6 100644 --- a/main.tf +++ b/main.tf @@ -211,7 +211,7 @@ module "security-group" { module "s3-storage" { source = "app.terraform.io/indico/indico-aws-buckets/mod" - version = "4.0.3" + version = "4.0.4" force_destroy = true # allows terraform to destroy non-empty buckets. label = var.label kms_key_arn = module.kms_key.key.arn From 8ea7578b99b3fcbd585ed7c963e2084df375f0ee Mon Sep 17 00:00:00 2001 From: Lucas Telles Date: Thu, 24 Oct 2024 18:27:46 -0300 Subject: [PATCH 08/11] test moved block --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 5bcd89e6..83221bf3 100644 --- a/main.tf +++ b/main.tf @@ -211,7 +211,7 @@ module "security-group" { module "s3-storage" { source = "app.terraform.io/indico/indico-aws-buckets/mod" - version = "4.0.4" + version = "4.0.0" force_destroy = true # allows terraform to destroy non-empty buckets. label = var.label kms_key_arn = module.kms_key.key.arn From 991e52cea9f2b354c487c3905ffde1aa84a09903 Mon Sep 17 00:00:00 2001 From: Lucas Telles Date: Fri, 25 Oct 2024 15:32:08 -0300 Subject: [PATCH 09/11] Add variables to load buckets --- main.tf | 1 + variables.tf | 59 ++++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 44 insertions(+), 16 deletions(-) diff --git a/main.tf b/main.tf index 83221bf3..8c0d9924 100644 --- a/main.tf +++ b/main.tf @@ -220,6 +220,7 @@ module "s3-storage" { include_rox = var.include_rox enable_backup = var.enable_s3_backup enable_access_logging = var.enable_s3_access_logging + bucket_type = var.bucket_type } diff --git a/variables.tf b/variables.tf index 463c087e..48731db6 100644 --- a/variables.tf +++ b/variables.tf @@ -824,50 +824,50 @@ variable "harness_mount_path" { } variable "lambda_sns_forwarder_enabled" { - type = bool - default = false + type = bool + default = false description = "If enabled a lamda will be provisioned to forward sns messages to an external endpoint." } variable "lambda_sns_forwarder_destination_endpoint" { - type = string - default = "" + type = string + default = "" description = "destination URL for the lambda sns forwarder" } variable "lambda_sns_forwarder_topic_arn" { - type = string - default = "" + type = string + default = "" description = "SNS topic to triger lambda forwarder." } variable "lambda_sns_forwarder_github_organization" { - type = string - default = "IndicoDataSolutions" + type = string + default = "IndicoDataSolutions" description = "The github organization containing the lambda_sns_forwarder code to use" } variable "lambda_sns_forwarder_github_repository" { - type = string - default = "" + type = string + default = "" description = "The github repository containing the lambda_sns_forwarder code to use" } variable "lambda_sns_forwarder_github_branch" { - type = string - default = "main" + type = string + default = "main" description = "The github branch / tag containing the lambda_sns_forwarder code to use" } variable "lambda_sns_forwarder_github_zip_path" { - type = string - default = "zip/lambda.zip" + type = string + default = "zip/lambda.zip" description = "Full path to the lambda zip file" } variable "lambda_sns_forwarder_function_variables" { - type = map - default = {} + type = map(any) + default = {} description = "A map of variables for the lambda_sns_forwarder code to use" } @@ -1043,3 +1043,30 @@ variable "instance_volume_type" { default = "gp2" description = "The type of EBS volume to attach to the cluster nodes" } + +variable "bucket_type" { + type = string + default = "create" + validation { + condition = var.bucket_type == "create" || var.bucket_type == "load" + error_message = "${var.bucket_type} not valid. Type must be either create or load" + } +} + +variable "data_s3_bucket_name" { + type = string + default = "" + description = "The name of the existing S3 bucket to be loaded and used as the data bucket" +} + +variable "api_models_s3_bucket_name" { + type = string + default = "" + description = "The name of the existing S3 bucket to be loaded and used as the API model bucket" +} + +variable "pgbackup_s3_bucket_name" { + type = string + default = "" + description = "The name of the existing S3 bucket to be loaded and used as the postgres backup bucket" +} From 67c9ff6e992dbbe642531aa4f5ffa30f84fb1ada Mon Sep 17 00:00:00 2001 From: Lucas Telles Date: Mon, 28 Oct 2024 14:49:04 -0300 Subject: [PATCH 10/11] Update s3 storage variables --- main.tf | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/main.tf b/main.tf index 8c0d9924..d743310e 100644 --- a/main.tf +++ b/main.tf @@ -210,17 +210,20 @@ module "security-group" { module "s3-storage" { - source = "app.terraform.io/indico/indico-aws-buckets/mod" - version = "4.0.0" - force_destroy = true # allows terraform to destroy non-empty buckets. - label = var.label - kms_key_arn = module.kms_key.key.arn - submission_expiry = var.submission_expiry - uploads_expiry = var.uploads_expiry - include_rox = var.include_rox - enable_backup = var.enable_s3_backup - enable_access_logging = var.enable_s3_access_logging - bucket_type = var.bucket_type + source = "app.terraform.io/indico/indico-aws-buckets/mod" + version = "4.0.0" + force_destroy = true # allows terraform to destroy non-empty buckets. + label = var.label + kms_key_arn = module.kms_key.key.arn + submission_expiry = var.submission_expiry + uploads_expiry = var.uploads_expiry + include_rox = var.include_rox + enable_backup = var.enable_s3_backup + enable_access_logging = var.enable_s3_access_logging + bucket_type = var.bucket_type + data_s3_bucket_name = var.data_s3_bucket_name + api_models_s3_bucket_name = var.api_models_s3_bucket_name + pgbackup_s3_bucket_name = var.pgbackup_s3_bucket_name } From 9af0b3cf68854ca2a9bf8035d73a5a01699b9339 Mon Sep 17 00:00:00 2001 From: Lucas Telles Date: Tue, 29 Oct 2024 13:55:12 -0300 Subject: [PATCH 11/11] Add output pgbackup_s3_bucket_name --- outputs.tf | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/outputs.tf b/outputs.tf index bc5bd026..fb0b04e6 100644 --- a/outputs.tf +++ b/outputs.tf @@ -9,12 +9,16 @@ output "data_s3_bucket_name" { value = module.s3-storage.data_s3_bucket_name } +output "pgbackup_s3_bucket_name" { + description = "Name of the pgbackup s3 bucket" + value = module.s3-storage.pgbackup_s3_bucket_name +} + output "s3_role_id" { description = "ID of the S3 role" value = module.cluster.s3_role_id } - output "efs_filesystem_id" { description = "ID of the EFS filesystem" value = var.include_efs == true ? module.efs-storage[0].efs_filesystem_id : ""