Skip to content

Commit f337d4f

Browse files
bryantbiggsit-without-politics
authored andcommitted
feat: Add tags to EKS created cluster security group to match rest of module tagging scheme (terraform-aws-modules#1957)
1 parent 5525846 commit f337d4f

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
@@ -827,6 +827,7 @@ Full contributing [guidelines are covered here](https://github.com/terraform-aws
827827
| Name | Type |
828828
|------|------|
829829
| [aws_cloudwatch_log_group.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_group) | resource |
830+
| [aws_ec2_tag.cluster_primary_security_group](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ec2_tag) | resource |
830831
| [aws_eks_addon.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_addon) | resource |
831832
| [aws_eks_cluster.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_cluster) | resource |
832833
| [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
@@ -55,6 +55,14 @@ resource "aws_eks_cluster" "this" {
5555
]
5656
}
5757

58+
resource "aws_ec2_tag" "cluster_primary_security_group" {
59+
for_each = { for k, v in merge(var.tags, var.cluster_tags) : k => v if var.create }
60+
61+
resource_id = aws_eks_cluster.this[0].vpc_config[0].cluster_security_group_id
62+
key = each.key
63+
value = each.value
64+
}
65+
5866
resource "aws_cloudwatch_log_group" "this" {
5967
count = var.create && var.create_cloudwatch_log_group ? 1 : 0
6068

0 commit comments

Comments
 (0)