Skip to content

Instantly share code, notes, and snippets.

@deoxxa
Created August 11, 2014 05:20
Show Gist options
  • Save deoxxa/59998b8411194a56378d to your computer and use it in GitHub Desktop.
Save deoxxa/59998b8411194a56378d to your computer and use it in GitHub Desktop.
resource "aws_vpc" "main" {
cidr_block = "172.22.0.0/16"
enable_dns_support = true
enable_dns_hostnames = true
tag {
key = "Environment"
value = "Testing"
}
tag {
key = "Name"
value = "[Testing] VPC"
}
}
resource "aws_security_group" "testing" {
vpc_id = "${aws_vpc.main.id}"
name = "testing"
description = "Testing"
ingress {
protocol = "icmp"
from_port = 0
to_port = -1
cidr_blocks = ["0.0.0.0/0"]
}
ingress {
protocol = "icmp"
from_port = 8
to_port = -1
cidr_blocks = ["0.0.0.0/0"]
}
ingress {
protocol = "tcp"
from_port = 80
to_port = 80
cidr_blocks = ["3.0.0.0/24"]
}
ingress {
protocol = "tcp"
from_port = 80
to_port = 80
cidr_blocks = ["1.0.0.0/24"]
}
ingress {
protocol = "tcp"
from_port = 80
to_port = 80
cidr_blocks = ["2.0.0.0/24"]
}
ingress {
protocol = "tcp"
from_port = 443
to_port = 443
cidr_blocks = ["0.0.0.0/0"]
}
ingress {
protocol = "tcp"
from_port = 1000
to_port = 65535
cidr_blocks = ["0.0.0.0/0"]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment