Skip to content
This repository has been archived by the owner on Feb 5, 2020. It is now read-only.

modules/aws: add dep from aws_eip.nat_eip to aws_internet_gateway.igw #1053

Merged
merged 2 commits into from
Jun 12, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions modules/aws/vpc/vpc-public.tf
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,15 @@ resource "aws_route_table_association" "route_net" {
resource "aws_eip" "nat_eip" {
count = "${var.external_vpc_id == "" ? min(var.master_az_count, var.worker_az_count) : 0}"
vpc = true

# Terraform does not declare an explicit dependency towards the internet gateway.
# this can cause the internet gateway to be deleted/detached before the EIPs.
# https://github.com/coreos/tectonic-installer/issues/1017#issuecomment-307780549
depends_on = ["aws_internet_gateway.igw"]
}

resource "aws_nat_gateway" "nat_gw" {
count = "${var.external_vpc_id == "" ? min(var.master_az_count, var.worker_az_count) : 0}"
allocation_id = "${aws_eip.nat_eip.*.id[count.index]}"
subnet_id = "${aws_subnet.master_subnet.*.id[count.index]}"

# TODO (sym3tri): Trying to prevent test flakes related to the `allocation_id` line above. May not be required.
depends_on = ["aws_eip.nat_eip"]
}