aws_vpn_gateway and aws_vpn_gateway_attachment incorrectly refreshing attachment state #8575
Labels
bug
Addresses a defect in current functionality.
service/ec2
Issues and PRs that pertain to the ec2 service.
Milestone
Community Note
The
vpnGatewayGetAttachment()
function, used when refreshing VGW attachment state, does not correctly account fordetaching
orattaching
states: https://github.com/terraform-providers/terraform-provider-aws/blob/3471582595cb9cd20d20abe2ca7f7463499edf6a/aws/resource_aws_vpn_gateway.go#L333-L340This only starts to manifest as a problem when the VGW has been attached to a Direct Connect gateway as the VGW attachment state will remain
detaching
for minutes. This has become evident in recent work with Direct Connect gateway attachments - #8222 (review) and #8455 (comment).In other cases the attachment state moves from
attached
todetached
effectively immediately, which is why none of the current acceptance tests have caused problems.The text was updated successfully, but these errors were encountered: