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

aws_route_table crash on terraform plan #11134

Closed
mkolbert opened this issue Jan 10, 2017 · 6 comments · Fixed by #11152
Closed

aws_route_table crash on terraform plan #11134

mkolbert opened this issue Jan 10, 2017 · 6 comments · Fixed by #11152

Comments

@mkolbert
Copy link

mkolbert commented Jan 10, 2017

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_instance
  • dnsimple_record

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

variable "AWS_REGION" { default = "us-east-1" }

variable "PEERED_ENV" { default = "XXXXXXXX" }

provider "aws" {
  alias = "this"
  region = "${var.AWS_REGION}"
  profile = "${var.PEERED_ENV}"
}

data "aws_route_table" "RTB" {
  provider = "aws.this"
  tags = {
    Name = "Private Route Table"
    Region = "us-east-1a"
  }
}

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 crash.log.

<script src="https://gist.github.com/mkolbert/dc6ad90a6bb0647bd286d83597dce00b.js"></script>

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:

  1. 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:

@grubernaut
Copy link
Contributor

grubernaut commented Jan 10, 2017

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 aws API call, substituting in the correct values for route_table_id and aws_region:

aws ec2 describe-route-table --route-table-ids <route_table_id> --region <aws_region>

Thanks!

@mkolbert
Copy link
Author

mkolbert commented Jan 10, 2017 via email

@grubernaut
Copy link
Contributor

@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 data resource are the main route table for their respective VPC. This would explain the crash, as the main route table for a VPC does not have an explicit subnet association.
Thanks!

grubernaut added a commit that referenced this issue Jan 11, 2017
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
@grubernaut
Copy link
Contributor

@mkolbert I've opened PR#11139 which should fix your issue. Thanks!

grubernaut added a commit that referenced this issue Jan 11, 2017
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
@dstine
Copy link
Contributor

dstine commented Jan 27, 2017

Confirmed fixed in 0.8.5 by @mkolbert.

@ghost
Copy link

ghost commented Apr 17, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants