Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- resource "aws_vpc" "vpc-demosubs" {
- cidr_block = "10.3.0.0/16"
- enable_dns_support = "true"
- enable_dns_hostnames = "true"
- tags {
- Name = "vpc-demosubs"
- Client = "demosubs"
- VPC = "demosubs_vpc"
- }
- }
- resource "aws_internet_gateway" "vpc-demosubs" {
- vpc_id = "${aws_vpc.vpc-demosubs.id}"
- tags {
- Name = "demosubs_internet_gateway"
- Client = "demosubs"
- Internet_gateway = "demosubs_internet_gateway"
- }
- }
- /*
- Public Subnet 1
- */
- resource "aws_subnet" "public_subnet_demosubs" {
- vpc_id = "${aws_vpc.vpc-demosubs.id}"
- cidr_block = "10.3.0.0/24"
- availability_zone = "${var.region}a"
- map_public_ip_on_launch = "true"
- tags {
- Name = "demosubs_public_subnet"
- Client = "demosubs"
- Subnet = "Public_subnet"
- }
- }
- resource "aws_route_table" "public_subnet_demosubs" {
- vpc_id= "${aws_vpc.vpc-demosubs.id}"
- route {
- cidr_block = "0.0.0.0/0"
- gateway_id = "${aws_internet_gateway.vpc-demosubs.id}"
- }
- route {
- cidr_block = "10.0.0.0/16"
- vpc_peering_connection_id = "${aws_vpc_peering_connection.rds_to_demosubs.id}"
- }
- tags {
- Name = "demosubs_public_route_table"
- Client = "demosubs"
- route_table = "demosubs_public_route_table"
- }
- }
- resource "aws_route_table_association" "public_subnet_demosubs" {
- subnet_id = "${aws_subnet.public_subnet_demosubs.id}"
- route_table_id = "${aws_route_table.public_subnet_demosubs.id}"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement