-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Final retries deleting and attaching VPN gateways #9641
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, just two notes to address below.
--- PASS: TestAccAWSVpnGateway_delete (50.49s)
--- PASS: TestAccAWSVpnGateway_disappears (54.67s)
--- PASS: TestAccAWSVpnGatewayAttachment_basic (56.22s)
--- PASS: TestAccAWSVpnGateway_tags (58.54s)
--- PASS: TestAccAWSVpnGatewayAttachment_deleted (61.84s)
--- PASS: TestAccAWSVpnGateway_withAvailabilityZoneSetToState (69.88s)
--- PASS: TestAccAWSVpnGateway_importBasic (76.91s)
--- PASS: TestAccAWSVpnGateway_basic (86.56s)
--- PASS: TestAccAWSVpnGateway_withAmazonSideAsnSetToState (92.27s)
--- PASS: TestAccAWSVpnGateway_reattach (141.39s)
aws/resource_aws_vpn_gateway.go
Outdated
case "InvalidVpnGatewayID.NotFound": | ||
return nil | ||
case "IncorrectState": | ||
if !isAWSErr(err, "", "") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a valid error condition to test 😉 All AWS Go SDK errors should have an error code. We can just remove this if
condition here.
aws/resource_aws_vpn_gateway.go
Outdated
@@ -206,13 +215,19 @@ func resourceAwsVpnGatewayAttach(d *schema.ResourceData, meta interface{}) error | |||
if isAWSErr(err, "InvalidVpnGatewayID.NotFound", "") { | |||
return resource.RetryableError(err) | |||
} | |||
if isAWSErr(err, "InvalidParameterValue", "This call cannot be completed because there are pending VPNs or Virtual Interfaces") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest moving this logic into aws/config.go
so we can have the AWS Go SDK automatically retry this API call anywhere its used. See also: https://github.com/terraform-providers/terraform-provider-aws/blob/7cb3734472b25b4515367d55326b88ae480c5937/aws/config.go#L556-L574
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
--- PASS: TestAccAWSVpnGateway_disappears (46.04s)
--- PASS: TestAccAWSVpnGateway_withAvailabilityZoneSetToState (46.43s)
--- PASS: TestAccAWSVpnGateway_withAmazonSideAsnSetToState (52.47s)
--- PASS: TestAccAWSVpnGateway_importBasic (55.84s)
--- PASS: TestAccAWSVpnGatewayAttachment_basic (56.12s)
--- PASS: TestAccAWSVpnGatewayAttachment_deleted (61.87s)
--- PASS: TestAccAWSVpnGateway_tags (62.66s)
--- PASS: TestAccAWSVpnGateway_delete (98.15s)
--- PASS: TestAccAWSVpnGateway_basic (114.31s)
--- PASS: TestAccAWSVpnGateway_reattach (134.79s)
This has been released in version 2.24.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
Relates #7873
Release note for CHANGELOG:
Output from acceptance testing: