Data Source: aws_security_groups

Use this data source to get IDs and VPC membership of Security Groups that are created outside of Terraform.

Example Usage

data "aws_security_groups" "test" {
  tags = {
    Application = "k8s"
    Environment = "dev"
  }
}
data "aws_security_groups" "test" {
  filter {
    name   = "group-name"
    values = ["*nodes*"]
  }

  filter {
    name   = "vpc-id"
    values = [var.vpc_id]
  }
}

Argument Reference

Attribute Reference

This data source exports the following attributes in addition to the arguments above:

Timeouts

Configuration options: