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

provider/aws Fix import errors when aws_route has VPC endpoint #8445

Closed
wants to merge 1 commit into from
Closed

provider/aws Fix import errors when aws_route has VPC endpoint #8445

wants to merge 1 commit into from

Conversation

brianbianco
Copy link

Fixes #8225

If an imported aws_route contains a PrefixListId entry the RouteHashID function
no longer throws a nil pointer reference.

Fixes #8225

If an imported aws_route contains a PrefixListId entry the RouteHashID function
no longer throws a nil pointer reference.
@brianbianco
Copy link
Author

I was able to successfully import my AWS route table after making this code fix.

I was UNABLE to create acceptance tests because it seems, at least on my machine, the aws providers acceptance tests are failing on the master branch (and even from the 0.7.1 tag). Very possible I am just doing something wrong and am open to suggestion as to how I should fix it and even how I should write a good acceptance test for this PR.

@jonbender
Copy link

@brianbianco seems like this patch doesn't quite account for the logic to find this route in AWS (findResourceRoute currently takes a cidr which this route does not have), or the changes to the AWS route resource schema in terraform (destination_cidr_block is a Required attribute which isn't the case with VPEs).

In any case, I'd recommend closing and check in with hashicorp on whether they're working on a fix. I'd love to see this implemented but I'm guessing since its a somewhat involved change they're going to take care of it?

@brianbianco
Copy link
Author

@jonbender It does seem like a fairly in-depth change. I'll poke around and look into the resource searching and schema. My biggest issue was that I ceased doing any further changes as I couldn't get the acceptance tests to pass (and so I could not add my own). I have yet to see a response in the issue from hashicorp so I was hoping to hear if they were working on fixing this or not.

@catsby
Copy link
Contributor

catsby commented Oct 28, 2016

Hello – I've opened #9686 to patch the crash found in #8225 – right now the direct creation of routes, either in-line in aws_route_table or externally with aws_route, require the DestinationCidrBlock, as per the AWS API:

Routes that do not contain DestinationCidrBlock like those created from aws_vpc_endpoint are managed externally, so in #9686 we exclude them from import.

If you feel this is a bad idea please let me know, otherwise I'm going to close this. Thanks!

@catsby catsby closed this Oct 28, 2016
@brianbianco
Copy link
Author

Great @catsby, Thanks for this. This seems like a reasonable work around, especially if the AWS api itself requires you have a CIDR block.

@ghost
Copy link

ghost commented Apr 21, 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 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

crash when importing aws_route_table
4 participants