From b7408268e51eef6c76163c162e5c5e1da7fd5413 Mon Sep 17 00:00:00 2001 From: Bora Kou Date: Fri, 14 Oct 2022 14:47:34 -0700 Subject: [PATCH] Add option to specify custom S3 bucket name --- variables.tf | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/variables.tf b/variables.tf index a3cd80b..a09a239 100644 --- a/variables.tf +++ b/variables.tf @@ -22,6 +22,12 @@ variable "snowflake_integration_user_roles" { description = "List of roles to which GEFF infra will GRANT USAGE ON INTEGRATION perms." } +variable "s3_bucket_name" { + type = string + default = "" + description = "Custom S3 bucket name." +} + variable "data_bucket_arns" { type = list(string) default = [] @@ -44,7 +50,7 @@ locals { } locals { - s3_bucket_name = "${replace(var.prefix, "_", "-")}-${var.env}-bucket" # Only hiphens + lower alphanumeric are allowed for bucket name + s3_bucket_name = var.s3_bucket_name == "" ? "${replace(var.prefix, "_", "-")}-${var.env}-bucket" : "${replace(var.s3_bucket_name, "_", "-")}" # Only hiphens + lower alphanumeric are allowed for bucket name s3_reader_role_name = "${var.prefix}-s3-reader" s3_sns_policy_name = "${var.prefix}-s3-sns-topic-policy" s3_bucket_policy_name = "${var.prefix}-rw-to-s3-bucket-policy"