-
Notifications
You must be signed in to change notification settings - Fork 9k
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
import error: aws_vpc_endpoint_route_table_association: InvalidVpcEndpointId.Malformed: Invalid Id: '' (expecting 'vpce-...; #9693
Comments
I managed to reproduce this issue with plain terraform (without the extra aws modules) with the following steps:
So it seems the creation code works correctly, but the import code is failing in some id validation. Notice in the trace logs how the vpc endpoint id passed to the DescribeVpcEndpoints api call gets an "" id.
|
@bflad let us know if you need more information. |
I found a workaround for this issue which will allow us to move forward before upstream can fix the issue. Once the vpc endpoint is imported into the state, you can manually edit the https://paste.debian.net/1099848/ Save it to a file To generate the ID, Now, just below the vpc_endpoint block in the
Save this state file and replace the existing one. Make sure to make a backup of the old state. Once the terraform state is in the S3 bucket, run terraform plan again to make sure terraform will refresh the state of the vpc_endpoint_route_table_association. If it shows up in the list of refreshed resources and it doesn’t show up in the list of new resources to be added, then it should be safe to apply. |
Yes, I can reproduce with a modified acceptance test: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSVpcEndpointRouteTableAssociation_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSVpcEndpointRouteTableAssociation_ -timeout 120m
=== RUN TestAccAWSVpcEndpointRouteTableAssociation_basic
=== PAUSE TestAccAWSVpcEndpointRouteTableAssociation_basic
=== CONT TestAccAWSVpcEndpointRouteTableAssociation_basic
--- FAIL: TestAccAWSVpcEndpointRouteTableAssociation_basic (50.45s)
testing.go:569: Step 1 error: InvalidVpcEndpointId.Malformed: Invalid Id: '' (expecting 'vpce-...; the Id may only contain lowercase alphanumeric characters and a single dash')
status code: 400, request id: d5b4b5ac-2e19-4338-b188-d8cd0aa9dd3a
FAIL
FAIL github.com/terraform-providers/terraform-provider-aws/aws 50.566s
FAIL
make: *** [testacc] Error 1 This resource was added with potential support for |
The fix for this has been merged and will release with version 2.32.0 of the Terraform AWS Provider, shortly. Thanks to @ewbankkit for the implementation. 👍 |
This has been released in version 2.32.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks! |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Terraform Version
Terraform v0.11.14
Affected Resource(s)
aws_vpc_endpoint_route_table_association
Terraform Configuration Files
Only configuration used:
Debug Output
Please see attachments.
when_vpce_id_used.txt
when_rt_associ_used.txt
Expected Behavior
Should process terraform import [of reasource aws_vpc_endpoint_route_table_association] without error.
Actual Behavior
Hey!
Trying to add our manually created VPC into Terraform*, every import goes well, till we are trying to import manually created aws_vpc_endpoint_route_table_association.public_s3
*adding our manually created VPC to TF by using module:
When we are importing 'aws_vpc_endpoint_route_table_association', unfortunately we get following error:
The same happens when we try to change import id into required vpce:
In the attachment you can find the log from debugging (TRACE).
When provide terraform plan, the output for this resource looks like this:
Do you think it might be bug? Any idea/help, please? Thanks a lot!
Steps to Reproduce
terraform plan
and import of all required (new) resources.aws_vpc_endpoint_route_table_association
you will come to the reported issue.References
Posted also here: terraform-aws-modules/terraform-aws-vpc#312
The text was updated successfully, but these errors were encountered: