You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have modified (renamed) an aws_security_group resource. terraform plan states that it is going to remove old aws_security_group, create a new one and then update corresponding aws_instance in-place.
Steps to reproduce:
Create an aws_instance associated with an aws_security_group
Rename the aws_security_group
Apply changes
Observed behavior: terraform apply tries to remove the security group, receives HTTP 400 Bad request due this Security Group is in use, ignores error and keeps trying forever.
Desired behavior:
I wish terraform to perform the mentioned actions. If it is impossible it should at least show a notification in advance.
Hi @igorfraa - thanks for taking the time to open this issue. I had a look at this with the most recent versions of Terraform and the AWS Provider and was unable to reproduce this behavior. We’re going to close this issue for now, but if you run into this again with the latest Terraform and Provider versions, please feel free to open a new issue, making sure to provide all the information requested in the issue template. Thanks! 🙂
This issue was originally opened by @igorfraa as hashicorp/terraform#21505. It was migrated here as a result of the provider split. The original body of the issue is below.
I have modified (renamed) an aws_security_group resource.
terraform plan states that it is going to remove old aws_security_group, create a new one and then update corresponding aws_instance in-place.
Steps to reproduce:
Observed behavior:
terraform apply tries to remove the security group, receives HTTP 400 Bad request due this Security Group is in use, ignores error and keeps trying forever.
Desired behavior:
I wish terraform to perform the mentioned actions. If it is impossible it should at least show a notification in advance.
Debug logs:
aws_security_group.instance: Still destroying... [id=sg-0af1b6ca33a5dd2dc, 4m1s elapsed] 2019-05-29T12:38:49.845+0300 [DEBUG] plugin.terraform-provider-aws_v2.12.0_x4: 2019/05/29 12:38:49 [DEBUG] [aws-sdk-go] DEBUG: Request ec2/DeleteSecurityGroup Details: 2019-05-29T12:38:49.846+0300 [DEBUG] plugin.terraform-provider-aws_v2.12.0_x4: ---[ REQUEST POST-SIGN ]----------------------------- 2019-05-29T12:38:49.846+0300 [DEBUG] plugin.terraform-provider-aws_v2.12.0_x4: POST / HTTP/1.1 2019-05-29T12:38:49.846+0300 [DEBUG] plugin.terraform-provider-aws_v2.12.0_x4: Host: ec2.us-east-1.amazonaws.com 2019-05-29T12:38:49.846+0300 [DEBUG] plugin.terraform-provider-aws_v2.12.0_x4: User-Agent: aws-sdk-go/1.19.36 (go1.12.5; linux; amd64) APN/1.0 HashiCorp/1.0 Terraform/0.12.0 2019-05-29T12:38:49.846+0300 [DEBUG] plugin.terraform-provider-aws_v2.12.0_x4: Content-Length: 74 2019-05-29T12:38:49.846+0300 [DEBUG] plugin.terraform-provider-aws_v2.12.0_x4: Authorization: AWS4-HMAC-SHA256 Credential=xxxxx/20190529/us-east-1/ec2/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-date, Signature=xxxxxxxx 2019-05-29T12:38:49.846+0300 [DEBUG] plugin.terraform-provider-aws_v2.12.0_x4: Content-Type: application/x-www-form-urlencoded; charset=utf-8 2019-05-29T12:38:49.846+0300 [DEBUG] plugin.terraform-provider-aws_v2.12.0_x4: X-Amz-Date: 20190529T093849Z 2019-05-29T12:38:49.846+0300 [DEBUG] plugin.terraform-provider-aws_v2.12.0_x4: Accept-Encoding: gzip 2019-05-29T12:38:49.846+0300 [DEBUG] plugin.terraform-provider-aws_v2.12.0_x4: 2019-05-29T12:38:49.846+0300 [DEBUG] plugin.terraform-provider-aws_v2.12.0_x4: Action=DeleteSecurityGroup&GroupId=sg-0af1b6ca33a5dd2dc&Version=2016-11-15 2019-05-29T12:38:49.846+0300 [DEBUG] plugin.terraform-provider-aws_v2.12.0_x4: ----------------------------------------------------- 2019-05-29T12:38:50.810+0300 [DEBUG] plugin.terraform-provider-aws_v2.12.0_x4: 2019/05/29 12:38:50 [DEBUG] [aws-sdk-go] DEBUG: Response ec2/DeleteSecurityGroup Details: 2019-05-29T12:38:50.820+0300 [DEBUG] plugin.terraform-provider-aws_v2.12.0_x4: ---[ RESPONSE ]-------------------------------------- 2019-05-29T12:38:50.820+0300 [DEBUG] plugin.terraform-provider-aws_v2.12.0_x4: HTTP/1.1 400 Bad Request 2019-05-29T12:38:50.820+0300 [DEBUG] plugin.terraform-provider-aws_v2.12.0_x4: Connection: close 2019-05-29T12:38:50.820+0300 [DEBUG] plugin.terraform-provider-aws_v2.12.0_x4: Transfer-Encoding: chunked 2019-05-29T12:38:50.820+0300 [DEBUG] plugin.terraform-provider-aws_v2.12.0_x4: Date: Wed, 29 May 2019 09:38:50 GMT 2019-05-29T12:38:50.820+0300 [DEBUG] plugin.terraform-provider-aws_v2.12.0_x4: Server: AmazonEC2 2019-05-29T12:38:50.820+0300 [DEBUG] plugin.terraform-provider-aws_v2.12.0_x4: 2019-05-29T12:38:50.821+0300 [DEBUG] plugin.terraform-provider-aws_v2.12.0_x4: 2019-05-29T12:38:50.821+0300 [DEBUG] plugin.terraform-provider-aws_v2.12.0_x4: ----------------------------------------------------- 2019-05-29T12:38:50.821+0300 [DEBUG] plugin.terraform-provider-aws_v2.12.0_x4: 2019/05/29 12:38:50 [DEBUG] [aws-sdk-go] <?xml version="1.0" encoding="UTF-8"?> 2019-05-29T12:38:50.821+0300 [DEBUG] plugin.terraform-provider-aws_v2.12.0_x4: <Response><Errors><Error><Code>DependencyViolation</Code><Message>resource sg-0af1b6ca33a5dd2dc has a dependent object</Message></Error></Errors><RequestID>1f2211d4-393f-4368-a66c-896ca10734a6</RequestID></Response> 2019-05-29T12:38:50.821+0300 [DEBUG] plugin.terraform-provider-aws_v2.12.0_x4: 2019/05/29 12:38:50 [DEBUG] [aws-sdk-go] DEBUG: Validate Response ec2/DeleteSecurityGroup failed, not retrying, error DependencyViolation: resource sg-0af1b6ca33a5dd2dc has a dependent object 2019-05-29T12:38:50.821+0300 [DEBUG] plugin.terraform-provider-aws_v2.12.0_x4: status code: 400, request id: 1f2211d4-393f-4368-a66c-896ca10734a6 2019-05-29T12:38:50.821+0300 [DEBUG] plugin.terraform-provider-aws_v2.12.0_x4: 2019/05/29 12:38:50 [TRACE] Waiting 10s before next try
The text was updated successfully, but these errors were encountered: