Skip to content

Commit

Permalink
data/aws/vpc: Drop aws_route_table data blocks
Browse files Browse the repository at this point in the history
These were added in f828666 (modules/vpc: support re-apply of
terraform when AZ number changes, 2018-03-12,
coreos/tectonic-installer#3092), and never seem to have had a
consumer.  Removing them should fix occasional flakes like [1]:

  level=error msg="Error: Error applying plan:\n\n1 error(s) occurred:\n\n* module.vpc.data.aws_route_table.worker[1]: data.aws_route_table.worker.1: Your query returned no results. Please change your search criteria and try again.\n\nTerraform does not automatically rollback in the face of errors.\nInstead, your Terraform state file has been partially updated with\nany resources that successfully completed. Please address the error\nabove and apply again to incrementally change your infrastructure."

I've also removed the data.aws_subnet blocks, whose last consumers
were removed in f828666.

[1]: https://storage.googleapis.com/origin-ci-test/pr-logs/pull/openshift_installer/737/pull-ci-openshift-installer-master-e2e-aws/1789/build-log.txt
  • Loading branch information
wking committed Nov 30, 2018
1 parent 25757c6 commit c80edad
Showing 1 changed file with 1 addition and 31 deletions.
32 changes: 1 addition & 31 deletions data/data/aws/vpc/common.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,38 +30,8 @@ locals {
}

# all data sources should be input variable-agnostic and used as canonical source for querying "state of resources" and building outputs
# (ie: we don't want "data.aws_subnet.external-worker" and "data.aws_subnet.worker". just "data.aws_subnet.worker" used everwhere for list of worker subnets for any valid input var state)
# (ie: we don't want "aws.new_vpc" and "data.aws_vpc.cluster_vpc", just "data.aws_vpc.cluster_vpc" used everwhere).

data "aws_vpc" "cluster_vpc" {
id = "${local.vpc_id}"
}

data "aws_subnet" "worker" {
count = "${local.worker_subnet_count}"
id = "${local.worker_subnet_ids[count.index]}"
vpc_id = "${local.vpc_id}"
}

data "aws_subnet" "master" {
count = "${local.master_subnet_count}"
id = "${local.master_subnet_ids[count.index]}"
vpc_id = "${local.vpc_id}"
}

data "aws_route_table" "worker" {
count = "${local.worker_subnet_count}"

filter = {
name = "association.subnet-id"
values = ["${list(local.worker_subnet_ids[count.index])}"]
}
}

data "aws_route_table" "master" {
count = "${local.master_subnet_count}"

filter = {
name = "association.subnet-id"
values = ["${list(local.master_subnet_ids[count.index])}"]
}
}

0 comments on commit c80edad

Please sign in to comment.