-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
aws_route_table crash on terraform plan #11134
Comments
Hi @mkolbert, thanks for the issue! I'm having trouble reproducing the issue you're facing. Is there any other configuration that would allow for a successful reproduction? Also would you be able to pass along the output of the following
Thanks! |
Hi Jake,
The only terraform file I have in my directory is test.tf with the following contents:
# Test
variable "AWS_REGION" { default = "us-east-1" }
variable "PEERED_ENV" { default = "copyright" }
provider "aws" {
alias = "this"
region = "${var.AWS_REGION}"
profile = "${var.PEERED_ENV}"
}
data "aws_route_table" "RTB" {
#data "aws_subnet" "RTB" {
provider = "aws.this"
tags = {
# Name = "AWS Private AZ-1a"
Name = "Private Route Table"
Region = "us-east-1a"
}
}
If I use the same file using the 2 commented out lines in place of the corresponding ones to do the same for subnet I get this:
data.aws_subnet.RTB: Refreshing state...
No changes. Infrastructure is up-to-date. This means that Terraform
could not detect any differences between your configuration and
the real physical resources that exist. As a result, Terraform
doesn't need to do anything.
I have 3 route tables in this account with the following tags:
Route 1
Name: Private Route Table
Region: us-east-1a
Route 2
Name: Private Route Table
Region: us-east-1c
Route 3
Name: Default Public Route Table
Here’s the tags returned by the API call for my route tables
aws ec2 describe-route-tables --region us-east-1
"Tags": [
{
"Value": "us-east-1a",
"Key": "Region"
},
{
"Value": "Private Route Table",
"Key": "Name"
}
],
"Tags": [
{
"Value": "Default Public Route Table",
"Key": "Name"
}
],
"Tags": [
{
"Value": "us-east-1c",
"Key": "Region"
},
{
"Value": "Private Route Table",
"Key": "Name"
}
],
I hope that helps.
Matt
From: Jake Champlin [mailto:notifications@github.com]
Sent: Tuesday, January 10, 2017 4:33 PM
To: hashicorp/terraform <terraform@noreply.github.com>
Cc: Matthew Kolbert <mkolbert@copyright.com>; Mention <mention@noreply.github.com>
Subject: Re: [hashicorp/terraform] aws_route_table crash on terraform plan (#11134)
Hi @mkolbert<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_mkolbert&d=DgMFaQ&c=KWU0n0AYV-PQlv5EyAO4mg&r=VL1XxcxF0K5JkpvwK8t5S2YKnJEjJf6Y1z-ZIuTpSZU&m=YkRrra0vc9DPS8EEDYSVIv8MnG-fWmMJxGrILYZg9qc&s=X_xNjpt43oX0u12WdQpeqaSGfFJgtpksGssuyBgR43E&e=>, thanks for the issue!
I'm having trouble reproducing the issue you're facing. Is there any other configuration that would allow for a successful reproduction?
Also would you be able to pass along the output of the following aws API call:
aws ec2 describe-route-table --route-table-ids rtb-2d84ca4a --region us-west-2
Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_hashicorp_terraform_issues_11134-23issuecomment-2D271704498&d=DgMFaQ&c=KWU0n0AYV-PQlv5EyAO4mg&r=VL1XxcxF0K5JkpvwK8t5S2YKnJEjJf6Y1z-ZIuTpSZU&m=YkRrra0vc9DPS8EEDYSVIv8MnG-fWmMJxGrILYZg9qc&s=acEpQMabePYdFbvMPipH9k0_wPFhc3Ck8FfIL847hoU&e=>, or mute the thread<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_ABfGZ8GCCPIrxjCNlrFwBWw-5FwWkgVBjwks5rQ-5FkQgaJpZM4LfwM-5F&d=DgMFaQ&c=KWU0n0AYV-PQlv5EyAO4mg&r=VL1XxcxF0K5JkpvwK8t5S2YKnJEjJf6Y1z-ZIuTpSZU&m=YkRrra0vc9DPS8EEDYSVIv8MnG-fWmMJxGrILYZg9qc&s=GofOyHOzY1zHlmFjPn-5iBJLzQwgNIaAvmGoLOA_9mo&e=>.
|
@mkolbert I actually wanted to see the Associations for each Route Table returned from that API call. I believe that we're running into an issue where the Route Table(s) that are being returned to Terraform's |
A VPC's main route table has an implicit subnet association, not an explicit subnet association. This caused a Terraform panic when using the `data_source_aws_route_table` resource to query the main route table for a VPC. This fixes the Terraform panic, and allows the data lookup to complete successfully. Also added an acceptance test to verify the bugfix. Fixes: #11134
@mkolbert I've opened PR#11139 which should fix your issue. Thanks! |
A VPC's main route table has an implicit subnet association, not an explicit subnet association. This caused a Terraform panic when using the `data_source_aws_route_table` resource to query the main route table for a VPC. This fixes the Terraform panic, and allows the data lookup to complete successfully. Also added an acceptance test to verify the bugfix. Fixes: #11134
Confirmed fixed in 0.8.5 by @mkolbert. |
I'm going to lock this issue 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 similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Hi there,
Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.
Terraform Version
Run
terraform -v
to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.0.8.3 as well as 0.8.2 prior to upgrading today.
Affected Resource(s)
Please list the resources as a list, for example:
aws_route_table
If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.
Terraform Configuration Files
Debug Output
Please provider a link to a GitHub Gist containing the complete debug output: https://www.terraform.io/docs/internals/debugging.html. Please do NOT paste the debug output in the issue; just paste a link to the Gist.
<script src="https://gist.github.com/mkolbert/465e0e5ec4da96b48ff255ba29a1839b.js"></script>Panic Output
If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the
<script src="https://gist.github.com/mkolbert/dc6ad90a6bb0647bd286d83597dce00b.js"></script>crash.log
.Expected Behavior
What should have happened?
Using same syntax with aws_subnet works fine.
Actual Behavior
What actually happened?
Crash
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply
terraform plan
Important Factoids
Are there anything atypical about your accounts that we should know? For example: Running in EC2 Classic? Custom version of OpenStack? Tight ACLs?
VPC
References
Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:
The text was updated successfully, but these errors were encountered: