Last active
August 19, 2019 10:55
-
-
Save afcastano/a0adcb443666476511c77c45d3e3d2bf to your computer and use it in GitHub Desktop.
AWS VPC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### AWS VPC #################################################################### | |
# provision app vpc | |
resource "aws_vpc" "app_vpc" { | |
cidr_block = "${var.aws_network_cidr}" | |
enable_dns_support = true | |
enable_dns_hostnames = true | |
tags { | |
Name = "WP Solution VPC" | |
} | |
} | |
# create igw | |
resource "aws_internet_gateway" "app_igw" { | |
vpc_id = "${aws_vpc.app_vpc.id}" | |
} | |
# add dhcp options | |
resource "aws_vpc_dhcp_options" "dns_resolver" { | |
domain_name_servers = ["AmazonProvidedDNS"] | |
} | |
# associate dhcp with vpc | |
resource "aws_vpc_dhcp_options_association" "dns_resolver" { | |
vpc_id = "${aws_vpc.app_vpc.id}" | |
dhcp_options_id = "${aws_vpc_dhcp_options.dns_resolver.id}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment