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

aws_emr_instance_group can't be destroyed #1355

Closed
synhershko opened this issue Aug 5, 2017 · 6 comments · Fixed by #10425
Closed

aws_emr_instance_group can't be destroyed #1355

synhershko opened this issue Aug 5, 2017 · 6 comments · Fixed by #10425
Labels
bug Addresses a defect in current functionality. service/emr Issues and PRs that pertain to the emr service.
Milestone

Comments

@synhershko
Copy link

synhershko commented Aug 5, 2017

Given a definition like below:

resource "aws_emr_instance_group" "querying-task-nodes" {
  name                      = "task"
  cluster_id                = "${aws_emr_cluster.querying.id}"
  instance_type             = "m4.xlarge"
  instance_count            = 5
}

If the EMR cluster is being destroyed successfully the instance group is getting into a limbo and can't be destroyed via terraform, giving the following error:

* aws_emr_instance_group.querying-task-nodes: ValidationException: An instance group may only be modified when the cluster is running or waiting.
	status code: 400, request id: d9555f4d-791e-11e7-b51e-cf8d28f27320

From what I can gather the issue is with the IG not being removed before the cluster is destroyed.

Using latest terraform (Terraform v0.10.0)

@radeksimko radeksimko added the bug Addresses a defect in current functionality. label Aug 7, 2017
@timothyclifford
Copy link

Any updates?

We are seeing same behaviour with v0.11.2

@bflad bflad added the service/emr Issues and PRs that pertain to the emr service. label Jan 16, 2018
@sbraden
Copy link

sbraden commented Jun 21, 2019

I recently observed this behavior on AWS. The work around (through the AWS Cloud Formation console) is when deleting the stack, opt to retain the resource (in this case the aws_emr_instance_group) that prevented the successful deletion of the stack. Then the delete of the stack can continue successfully.

@kutsav
Copy link

kutsav commented Aug 6, 2019

if the cluster with that task group is deleted, you can use terraform state rm to delete that entry from terraform state, and rerun your terraform to create cluster.

@bflad bflad added this to the v2.32.0 milestone Oct 10, 2019
bflad pushed a commit that referenced this issue Oct 10, 2019
In situations where Terraform needs to replace an aws_emr_cluster
resource that has aws_emr_instance_group resources associated with it,
Terraform tries to execute a destroy on the instance group, but it fails
as the notion of a "destroy" on an instance group is to set the number
of instances to zero, but AWS doesn't let you modify the count of
instances in an instance group on an EMR cluster. This fixes the issue
by treating an instance group that has been terminated as no longer
existing, so Terraform won't try to execute a "destroy" and not error
out.

Fixes #1355
Fixes #9400
@bflad
Copy link
Contributor

bflad commented Oct 10, 2019

The fix for this has been merged and will release with version 2.32.0 of the Terraform AWS Provider, later today. Thanks to @joelthompson for the implementation. 🎉

@ghost
Copy link

ghost commented Oct 10, 2019

This has been released in version 2.32.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!

@ghost
Copy link

ghost commented Nov 9, 2019

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 Nov 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/emr Issues and PRs that pertain to the emr service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants