Skip to content

Instantly share code, notes, and snippets.

@jbouse
Created October 19, 2022 19:56
Show Gist options
  • Save jbouse/7432021ceb9a2bcec9cb3420e690f9b0 to your computer and use it in GitHub Desktop.
Save jbouse/7432021ceb9a2bcec9cb3420e690f9b0 to your computer and use it in GitHub Desktop.
AWS EKS Cluster Security Group ID lookup
data "aws_security_group" "eks_cluster" {
tags = {
"aws:eks:cluster-name" = var.eks_cluster_name
}
}
output "eks_cluster_security_group_id" {
value = data.aws_security_group.eks_cluster.id
description = "EKS Cluster Security Group ID"
}
variable "eks_cluster_name" {
type = string
description = "EKS cluster name"
}
terraform {
required_version = ">= 1.1"
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 3.0"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment