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'm using terraform with aws, working with EMR clusters, I'm able to create the cluster completely using the docs instructions but when I try to delete it, terraform always fails in destroy de VPC and I'm forced to go to the console and delete it manually.
Terraform Version
Terraform v0.11.13
Expected Behavior:
Terraform should have destroyed everything including the VPC
Actual Behavior:
The VPC is not deleted even after ~10 min retries, the output of Terraform is:
aws_vpc.spark-emr-main: Still destroying... (ID: vpc-0291df56137e9c5b1, 4m50s elapsed)
2019/04/11 15:05:03 [ERROR] root: eval: *terraform.EvalApplyPost, err: 1 error(s) occurred:
* aws_vpc.spark-emr-main: DependencyViolation: The vpc 'vpc-0291df56137e9c5b1' has dependencies and cannot be deleted.
status code: 400, request id: 41465664-4873-4c92-b8b2-2e0bda3a5f19
2019/04/11 15:05:03 [ERROR] root: eval: *terraform.EvalSequence, err: 1 error(s) occurred:
* aws_vpc.spark-emr-main: DependencyViolation: The vpc 'vpc-0291df56137e9c5b1' has dependencies and cannot be deleted.
status code: 400, request id: 41465664-4873-4c92-b8b2-2e0bda3a5f19
2019/04/11 15:05:03 [ERROR] root: eval: *terraform.EvalOpFilter, err: 1 error(s) occurred:
* aws_vpc.spark-emr-main: DependencyViolation: The vpc 'vpc-0291df56137e9c5b1' has dependencies and cannot be deleted.
status code: 400, request id: 41465664-4873-4c92-b8b2-2e0bda3a5f19
Error: Error applying plan:
1 error(s) occurred:
* aws_vpc.spark-emr-main (destroy): 1 error(s) occurred:
* aws_vpc.spark-emr-main: DependencyViolation: The vpc 'vpc-0291df56137e9c5b1' has dependencies and cannot be deleted.
status code: 400, request id: 41465664-4873-4c92-b8b2-2e0bda3a5f19
Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.
Workaround:
Manually go to the aws web console and delete the VPC. If I do this while is destroying the VPC, Terraform finishes successfully.
My setup is almost identical to the sample I mentioned above, except that I don't use keep_job_flow_alive_when_no_steps, instance_group and additional_info.
I have tried by importing the emr managed security groups into my state, marking them with revoke_rules_on_delete = true before deleting; no luck, still unable to delete the VPC.
I also have additional security groups configured, all of them use revoke_rules_on_delete = true Still no luck.
From the error, it seems from Terraform standpoint, there is some resource depending on the VPC that is not being deleted as part of the destruction plan. I guess aws console is well aware of the dependencies and hence is able to destroy them in proper order.
I see something interesting though. On creation, I can see three associated with my VPC despite I only have one on my scripts, the one I'm explicitly associating to my VPC. I wonder if this is these are the dependencies that prevent the VPC to be deleted.
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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
ghost
locked and limited conversation to collaborators
Aug 13, 2019
This issue was closed.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi!
I'm using terraform with aws, working with EMR clusters, I'm able to create the cluster completely using the docs instructions but when I try to delete it, terraform always fails in destroy de VPC and I'm forced to go to the console and delete it manually.
Terraform Version
Expected Behavior:
Terraform should have destroyed everything including the VPC
Actual Behavior:
The VPC is not deleted even after ~10 min retries, the output of Terraform is:
Workaround:
Manually go to the aws web console and delete the VPC. If I do this while is destroying the VPC, Terraform finishes successfully.
Steps to Reproduce
terraform init
terraform apply
terraform destroy -auto-approve
Additional Context
keep_job_flow_alive_when_no_steps
,instance_group
andadditional_info
.revoke_rules_on_delete = true
before deleting; no luck, still unable to delete the VPC.revoke_rules_on_delete = true
Still no luck.References
Maybe this is related to:
The text was updated successfully, but these errors were encountered: