From c5b0afc531583c69eb67cbbfef9d99f5ea016362 Mon Sep 17 00:00:00 2001 From: Jay Patel <78554593+jarpat@users.noreply.github.com> Date: Tue, 6 Feb 2024 13:05:13 -0500 Subject: [PATCH] fix: (IAC-922) Assign tags to resources missing them (#269) --- modules/aws_autoscaling/main.tf | 10 ++++++---- modules/aws_ebs_csi/main.tf | 10 ++++++---- modules/aws_vm/main.tf | 6 ++++++ 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/modules/aws_autoscaling/main.tf b/modules/aws_autoscaling/main.tf index cba193e8..b60c7af7 100644 --- a/modules/aws_autoscaling/main.tf +++ b/modules/aws_autoscaling/main.tf @@ -68,8 +68,10 @@ module "iam_assumable_role_with_oidc" { role_policy_arns = [aws_iam_policy.worker_autoscaling.arn] oidc_fully_qualified_subjects = ["system:serviceaccount:kube-system:cluster-autoscaler"] - tags = { - Role = "${var.prefix}-cluster-autoscaler" - } - + tags = merge( + { + Role = "${var.prefix}-cluster-autoscaler" + }, + var.tags + ) } diff --git a/modules/aws_ebs_csi/main.tf b/modules/aws_ebs_csi/main.tf index 2e60ecec..9eea0ca8 100644 --- a/modules/aws_ebs_csi/main.tf +++ b/modules/aws_ebs_csi/main.tf @@ -167,10 +167,12 @@ module "iam_assumable_role_with_oidc" { oidc_fully_qualified_audiences = ["sts.amazonaws.com"] oidc_fully_qualified_subjects = ["system:serviceaccount:kube-system:ebs-csi-controller-sa"] - tags = { - Role = "${var.prefix}-ebs-csi-role" - } - + tags = merge( + { + Role = "${var.prefix}-ebs-csi-role" + }, + var.tags + ) } resource "aws_iam_role_policy_attachment" "ebs_attachment" { diff --git a/modules/aws_vm/main.tf b/modules/aws_vm/main.tf index 457bb621..70ab14cb 100644 --- a/modules/aws_vm/main.tf +++ b/modules/aws_vm/main.tf @@ -81,6 +81,12 @@ resource "aws_instance" "vm" { delete_on_termination = var.os_disk_delete_on_termination iops = var.os_disk_iops encrypted = var.enable_ebs_encryption + tags = merge( + { + Name : "${var.name}-root-vol" + }, + var.tags + ) } tags = merge(var.tags, tomap({ Name : "${var.name}-vm" }))