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

r/route_table: Use configurable timeouts in aws_route #21161

Merged
merged 4 commits into from
Oct 6, 2021

Conversation

msahihi
Copy link
Contributor

@msahihi msahihi commented Oct 5, 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

Closes #20227.
Closes #19985.
Relates #21062.

Output from acceptance testing:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSDefaultRouteTable_basic\|TestAccAWSRoute_basic' ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 2 -run=TestAccAWSDefaultRouteTable_basic\|TestAccAWSRoute_basic -timeout 180m
=== RUN   TestAccAWSDefaultRouteTable_basic
=== PAUSE TestAccAWSDefaultRouteTable_basic
=== RUN   TestAccAWSRoute_basic
=== PAUSE TestAccAWSRoute_basic
=== CONT  TestAccAWSDefaultRouteTable_basic
=== CONT  TestAccAWSRoute_basic
--- PASS: TestAccAWSDefaultRouteTable_basic (56.17s)
--- PASS: TestAccAWSRoute_basic (62.28s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	67.664s

...

@github-actions github-actions bot added documentation Introduces or discusses updates to documentation. service/ec2 Issues and PRs that pertain to the ec2 service. needs-triage Waiting for first response or review from a maintainer. size/S Managed by automation to categorize the size of a PR. labels Oct 5, 2021
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome @msahihi 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTING guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@msahihi msahihi marked this pull request as ready for review October 5, 2021 17:31
@justinretzolk justinretzolk added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Oct 5, 2021
@ewbankkit ewbankkit self-assigned this Oct 6, 2021
@github-actions github-actions bot added tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. size/XL 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 Oct 6, 2021
@ewbankkit ewbankkit force-pushed the b-r/aws_route-increase_timeout branch from 8b52bd8 to 73927cb Compare October 6, 2021 19:05
@YakDriver
Copy link
Member

I was just realizing how we needed to standardize all the route, route table handling and here's an excellent PR. Thanks for your work on this @msahihi !

@msahihi
Copy link
Contributor Author

msahihi commented Oct 6, 2021

I was just realizing how we needed to standardize all the route, route table handling and here's an excellent PR. Thanks for your work on this @msahihi !

Glad to help. I am happy to see @ewbankkit adapt other resources as well. Actually, since I didn't know which logic here we would like to follow, I didn't change it all over the place.
I also wanted to write a test for resource timeouts if they are being used as I wasn't sure if they are covered in test cases, but then I found out that in test-implementation it is explicitly mentioned to exclude timeouts configuration. Is there any reason behind this? Do we have the test somewhere else?

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 TESTARGS='-run=TestAccAWSVPNGatewayRoutePropagation_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSVPNGatewayRoutePropagation_ -timeout 180m
=== RUN   TestAccAWSVPNGatewayRoutePropagation_basic
=== PAUSE TestAccAWSVPNGatewayRoutePropagation_basic
=== RUN   TestAccAWSVPNGatewayRoutePropagation_disappears
=== PAUSE TestAccAWSVPNGatewayRoutePropagation_disappears
=== CONT  TestAccAWSVPNGatewayRoutePropagation_basic
=== CONT  TestAccAWSVPNGatewayRoutePropagation_disappears
--- PASS: TestAccAWSVPNGatewayRoutePropagation_basic (56.55s)
--- PASS: TestAccAWSVPNGatewayRoutePropagation_disappears (57.14s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	60.278s
% ACCTEST_PARALLELISM=5 make testacc TESTARGS='-run=TestAccAWSRouteTableAssociation_\|TestAccAWSDefaultRouteTable_\|TestAccAWSRouteTable_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 5 -run=TestAccAWSRouteTableAssociation_\|TestAccAWSDefaultRouteTable_\|TestAccAWSRouteTable_ -timeout 180m
=== RUN   TestAccAWSDefaultRouteTable_basic
=== PAUSE TestAccAWSDefaultRouteTable_basic
=== RUN   TestAccAWSDefaultRouteTable_disappears_Vpc
=== PAUSE TestAccAWSDefaultRouteTable_disappears_Vpc
=== RUN   TestAccAWSDefaultRouteTable_Route_ConfigMode
=== PAUSE TestAccAWSDefaultRouteTable_Route_ConfigMode
=== RUN   TestAccAWSDefaultRouteTable_swap
=== PAUSE TestAccAWSDefaultRouteTable_swap
=== RUN   TestAccAWSDefaultRouteTable_IPv4_To_TransitGateway
=== PAUSE TestAccAWSDefaultRouteTable_IPv4_To_TransitGateway
=== RUN   TestAccAWSDefaultRouteTable_IPv4_To_VpcEndpoint
=== PAUSE TestAccAWSDefaultRouteTable_IPv4_To_VpcEndpoint
=== RUN   TestAccAWSDefaultRouteTable_VpcEndpointAssociation
=== PAUSE TestAccAWSDefaultRouteTable_VpcEndpointAssociation
=== RUN   TestAccAWSDefaultRouteTable_Tags
=== PAUSE TestAccAWSDefaultRouteTable_Tags
=== RUN   TestAccAWSDefaultRouteTable_ConditionalCidrBlock
=== PAUSE TestAccAWSDefaultRouteTable_ConditionalCidrBlock
=== RUN   TestAccAWSDefaultRouteTable_PrefixList_To_InternetGateway
=== PAUSE TestAccAWSDefaultRouteTable_PrefixList_To_InternetGateway
=== RUN   TestAccAWSDefaultRouteTable_RevokeExistingRules
=== PAUSE TestAccAWSDefaultRouteTable_RevokeExistingRules
=== RUN   TestAccAWSRouteTableAssociation_Subnet_basic
=== PAUSE TestAccAWSRouteTableAssociation_Subnet_basic
=== RUN   TestAccAWSRouteTableAssociation_Subnet_ChangeRouteTable
=== PAUSE TestAccAWSRouteTableAssociation_Subnet_ChangeRouteTable
=== RUN   TestAccAWSRouteTableAssociation_Gateway_basic
=== PAUSE TestAccAWSRouteTableAssociation_Gateway_basic
=== RUN   TestAccAWSRouteTableAssociation_Gateway_ChangeRouteTable
=== PAUSE TestAccAWSRouteTableAssociation_Gateway_ChangeRouteTable
=== RUN   TestAccAWSRouteTableAssociation_disappears
=== PAUSE TestAccAWSRouteTableAssociation_disappears
=== RUN   TestAccAWSRouteTable_basic
=== PAUSE TestAccAWSRouteTable_basic
=== RUN   TestAccAWSRouteTable_disappears
=== PAUSE TestAccAWSRouteTable_disappears
=== RUN   TestAccAWSRouteTable_disappears_SubnetAssociation
=== PAUSE TestAccAWSRouteTable_disappears_SubnetAssociation
=== RUN   TestAccAWSRouteTable_IPv4_To_InternetGateway
=== PAUSE TestAccAWSRouteTable_IPv4_To_InternetGateway
=== RUN   TestAccAWSRouteTable_IPv4_To_Instance
=== PAUSE TestAccAWSRouteTable_IPv4_To_Instance
=== RUN   TestAccAWSRouteTable_IPv6_To_EgressOnlyInternetGateway
=== PAUSE TestAccAWSRouteTable_IPv6_To_EgressOnlyInternetGateway
=== RUN   TestAccAWSRouteTable_Tags
=== PAUSE TestAccAWSRouteTable_Tags
=== RUN   TestAccAWSRouteTable_RequireRouteDestination
=== PAUSE TestAccAWSRouteTable_RequireRouteDestination
=== RUN   TestAccAWSRouteTable_RequireRouteTarget
=== PAUSE TestAccAWSRouteTable_RequireRouteTarget
=== RUN   TestAccAWSRouteTable_Route_ConfigMode
=== PAUSE TestAccAWSRouteTable_Route_ConfigMode
=== RUN   TestAccAWSRouteTable_IPv4_To_TransitGateway
=== PAUSE TestAccAWSRouteTable_IPv4_To_TransitGateway
=== RUN   TestAccAWSRouteTable_IPv4_To_VpcEndpoint
=== PAUSE TestAccAWSRouteTable_IPv4_To_VpcEndpoint
=== RUN   TestAccAWSRouteTable_IPv4_To_CarrierGateway
=== PAUSE TestAccAWSRouteTable_IPv4_To_CarrierGateway
=== RUN   TestAccAWSRouteTable_IPv4_To_LocalGateway
=== PAUSE TestAccAWSRouteTable_IPv4_To_LocalGateway
=== RUN   TestAccAWSRouteTable_IPv4_To_VpcPeeringConnection
=== PAUSE TestAccAWSRouteTable_IPv4_To_VpcPeeringConnection
=== RUN   TestAccAWSRouteTable_VgwRoutePropagation
=== PAUSE TestAccAWSRouteTable_VgwRoutePropagation
=== RUN   TestAccAWSRouteTable_ConditionalCidrBlock
=== PAUSE TestAccAWSRouteTable_ConditionalCidrBlock
=== RUN   TestAccAWSRouteTable_IPv4_To_NatGateway
=== PAUSE TestAccAWSRouteTable_IPv4_To_NatGateway
=== RUN   TestAccAWSRouteTable_IPv6_To_NetworkInterface_Unattached
=== PAUSE TestAccAWSRouteTable_IPv6_To_NetworkInterface_Unattached
=== RUN   TestAccAWSRouteTable_IPv4_To_NetworkInterfaces_Unattached
=== PAUSE TestAccAWSRouteTable_IPv4_To_NetworkInterfaces_Unattached
=== RUN   TestAccAWSRouteTable_VpcMultipleCidrs
=== PAUSE TestAccAWSRouteTable_VpcMultipleCidrs
=== RUN   TestAccAWSRouteTable_VpcClassicLink
=== PAUSE TestAccAWSRouteTable_VpcClassicLink
=== RUN   TestAccAWSRouteTable_GatewayVpcEndpoint
=== PAUSE TestAccAWSRouteTable_GatewayVpcEndpoint
=== RUN   TestAccAWSRouteTable_MultipleRoutes
=== PAUSE TestAccAWSRouteTable_MultipleRoutes
=== RUN   TestAccAWSRouteTable_PrefixList_To_InternetGateway
=== PAUSE TestAccAWSRouteTable_PrefixList_To_InternetGateway
=== CONT  TestAccAWSDefaultRouteTable_basic
=== CONT  TestAccAWSRouteTable_IPv6_To_EgressOnlyInternetGateway
=== CONT  TestAccAWSRouteTableAssociation_Subnet_basic
=== CONT  TestAccAWSRouteTable_IPv4_To_Instance
=== CONT  TestAccAWSRouteTable_IPv4_To_InternetGateway
--- PASS: TestAccAWSDefaultRouteTable_basic (32.74s)
=== CONT  TestAccAWSRouteTable_disappears_SubnetAssociation
--- PASS: TestAccAWSRouteTableAssociation_Subnet_basic (44.89s)
=== CONT  TestAccAWSRouteTable_disappears
--- PASS: TestAccAWSRouteTable_IPv6_To_EgressOnlyInternetGateway (44.97s)
=== CONT  TestAccAWSRouteTable_basic
--- PASS: TestAccAWSRouteTable_disappears_SubnetAssociation (25.95s)
=== CONT  TestAccAWSRouteTableAssociation_disappears
--- PASS: TestAccAWSRouteTable_IPv4_To_InternetGateway (62.26s)
=== CONT  TestAccAWSRouteTableAssociation_Gateway_ChangeRouteTable
--- PASS: TestAccAWSRouteTable_disappears (21.38s)
=== CONT  TestAccAWSRouteTableAssociation_Gateway_basic
--- PASS: TestAccAWSRouteTable_basic (23.10s)
=== CONT  TestAccAWSRouteTableAssociation_Subnet_ChangeRouteTable
--- PASS: TestAccAWSRouteTableAssociation_disappears (39.97s)
=== CONT  TestAccAWSDefaultRouteTable_VpcEndpointAssociation
--- PASS: TestAccAWSRouteTable_IPv4_To_Instance (127.29s)
=== CONT  TestAccAWSDefaultRouteTable_RevokeExistingRules
--- PASS: TestAccAWSRouteTableAssociation_Subnet_ChangeRouteTable (60.89s)
=== CONT  TestAccAWSDefaultRouteTable_PrefixList_To_InternetGateway
--- PASS: TestAccAWSDefaultRouteTable_VpcEndpointAssociation (39.45s)
=== CONT  TestAccAWSDefaultRouteTable_ConditionalCidrBlock
--- PASS: TestAccAWSRouteTableAssociation_Gateway_basic (72.58s)
=== CONT  TestAccAWSRouteTable_ConditionalCidrBlock
--- PASS: TestAccAWSRouteTableAssociation_Gateway_ChangeRouteTable (94.63s)
=== CONT  TestAccAWSDefaultRouteTable_Tags
=== CONT  TestAccAWSDefaultRouteTable_swap
--- PASS: TestAccAWSDefaultRouteTable_PrefixList_To_InternetGateway (59.18s)
--- PASS: TestAccAWSDefaultRouteTable_ConditionalCidrBlock (57.71s)
=== CONT  TestAccAWSDefaultRouteTable_IPv4_To_VpcEndpoint
--- PASS: TestAccAWSRouteTable_ConditionalCidrBlock (58.99s)
=== CONT  TestAccAWSDefaultRouteTable_IPv4_To_TransitGateway
    resource_aws_default_route_table_test.go:229: Step 1/2 error: Error running apply: exit status 1
        
        Error: error creating EC2 Transit Gateway: TransitGatewayLimitExceeded: TransitGateway limit exceeded
        	status code: 400, request id: 889751a0-12bd-412f-ac2b-fe53a91d877e
        
          with aws_ec2_transit_gateway.test,
          on terraform_plugin_test.tf line 30, in resource "aws_ec2_transit_gateway" "test":
          30: resource "aws_ec2_transit_gateway" "test" {
        
--- FAIL: TestAccAWSDefaultRouteTable_IPv4_To_TransitGateway (13.18s)
=== CONT  TestAccAWSDefaultRouteTable_Route_ConfigMode
--- PASS: TestAccAWSDefaultRouteTable_Tags (54.43s)
=== CONT  TestAccAWSRouteTable_IPv4_To_VpcEndpoint
--- PASS: TestAccAWSDefaultRouteTable_RevokeExistingRules (101.38s)
=== CONT  TestAccAWSRouteTable_VgwRoutePropagation
=== CONT  TestAccAWSDefaultRouteTable_IPv4_To_VpcEndpoint
    resource_aws_default_route_table_test.go:261: Step 1/3 error: Error running apply: exit status 1
        
        Error: error adding VPC Endpoint Service permissions: InvalidPrincipal: Invalid Principal: 'arn:aws:sts::123456789012:assumed-role/terraform_team1_dev-developer/xyz@example.com'
        	status code: 400, request id: 09dacd97-3254-4fad-97b9-2162adbde7fe
        
          with aws_vpc_endpoint_service.test,
          on terraform_plugin_test.tf line 49, in resource "aws_vpc_endpoint_service" "test":
          49: resource "aws_vpc_endpoint_service" "test" {
        
--- PASS: TestAccAWSDefaultRouteTable_swap (95.88s)
=== CONT  TestAccAWSRouteTable_IPv4_To_VpcPeeringConnection
--- PASS: TestAccAWSDefaultRouteTable_Route_ConfigMode (80.87s)
=== CONT  TestAccAWSRouteTable_IPv4_To_LocalGateway
=== CONT  TestAccAWSRouteTable_IPv4_To_VpcEndpoint
    resource_aws_route_table_test.go:554: Step 1/2 error: Error running apply: exit status 1
        
        Error: error adding VPC Endpoint Service permissions: InvalidPrincipal: Invalid Principal: 'arn:aws:sts::123456789012:assumed-role/terraform_team1_dev-developer/xyz@example.com'
        	status code: 400, request id: 077f0db6-8b72-46d5-a00e-b160e6560d10
        
          with aws_vpc_endpoint_service.test,
          on terraform_plugin_test.tf line 40, in resource "aws_vpc_endpoint_service" "test":
          40: resource "aws_vpc_endpoint_service" "test" {
        
=== CONT  TestAccAWSRouteTable_IPv4_To_LocalGateway
    data_source_aws_outposts_outposts_test.go:67: skipping since no Outposts found
--- SKIP: TestAccAWSRouteTable_IPv4_To_LocalGateway (0.73s)
=== CONT  TestAccAWSRouteTable_IPv4_To_CarrierGateway
--- FAIL: TestAccAWSDefaultRouteTable_IPv4_To_VpcEndpoint (108.46s)
=== CONT  TestAccAWSRouteTable_VpcClassicLink
--- PASS: TestAccAWSRouteTable_VgwRoutePropagation (79.81s)
=== CONT  TestAccAWSRouteTable_PrefixList_To_InternetGateway
--- PASS: TestAccAWSRouteTable_IPv4_To_VpcPeeringConnection (29.90s)
=== CONT  TestAccAWSRouteTable_MultipleRoutes
--- FAIL: TestAccAWSRouteTable_IPv4_To_VpcEndpoint (108.94s)
=== CONT  TestAccAWSRouteTable_GatewayVpcEndpoint
--- PASS: TestAccAWSRouteTable_IPv4_To_CarrierGateway (29.41s)
=== CONT  TestAccAWSRouteTable_IPv4_To_TransitGateway
--- PASS: TestAccAWSRouteTable_VpcClassicLink (25.21s)
=== CONT  TestAccAWSDefaultRouteTable_disappears_Vpc
=== CONT  TestAccAWSRouteTable_IPv4_To_TransitGateway
    resource_aws_route_table_test.go:518: Step 1/2 error: Error running apply: exit status 1
        
        Error: error creating EC2 Transit Gateway: TransitGatewayLimitExceeded: TransitGateway limit exceeded
        	status code: 400, request id: 478517ee-f50e-4a73-81e1-8f468473b8cf
        
          with aws_ec2_transit_gateway.test,
          on terraform_plugin_test.tf line 30, in resource "aws_ec2_transit_gateway" "test":
          30: resource "aws_ec2_transit_gateway" "test" {
        
--- FAIL: TestAccAWSRouteTable_IPv4_To_TransitGateway (13.34s)
=== CONT  TestAccAWSRouteTable_Route_ConfigMode
--- PASS: TestAccAWSDefaultRouteTable_disappears_Vpc (14.54s)
=== CONT  TestAccAWSRouteTable_IPv4_To_NetworkInterfaces_Unattached
--- PASS: TestAccAWSRouteTable_PrefixList_To_InternetGateway (40.17s)
=== CONT  TestAccAWSRouteTable_VpcMultipleCidrs
--- PASS: TestAccAWSRouteTable_GatewayVpcEndpoint (38.48s)
=== CONT  TestAccAWSRouteTable_IPv6_To_NetworkInterface_Unattached
--- PASS: TestAccAWSRouteTable_VpcMultipleCidrs (46.29s)
=== CONT  TestAccAWSRouteTable_IPv4_To_NatGateway
--- PASS: TestAccAWSRouteTable_Route_ConfigMode (75.21s)
=== CONT  TestAccAWSRouteTable_RequireRouteDestination
--- PASS: TestAccAWSRouteTable_IPv6_To_NetworkInterface_Unattached (60.80s)
=== CONT  TestAccAWSRouteTable_Tags
--- PASS: TestAccAWSRouteTable_IPv4_To_NetworkInterfaces_Unattached (128.96s)
=== CONT  TestAccAWSRouteTable_RequireRouteTarget
--- PASS: TestAccAWSRouteTable_Tags (55.59s)
--- PASS: TestAccAWSRouteTable_RequireRouteTarget (12.65s)
--- PASS: TestAccAWSRouteTable_MultipleRoutes (237.76s)
--- PASS: TestAccAWSRouteTable_IPv4_To_NatGateway (211.98s)
--- PASS: TestAccAWSRouteTable_RequireRouteDestination (339.87s)

Failures not related to this change.

@ewbankkit ewbankkit merged commit d6488ff into hashicorp:main Oct 6, 2021
@ewbankkit
Copy link
Contributor

@msahihi Thanks for the contribution 🎉 👏.

@github-actions
Copy link

github-actions bot commented Oct 8, 2021

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

@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 Jun 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/ec2 Issues and PRs that pertain to the ec2 service. size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
4 participants