Skip to content

Conversation

@sc250024
Copy link
Contributor

Redo of PR #94

@antonbabenko
Copy link
Member

cd exampled/complete-vpc

terraform init

Initializing modules...
- module.vpc
  Getting source "../../"

Error: resource 'aws_vpn_gateway_route_propagation.default' config: unknown resource 'aws_default_route_table.this' referenced in variable aws_default_route_table.this.*.id

Always run examples/complete-vpc to verify that it works.

@sc250024
Copy link
Contributor Author

@antonbabenko That's my mistake, good catch. I had assumed the PR was basically ready to go. I do have a question though. The offending reference you found is from this block:

resource "aws_vpn_gateway_route_propagation" "default" {
  count = "${var.create_vpc && var.propagate_default_route_tables_vgw && (var.enable_vpn_gateway || var.vpn_gateway_id != "") ? 1 : 0}"
  route_table_id = "${element(aws_default_route_table.this.*.id, count.index)}"
  vpn_gateway_id = "${element(concat(aws_vpn_gateway.this.*.id, aws_vpn_gateway_attachment.this.*.vpn_gateway_id), count.index)}"
}

And specifically the reference to aws_default_route_table.this.*.id is the culprit. You mentioned here (#94 (comment)) that aws_default_route_table was removed, yet this PR wants to add propagate_default_route_tables_vgw as a variable.

Are we adding aws_default_route_table back in? Or using another method? I'm not sure the history of the original PR; perhaps there was a reason it went stale.

@antonbabenko
Copy link
Member

As far as I remember the problem was with the resource aws_default_route_table which turned out to be very hard to manage as part of this module, so we should not try to manage that particular resource using this module but we can use the value of aws_vpc.this.default_route_table_id instead.

https://github.com/terraform-aws-modules/terraform-aws-vpc/pull/133/files#diff-7a370d8342e7203b805911c92454f0f4R373 should be like:

resource "aws_vpn_gateway_route_propagation" "default" {
  # omitted
  route_table_id = "${element(concat(aws_vpc.this.*.default_route_table_id, list("")), 0)}"
}

@sc250024
Copy link
Contributor Author

Closing since this is not needed / supported anymore.

@sc250024 sc250024 closed this Jun 22, 2018
@sc250024 sc250024 deleted the redo-vpn-gateway-route-propagation branch June 22, 2018 18:37
@github-actions
Copy link

github-actions bot commented Nov 5, 2022

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants