Skip to content

Commit 9c2a718

Browse files
authored
fix: Add vpc_config.cluster_security_group output as primary cluster security group id (#828)
1 parent 36d1b5a commit 9c2a718

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,8 @@ MIT Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-a
219219
| cluster\_iam\_role\_name | IAM role name of the EKS cluster. |
220220
| cluster\_id | The name/id of the EKS cluster. |
221221
| cluster\_oidc\_issuer\_url | The URL on the EKS cluster OIDC Issuer |
222-
| cluster\_security\_group\_id | Security group ID attached to the EKS cluster. |
222+
| cluster\_primary\_security\_group\_id | The cluster primary security group ID created by the EKS cluster on 1.14 or later. Referred to as 'Cluster security group' in the EKS console. |
223+
| cluster\_security\_group\_id | Security group ID attached to the EKS cluster. On 1.14 or later, this is the 'Additional security groups' in the EKS console. |
223224
| cluster\_version | The Kubernetes server version for the EKS cluster. |
224225
| config\_map\_aws\_auth | A kubernetes configuration to authenticate to this EKS cluster. |
225226
| kubeconfig | kubectl config file contents for this EKS cluster. |

outputs.tf

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ output "cluster_version" {
2424
}
2525

2626
output "cluster_security_group_id" {
27-
description = "Security group ID attached to the EKS cluster."
27+
description = "Security group ID attached to the EKS cluster. On 1.14 or later, this is the 'Additional security groups' in the EKS console."
2828
value = local.cluster_security_group_id
2929
}
3030

@@ -48,6 +48,11 @@ output "cluster_oidc_issuer_url" {
4848
value = flatten(concat(aws_eks_cluster.this[*].identity[*].oidc.0.issuer, [""]))[0]
4949
}
5050

51+
output "cluster_primary_security_group_id" {
52+
description = "The cluster primary security group ID created by the EKS cluster on 1.14 or later. Referred to as 'Cluster security group' in the EKS console."
53+
value = var.cluster_version >= 1.14 ? element(concat(aws_eks_cluster.this[*].vpc_config[0].cluster_security_group_id, list("")), 0) : null
54+
}
55+
5156
output "cloudwatch_log_group_name" {
5257
description = "Name of cloudwatch log group created"
5358
value = aws_cloudwatch_log_group.this[*].name

0 commit comments

Comments
 (0)