From 1899b2b46460541e6ec4c33299d1428cc779b872 Mon Sep 17 00:00:00 2001 From: Rebecca Whitehurst-Martin Date: Mon, 28 Oct 2024 15:48:30 +0000 Subject: [PATCH 1/2] add further variablisation into resource names, to prevent duplication when module is run in a for loop --- iam.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iam.tf b/iam.tf index be0e1d2..0e26c48 100644 --- a/iam.tf +++ b/iam.tf @@ -38,7 +38,7 @@ resource "aws_iam_role_policy_attachment" "static_site_policy_attachment" { } resource "aws_iam_policy" "static_site_policy" { - name = "static-site-iam-policy" + name = "static-site-${var.tenant_vars.component}-iam-policy" policy = data.aws_iam_policy_document.static_site_policy_document.json } From 3bd9f4e599c41e78d3b8ee6f6fcad521a67c57a7 Mon Sep 17 00:00:00 2001 From: Rebecca Whitehurst-Martin Date: Tue, 4 Feb 2025 17:20:42 +0000 Subject: [PATCH 2/2] specify missing vars product and component, needed for resource naming --- variables.tf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/variables.tf b/variables.tf index 00f04b1..c0bb871 100644 --- a/variables.tf +++ b/variables.tf @@ -13,6 +13,11 @@ variable "tenant_vars" { cloudfront_aliases = string cloudfront_cert = string cloudfront_function_rewrite_arn = string + + #required for naming of resources + #e.g. "cc-static-site-${var.tenant_vars.product}-${var.tenant_vars.component}" + component = string + product = string }) }