feat: Add tags to EKS created cluster security group to match rest of module tagging scheme (#1957)

This commit is contained in:
Bryant Biggs
2022-03-24 03:05:59 -04:00
committed by GitHub
parent ca7854a49c
commit 9371a2943b
2 changed files with 9 additions and 0 deletions

View File

@@ -829,6 +829,7 @@ Full contributing [guidelines are covered here](https://github.com/terraform-aws
| Name | Type | | Name | Type |
|------|------| |------|------|
| [aws_cloudwatch_log_group.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_group) | resource | | [aws_cloudwatch_log_group.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_group) | resource |
| [aws_ec2_tag.cluster_primary_security_group](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ec2_tag) | resource |
| [aws_eks_addon.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_addon) | resource | | [aws_eks_addon.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_addon) | resource |
| [aws_eks_cluster.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_cluster) | resource | | [aws_eks_cluster.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_cluster) | resource |
| [aws_eks_identity_provider_config.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_identity_provider_config) | resource | | [aws_eks_identity_provider_config.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_identity_provider_config) | resource |

View File

@@ -59,6 +59,14 @@ resource "aws_eks_cluster" "this" {
] ]
} }
resource "aws_ec2_tag" "cluster_primary_security_group" {
for_each = { for k, v in merge(var.tags, var.cluster_tags) : k => v if var.create }
resource_id = aws_eks_cluster.this[0].vpc_config[0].cluster_security_group_id
key = each.key
value = each.value
}
resource "aws_cloudwatch_log_group" "this" { resource "aws_cloudwatch_log_group" "this" {
count = local.create && var.create_cloudwatch_log_group ? 1 : 0 count = local.create && var.create_cloudwatch_log_group ? 1 : 0