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

service/ec2/find: update call toDescribeRouteTables with paginated method #21710

Merged
merged 3 commits into from
Nov 11, 2021

Conversation

anGie44
Copy link
Contributor

@anGie44 anGie44 commented Nov 10, 2021

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" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Relates #21683, #21629

Notes:

  • The errors similar to
Error: error reading Route Table Association (rtbassoc-07d32038d3161359d): empty result

occur when finding the RouteTable, not the association itself. This could be because we use an unpaginated DescribeRouteTables method that may be needed for heavily used AWS accounts. Testing this is not easily feasible, so practitioner experience will need to validate this change.

Output from acceptance testing:

--- PASS: TestAccEC2DefaultRouteTable_Disappears_vpc (48.86s)
--- PASS: TestAccEC2RouteTable_disappears (56.58s)
--- PASS: TestAccEC2RouteTableAssociation_disappears (69.00s)
--- PASS: TestAccEC2RouteTableDataSource_main (71.11s)
--- PASS: TestAccEC2RouteTable_basic (86.63s)
--- PASS: TestAccEC2RouteTableAssociation_Subnet_basic (94.07s)
--- PASS: TestAccEC2DefaultRouteTable_vpcEndpointAssociation (94.76s)
--- PASS: TestAccEC2RouteTableDataSource_basic (94.69s)
--- PASS: TestAccEC2RouteTableAssociation_Gateway_basic (96.05s)
--- PASS: TestAccEC2DefaultRouteTable_basic (119.19s)
--- PASS: TestAccEC2RouteTable_Disappears_subnetAssociation (74.23s)
--- SKIP: TestAccEC2RouteTable_ipv4ToCarrierGateway (0.97s)
--- SKIP: TestAccEC2RouteTable_ipv4ToLocalGateway (1.16s)
--- PASS: TestAccEC2RouteTable_requireRouteTarget (39.91s)
--- PASS: TestAccEC2DefaultRouteTable_prefixListToInternetGateway (139.22s)
--- PASS: TestAccEC2RouteTableAssociation_Subnet_changeRouteTable (140.08s)
--- PASS: TestAccEC2DefaultRouteTable_conditionalCIDRBlock (144.62s)
--- PASS: TestAccEC2RouteTableAssociation_Gateway_changeRouteTable (153.07s)
--- PASS: TestAccEC2RouteTable_ipv6ToEgressOnlyInternetGateway (111.47s)
--- PASS: TestAccEC2RouteTable_ipv4ToInternetGateway (127.00s)
--- PASS: TestAccEC2DefaultRouteTable_tags (185.06s)
--- PASS: TestAccEC2DefaultRouteTable_Route_mode (197.25s)
--- PASS: TestAccEC2RouteTable_ipv4ToVPCPeeringConnection (70.06s)
--- PASS: TestAccEC2DefaultRouteTable_swap (197.94s)
--- PASS: TestAccEC2RouteTable_vgwRoutePropagation (83.79s)
--- PASS: TestAccEC2DefaultRouteTable_revokeExistingRules (204.85s)
--- PASS: TestAccEC2RouteTable_ipv4ToInstance (138.52s)
--- PASS: TestAccEC2RouteTable_IPv6ToNetworkInterface_unattached (63.35s)
--- PASS: TestAccEC2RouteTable_conditionalCIDRBlock (48.79s)
--- PASS: TestAccEC2RouteTable_vpcClassicLink (51.10s)
--- PASS: TestAccEC2RouteTable_tags (148.57s)
--- PASS: TestAccEC2RouteTable_gatewayVPCEndpoint (59.17s)
--- PASS: TestAccEC2RouteTable_Route_mode (149.65s)
--- PASS: TestAccEC2RouteTable_prefixListToInternetGateway (51.16s)
--- PASS: TestAccEC2RouteTable_vpcMultipleCIDRs (68.34s)
--- PASS: TestAccEC2RouteTablesDataSource_basic (54.88s)
--- PASS: TestAccEC2RouteTable_IPv4ToNetworkInterfaces_unattached (116.12s)
--- PASS: TestAccEC2RouteTable_multipleRoutes (134.70s)
--- PASS: TestAccEC2DefaultRouteTable_ipv4ToVPCEndpoint (348.55s)
--- PASS: TestAccEC2RouteTable_ipv4ToNatGateway (222.10s)
--- PASS: TestAccEC2RouteTable_ipv4ToVPCEndpoint (291.82s)
--- PASS: TestAccEC2RouteTable_requireRouteDestination (328.29s)
--- PASS: TestAccEC2DefaultRouteTable_ipv4ToTransitGateway (425.79s)
--- PASS: TestAccEC2RouteTable_ipv4ToTransitGateway (389.13s)

@github-actions github-actions bot added service/ec2 Issues and PRs that pertain to the ec2 service. size/XS Managed by automation to categorize the size of a PR. labels Nov 10, 2021
@anGie44 anGie44 force-pushed the e-route-table-associations-pagination branch from c7ae2f7 to a87ccb6 Compare November 10, 2021 17:37
@github-actions github-actions bot added size/S Managed by automation to categorize the size of a PR. and removed size/XS Managed by automation to categorize the size of a PR. labels Nov 10, 2021
Comment on lines +1 to +11
```release-note:bug
data-source/aws_route: Fix lack of pagination when describing route tables
```

```release-note:bug
resource/aws_default_route_table: Fix lack of pagination when describing route tables
```

```release-note:bug
resource/aws_route_table: Fix lack of pagination when describing route tables
```
Copy link
Contributor Author

@anGie44 anGie44 Nov 10, 2021

Choose a reason for hiding this comment

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

adding in these in case to reflect the change affects additional resources that reference the underlying find method

@anGie44 anGie44 marked this pull request as ready for review November 10, 2021 19:21
@anGie44 anGie44 changed the title r/aws_route_table_association: update call toDescribeRouteTables with paginated method service/ec2/find: update call toDescribeRouteTables with paginated method Nov 10, 2021
@github-actions github-actions bot added size/M Managed by automation to categorize the size of a PR. and removed size/S Managed by automation to categorize the size of a PR. labels Nov 10, 2021
@anGie44 anGie44 requested a review from ewbankkit November 11, 2021 01:39
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

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

LGTM 🚀.

% make testacc PKG_NAME=internal/service/ec2 TESTARGS='-run=TestAccEC2RouteTable_basic\|TestAccEC2RouteTableAssociation_Subnet_basic'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run=TestAccEC2RouteTable_basic\|TestAccEC2RouteTableAssociation_Subnet_basic -timeout 180m
=== RUN   TestAccEC2RouteTableAssociation_Subnet_basic
=== PAUSE TestAccEC2RouteTableAssociation_Subnet_basic
=== RUN   TestAccEC2RouteTable_basic
=== PAUSE TestAccEC2RouteTable_basic
=== CONT  TestAccEC2RouteTableAssociation_Subnet_basic
=== CONT  TestAccEC2RouteTable_basic
--- PASS: TestAccEC2RouteTable_basic (24.06s)
--- PASS: TestAccEC2RouteTableAssociation_Subnet_basic (32.69s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	36.075s

@github-actions
Copy link

This functionality has been released in v3.65.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. Thank you!

@jasonkinsella
Copy link

Is it possible that the lack of pagination could also cause this intermittent error?

error updating Security Group (sg-xxx): couldn't find resource

@github-actions
Copy link

I'm going to lock this pull request 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 related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service. size/M 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