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

Adding retry to reading transit gateway route #8726

Merged
merged 2 commits into from
May 23, 2019
Merged

Conversation

ryndaniels
Copy link
Contributor

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

Fixes #0000
Related to #8417

Release note for CHANGELOG:

resource/aws_ec2_transit_gateway_route - add retry to read method after
timeout

Output from acceptance testing:

$ make testacc TESTARGS="-run=TestAccAWSEc2TransitGatewayRoute"
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./... -v -parallel 20 -run=TestAccAWSEc2TransitGatewayRoute -timeout 120m
?       github.com/terraform-providers/terraform-provider-aws   [no test files]
=== RUN   TestAccAWSEc2TransitGatewayRouteTableDataSource_Filter
=== PAUSE TestAccAWSEc2TransitGatewayRouteTableDataSource_Filter
=== RUN   TestAccAWSEc2TransitGatewayRouteTableDataSource_ID
=== PAUSE TestAccAWSEc2TransitGatewayRouteTableDataSource_ID
=== RUN   TestAccAWSEc2TransitGatewayRouteTableAssociation_basic
=== PAUSE TestAccAWSEc2TransitGatewayRouteTableAssociation_basic
=== RUN   TestAccAWSEc2TransitGatewayRouteTablePropagation_basic
=== PAUSE TestAccAWSEc2TransitGatewayRouteTablePropagation_basic
=== RUN   TestAccAWSEc2TransitGatewayRouteTable_basic
=== PAUSE TestAccAWSEc2TransitGatewayRouteTable_basic
=== RUN   TestAccAWSEc2TransitGatewayRouteTable_disappears
=== PAUSE TestAccAWSEc2TransitGatewayRouteTable_disappears
=== RUN   TestAccAWSEc2TransitGatewayRouteTable_disappears_TransitGateway
=== PAUSE TestAccAWSEc2TransitGatewayRouteTable_disappears_TransitGateway
=== RUN   TestAccAWSEc2TransitGatewayRouteTable_Tags
=== PAUSE TestAccAWSEc2TransitGatewayRouteTable_Tags
=== RUN   TestAccAWSEc2TransitGatewayRoute_basic
=== PAUSE TestAccAWSEc2TransitGatewayRoute_basic
=== RUN   TestAccAWSEc2TransitGatewayRoute_disappears
=== PAUSE TestAccAWSEc2TransitGatewayRoute_disappears
=== RUN   TestAccAWSEc2TransitGatewayRoute_disappears_TransitGatewayAttachment
=== PAUSE TestAccAWSEc2TransitGatewayRoute_disappears_TransitGatewayAttachment
=== CONT  TestAccAWSEc2TransitGatewayRouteTableDataSource_Filter
=== CONT  TestAccAWSEc2TransitGatewayRoute_disappears_TransitGatewayAttachment
=== CONT  TestAccAWSEc2TransitGatewayRouteTable_disappears_TransitGateway
=== CONT  TestAccAWSEc2TransitGatewayRouteTableDataSource_ID
=== CONT  TestAccAWSEc2TransitGatewayRouteTable_disappears
=== CONT  TestAccAWSEc2TransitGatewayRoute_disappears
=== CONT  TestAccAWSEc2TransitGatewayRoute_basic
=== CONT  TestAccAWSEc2TransitGatewayRouteTable_Tags
=== CONT  TestAccAWSEc2TransitGatewayRouteTablePropagation_basic
=== CONT  TestAccAWSEc2TransitGatewayRouteTableAssociation_basic
=== CONT  TestAccAWSEc2TransitGatewayRouteTable_basic
--- PASS: TestAccAWSEc2TransitGatewayRouteTable_disappears_TransitGateway (264.17s)
--- PASS: TestAccAWSEc2TransitGatewayRouteTable_disappears (317.62s)
--- PASS: TestAccAWSEc2TransitGatewayRouteTable_basic (322.16s)
--- PASS: TestAccAWSEc2TransitGatewayRouteTable_Tags (335.02s)
--- PASS: TestAccAWSEc2TransitGatewayRouteTableDataSource_ID (380.46s)
--- PASS: TestAccAWSEc2TransitGatewayRouteTableDataSource_Filter (380.63s)
--- PASS: TestAccAWSEc2TransitGatewayRoute_basic (432.81s)
--- PASS: TestAccAWSEc2TransitGatewayRouteTableAssociation_basic (433.06s)
--- PASS: TestAccAWSEc2TransitGatewayRouteTablePropagation_basic (434.23s)
--- PASS: TestAccAWSEc2TransitGatewayRoute_disappears (436.79s)
--- PASS: TestAccAWSEc2TransitGatewayRoute_disappears_TransitGatewayAttachment (441.97s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       442.778s

@ghost ghost added size/XS Managed by automation to categorize the size of a PR. service/ec2 Issues and PRs that pertain to the ec2 service. labels May 21, 2019
@ryndaniels ryndaniels requested a review from bflad May 21, 2019 14:46
@@ -92,6 +92,10 @@ func resourceAwsEc2TransitGatewayRouteRead(d *schema.ResourceData, meta interfac
return nil
})

if isResourceTimeoutError(err) {
_, err = ec2DescribeTransitGatewayRoute(conn, transitGatewayRouteTableID, destination)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case we should also be assigning transitGatewayRoute so if it is found, it is properly handled by the rest of the Read function 👍

Suggested change
_, err = ec2DescribeTransitGatewayRoute(conn, transitGatewayRouteTableID, destination)
transitGatewayRoute, err = ec2DescribeTransitGatewayRoute(conn, transitGatewayRouteTableID, destination)

Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@nywilken nywilken assigned nywilken and unassigned nywilken May 23, 2019
@nywilken nywilken added this to the v2.12.0 milestone May 23, 2019
@nywilken nywilken merged commit d63e40c into master May 23, 2019
@nywilken nywilken deleted the rfd-transit-retry branch May 23, 2019 01:08
nywilken added a commit that referenced this pull request May 23, 2019
@bflad
Copy link
Contributor

bflad commented May 24, 2019

This has been released in version 2.12.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link

ghost commented Mar 29, 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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/ec2 Issues and PRs that pertain to the ec2 service. size/XS Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants