Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data/aws/vpc: Drop aws_route_table data blocks #769

Merged
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
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])}"]
}
}