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

EMR instance gets "forces new instance" when no changes made #5075

Closed
synhershko opened this issue Jul 4, 2018 · 4 comments · Fixed by #5493
Closed

EMR instance gets "forces new instance" when no changes made #5075

synhershko opened this issue Jul 4, 2018 · 4 comments · Fixed by #5493
Labels
bug Addresses a defect in current functionality. service/emr Issues and PRs that pertain to the emr service.
Milestone

Comments

@synhershko
Copy link

Code to launch the EMR cluster:

resource "aws_emr_cluster" "parqueting" {
  name          = "Parqueting"
  release_label = "emr-5.14.0"
  applications  = ["Spark", "Ganglia"]

  log_uri = "s3n://my-emr-logs/parqueting/"

  ec2_attributes {
    subnet_id                         = "${var.subnet_id}"
    instance_profile                  = "${aws_iam_instance_profile.emr_profile.arn}"
    key_name                          = "${var.keyname}"
  }

  configurations = "emr-parqueting-configurations.json"

  master_instance_type  = "m4.large"
  core_instance_type    = "c4.2xlarge"
  core_instance_count   = 1

  tags {
    name     = "parqueting"
  }
  service_role = "${aws_iam_role.iam_emr_service_role.arn}"
}

After creation, whenever I try to change other things the EMR cluster is planned for recreation as well although nothing changed there:

      ec2_attributes.0.emr_managed_master_security_group: "sg-057fe7bb416c5983f" => "" (forces new resource)
      ec2_attributes.0.emr_managed_slave_security_group:  "sg-01ac84737e433b8e1" => "" (forces new resource)
      ec2_attributes.0.instance_profile:                  "arn:aws:iam::744522205193:instance-profile/emr_profile" => "arn:aws:iam::744522205193:instance-profile/emr_profile"
      ec2_attributes.0.key_name:                          "sa-staging-emr" => "sa-staging-emr"
      ec2_attributes.0.service_access_security_group:     "sg-02cc532fcc7432a57" => "" (forces new resource)

If I fill in the ec2_attributes with those 3 "missing" attributes everything works correctly and the terraform doesn't attempt to recreate the cluster

@paddycarver paddycarver added bug Addresses a defect in current functionality. service/emr Issues and PRs that pertain to the emr service. labels Aug 1, 2018
@blckct
Copy link
Contributor

blckct commented Aug 9, 2018

TF doesn't seem to expect those attributes will be filled-in by default, should probably be marker as computed. It doesn't complain about service_access_security_group for me though, just the other two.

@bflad
Copy link
Contributor

bflad commented Jan 11, 2020

The fix for this has been merged and will release with version 2.45.0 of the Terraform AWS Provider, Thursday next week. Thanks to @blckct for the implementation. 👍

@ghost
Copy link

ghost commented Jan 17, 2020

This has been released in version 2.45.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 Mar 27, 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 27, 2020
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
4 participants