Skip to content

Instantly share code, notes, and snippets.

@crizstian
Created April 12, 2019 18:37
Show Gist options
  • Save crizstian/a7dfd2286bbc582bd3915619d4cee46b to your computer and use it in GitHub Desktop.
Save crizstian/a7dfd2286bbc582bd3915619d4cee46b to your computer and use it in GitHub Desktop.
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