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

terraform 0.12 tries to remove busy aws_security_group yet ignoring HTTP 400 #8809

Closed
ghost opened this issue May 29, 2019 · 2 comments
Closed
Assignees
Labels
service/ec2 Issues and PRs that pertain to the ec2 service.

Comments

@ghost
Copy link

ghost commented May 29, 2019

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:

  1. Create an aws_instance associated with an aws_security_group
  2. Rename the aws_security_group
  3. 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.

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

@aeschright aeschright added the needs-triage Waiting for first response or review from a maintainer. label Jun 19, 2019
@aeschright aeschright added the service/ec2 Issues and PRs that pertain to the ec2 service. label Jul 3, 2019
@ryndaniels ryndaniels self-assigned this Nov 25, 2019
@ryndaniels
Copy link
Contributor

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! 🙂

@ryndaniels ryndaniels removed the needs-triage Waiting for first response or review from a maintainer. label Nov 25, 2019
@ghost
Copy link
Author

ghost commented Mar 29, 2020

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!

@ghost ghost locked and limited conversation to collaborators Mar 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/ec2 Issues and PRs that pertain to the ec2 service.
Projects
None yet
Development

No branches or pull requests

2 participants