Created
April 12, 2019 18:37
-
-
Save crizstian/a7dfd2286bbc582bd3915619d4cee46b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
resource "aws_vpc" "bastion_vpc" { | |
cidr_block = "${var.bastion_cidr}" | |
enable_dns_hostnames = true | |
enable_dns_support = true | |
tags { | |
Application = "${var.bastion_cluster_name}" | |
Environment = "${terraform.workspace}" | |
Name = "${var.bastion_cluster_name}-vpc" | |
} | |
} | |
resource "aws_internet_gateway" "bastion_gw" { | |
vpc_id = "${aws_vpc.bastion_vpc.id}" | |
tags { | |
Application = "${var.bastion_cluster_name}" | |
Environment = "${terraform.workspace}" | |
Name = "${var.bastion_cluster_name}-igw" | |
} | |
} | |
resource "aws_eip" "nat_ip" { | |
vpc = true | |
} | |
resource "aws_nat_gateway" "nat_gateway" { | |
allocation_id = "${aws_eip.nat_ip.id}" | |
subnet_id = "${aws_subnet.bastion_public_subnet.id}" | |
depends_on = ["aws_internet_gateway.bastion_gw"] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment