Skip to content

Commit ae07b73

Browse files
bryantbiggsspr-mweber3
authored andcommitted
feat: Add tags to EKS created cluster security group to match rest of module tagging scheme (terraform-aws-modules#1957)
1 parent 02a33d1 commit ae07b73

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,7 @@ Full contributing [guidelines are covered here](https://github.com/terraform-aws
829829
| Name | Type |
830830
|------|------|
831831
| [aws_cloudwatch_log_group.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_group) | resource |
832+
| [aws_ec2_tag.cluster_primary_security_group](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ec2_tag) | resource |
832833
| [aws_eks_addon.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_addon) | resource |
833834
| [aws_eks_cluster.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_cluster) | resource |
834835
| [aws_eks_identity_provider_config.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_identity_provider_config) | resource |

main.tf

+8
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ resource "aws_eks_cluster" "this" {
5959
]
6060
}
6161

62+
resource "aws_ec2_tag" "cluster_primary_security_group" {
63+
for_each = { for k, v in merge(var.tags, var.cluster_tags) : k => v if var.create }
64+
65+
resource_id = aws_eks_cluster.this[0].vpc_config[0].cluster_security_group_id
66+
key = each.key
67+
value = each.value
68+
}
69+
6270
resource "aws_cloudwatch_log_group" "this" {
6371
count = local.create && var.create_cloudwatch_log_group ? 1 : 0
6472

0 commit comments

Comments
 (0)