Skip to content

Instantly share code, notes, and snippets.

@hendrixroa
Created May 3, 2023 01:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hendrixroa/1733d7e8a76f808d6d02f34ecf1d6cdd to your computer and use it in GitHub Desktop.
Save hendrixroa/1733d7e8a76f808d6d02f34ecf1d6cdd to your computer and use it in GitHub Desktop.
AWS EC2 Security group using custom VPC
resource "aws_security_group" "sample" {
name = "sample"
description = "security group"
vpc_id = module.vpc.vpc_id
ingress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
ingress {
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_blocks = ["::/0"]
}
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
egress {
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_blocks = ["::/0"]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment