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

Closes #10921 #11078

Merged
merged 1 commit into from
Dec 2, 2019
Merged

Closes #10921 #11078

merged 1 commit into from
Dec 2, 2019

Conversation

thatderek
Copy link
Contributor

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

Closes #10921
Relates #10688

Release note for CHANGELOG:

* resource/aws_emr_cluster: Makes `arn` of cluster available as resource attribute. [GH-10921]

Output from acceptance testing:
Note: I tested in us-east-1 because of a mismatch in us-west-2 AZ's in my account and the available compute instance types. Specifically, when I tried us-west-2, I saw all sorts of these types of errors like:

Error: Error waiting for EMR Cluster state to be "WAITING" or "RUNNING": TERMINATED_WITH_ERRORS: VALIDATION_ERROR: The requested instance type r4.xlarge is not supported in the requested availability zone. Learn more at https://docs.aws.amazon.com/console/elasticmapreduce/ERROR_noinstancetype

I assume ☝️ should not affect this PR's acceptance. Also, I ran the larger suite of aws_emr_cluster tests because I also changed the tagging in accordance with #10688

root@b99c1799daa8:/go/src/github.com/terraform-providers/terraform-provider-aws# AWS_DEFAULT_REGION=us-east-1 AWS_PROFILE=default make testacc TEST=./aws TESTARGS='-run=TestAccAWSEMRCluster_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSEMRCluster_ -timeout 120m
=== RUN   TestAccAWSEMRCluster_basic
=== PAUSE TestAccAWSEMRCluster_basic
=== RUN   TestAccAWSEMRCluster_additionalInfo
=== PAUSE TestAccAWSEMRCluster_additionalInfo
=== RUN   TestAccAWSEMRCluster_disappears
=== PAUSE TestAccAWSEMRCluster_disappears
=== RUN   TestAccAWSEMRCluster_configurationsJson
=== PAUSE TestAccAWSEMRCluster_configurationsJson
=== RUN   TestAccAWSEMRCluster_CoreInstanceGroup_AutoscalingPolicy
=== PAUSE TestAccAWSEMRCluster_CoreInstanceGroup_AutoscalingPolicy
=== RUN   TestAccAWSEMRCluster_CoreInstanceGroup_BidPrice
=== PAUSE TestAccAWSEMRCluster_CoreInstanceGroup_BidPrice
=== RUN   TestAccAWSEMRCluster_CoreInstanceGroup_InstanceCount
=== PAUSE TestAccAWSEMRCluster_CoreInstanceGroup_InstanceCount
=== RUN   TestAccAWSEMRCluster_CoreInstanceGroup_InstanceType
=== PAUSE TestAccAWSEMRCluster_CoreInstanceGroup_InstanceType
=== RUN   TestAccAWSEMRCluster_CoreInstanceGroup_Migration_CoreInstanceType
=== PAUSE TestAccAWSEMRCluster_CoreInstanceGroup_Migration_CoreInstanceType
=== RUN   TestAccAWSEMRCluster_CoreInstanceGroup_Migration_InstanceGroup
=== PAUSE TestAccAWSEMRCluster_CoreInstanceGroup_Migration_InstanceGroup
=== RUN   TestAccAWSEMRCluster_CoreInstanceGroup_Name
=== PAUSE TestAccAWSEMRCluster_CoreInstanceGroup_Name
=== RUN   TestAccAWSEMRCluster_instance_group
=== PAUSE TestAccAWSEMRCluster_instance_group
=== RUN   TestAccAWSEMRCluster_instance_group_names
=== PAUSE TestAccAWSEMRCluster_instance_group_names
=== RUN   TestAccAWSEMRCluster_instance_group_update
=== PAUSE TestAccAWSEMRCluster_instance_group_update
=== RUN   TestAccAWSEMRCluster_instance_group_EBSVolumeType_st1
=== PAUSE TestAccAWSEMRCluster_instance_group_EBSVolumeType_st1
=== RUN   TestAccAWSEMRCluster_updateAutoScalingPolicy
=== PAUSE TestAccAWSEMRCluster_updateAutoScalingPolicy
=== RUN   TestAccAWSEMRCluster_Kerberos_ClusterDedicatedKdc
=== PAUSE TestAccAWSEMRCluster_Kerberos_ClusterDedicatedKdc
=== RUN   TestAccAWSEMRCluster_MasterInstanceGroup_BidPrice
=== PAUSE TestAccAWSEMRCluster_MasterInstanceGroup_BidPrice
=== RUN   TestAccAWSEMRCluster_MasterInstanceGroup_InstanceCount
=== PAUSE TestAccAWSEMRCluster_MasterInstanceGroup_InstanceCount
=== RUN   TestAccAWSEMRCluster_MasterInstanceGroup_InstanceType
=== PAUSE TestAccAWSEMRCluster_MasterInstanceGroup_InstanceType
=== RUN   TestAccAWSEMRCluster_MasterInstanceGroup_Migration_InstanceGroup
=== PAUSE TestAccAWSEMRCluster_MasterInstanceGroup_Migration_InstanceGroup
=== RUN   TestAccAWSEMRCluster_MasterInstanceGroup_Migration_MasterInstanceType
=== PAUSE TestAccAWSEMRCluster_MasterInstanceGroup_Migration_MasterInstanceType
=== RUN   TestAccAWSEMRCluster_MasterInstanceGroup_Name
=== PAUSE TestAccAWSEMRCluster_MasterInstanceGroup_Name
=== RUN   TestAccAWSEMRCluster_security_config
=== PAUSE TestAccAWSEMRCluster_security_config
=== RUN   TestAccAWSEMRCluster_Step_Basic
=== PAUSE TestAccAWSEMRCluster_Step_Basic
=== RUN   TestAccAWSEMRCluster_Step_ConfigMode
=== PAUSE TestAccAWSEMRCluster_Step_ConfigMode
=== RUN   TestAccAWSEMRCluster_Step_Multiple
=== PAUSE TestAccAWSEMRCluster_Step_Multiple
=== RUN   TestAccAWSEMRCluster_bootstrap_ordering
=== PAUSE TestAccAWSEMRCluster_bootstrap_ordering
=== RUN   TestAccAWSEMRCluster_terminationProtected
=== PAUSE TestAccAWSEMRCluster_terminationProtected
=== RUN   TestAccAWSEMRCluster_keepJob
=== PAUSE TestAccAWSEMRCluster_keepJob
=== RUN   TestAccAWSEMRCluster_visibleToAllUsers
=== PAUSE TestAccAWSEMRCluster_visibleToAllUsers
=== RUN   TestAccAWSEMRCluster_s3Logging
=== PAUSE TestAccAWSEMRCluster_s3Logging
=== RUN   TestAccAWSEMRCluster_tags
=== PAUSE TestAccAWSEMRCluster_tags
=== RUN   TestAccAWSEMRCluster_root_volume_size
=== PAUSE TestAccAWSEMRCluster_root_volume_size
=== RUN   TestAccAWSEMRCluster_custom_ami_id
=== PAUSE TestAccAWSEMRCluster_custom_ami_id
=== CONT  TestAccAWSEMRCluster_basic
=== CONT  TestAccAWSEMRCluster_MasterInstanceGroup_InstanceCount
=== CONT  TestAccAWSEMRCluster_CoreInstanceGroup_BidPrice
=== CONT  TestAccAWSEMRCluster_CoreInstanceGroup_Migration_CoreInstanceType
=== CONT  TestAccAWSEMRCluster_CoreInstanceGroup_InstanceType
=== CONT  TestAccAWSEMRCluster_CoreInstanceGroup_Migration_InstanceGroup
=== CONT  TestAccAWSEMRCluster_MasterInstanceGroup_BidPrice
=== CONT  TestAccAWSEMRCluster_Kerberos_ClusterDedicatedKdc
=== CONT  TestAccAWSEMRCluster_updateAutoScalingPolicy
=== CONT  TestAccAWSEMRCluster_instance_group_EBSVolumeType_st1
=== CONT  TestAccAWSEMRCluster_instance_group_update
=== CONT  TestAccAWSEMRCluster_instance_group_names
=== CONT  TestAccAWSEMRCluster_instance_group
=== CONT  TestAccAWSEMRCluster_CoreInstanceGroup_InstanceCount
=== CONT  TestAccAWSEMRCluster_bootstrap_ordering
=== CONT  TestAccAWSEMRCluster_custom_ami_id
=== CONT  TestAccAWSEMRCluster_root_volume_size
=== CONT  TestAccAWSEMRCluster_tags
=== CONT  TestAccAWSEMRCluster_s3Logging
=== CONT  TestAccAWSEMRCluster_CoreInstanceGroup_Name
--- PASS: TestAccAWSEMRCluster_bootstrap_ordering (462.66s)
=== CONT  TestAccAWSEMRCluster_visibleToAllUsers
--- PASS: TestAccAWSEMRCluster_instance_group (485.44s)
=== CONT  TestAccAWSEMRCluster_keepJob
--- PASS: TestAccAWSEMRCluster_custom_ami_id (563.78s)
=== CONT  TestAccAWSEMRCluster_terminationProtected
--- PASS: TestAccAWSEMRCluster_instance_group_names (563.85s)
=== CONT  TestAccAWSEMRCluster_configurationsJson
--- PASS: TestAccAWSEMRCluster_CoreInstanceGroup_InstanceCount (566.28s)
=== CONT  TestAccAWSEMRCluster_CoreInstanceGroup_AutoscalingPolicy
--- PASS: TestAccAWSEMRCluster_basic (568.91s)
=== CONT  TestAccAWSEMRCluster_security_config
--- PASS: TestAccAWSEMRCluster_Kerberos_ClusterDedicatedKdc (570.97s)
=== CONT  TestAccAWSEMRCluster_Step_Multiple
--- PASS: TestAccAWSEMRCluster_CoreInstanceGroup_Migration_InstanceGroup (624.29s)
=== CONT  TestAccAWSEMRCluster_Step_ConfigMode
--- PASS: TestAccAWSEMRCluster_instance_group_update (627.04s)
=== CONT  TestAccAWSEMRCluster_Step_Basic
--- PASS: TestAccAWSEMRCluster_instance_group_EBSVolumeType_st1 (631.95s)
=== CONT  TestAccAWSEMRCluster_disappears
--- PASS: TestAccAWSEMRCluster_updateAutoScalingPolicy (633.16s)
=== CONT  TestAccAWSEMRCluster_additionalInfo
--- PASS: TestAccAWSEMRCluster_s3Logging (666.60s)
=== CONT  TestAccAWSEMRCluster_MasterInstanceGroup_Name
--- PASS: TestAccAWSEMRCluster_CoreInstanceGroup_Migration_CoreInstanceType (738.59s)
=== CONT  TestAccAWSEMRCluster_MasterInstanceGroup_Migration_MasterInstanceType
--- PASS: TestAccAWSEMRCluster_tags (906.46s)
=== CONT  TestAccAWSEMRCluster_MasterInstanceGroup_Migration_InstanceGroup
--- PASS: TestAccAWSEMRCluster_keepJob (459.45s)
=== CONT  TestAccAWSEMRCluster_MasterInstanceGroup_InstanceType
--- PASS: TestAccAWSEMRCluster_additionalInfo (388.20s)
--- PASS: TestAccAWSEMRCluster_terminationProtected (466.61s)
--- PASS: TestAccAWSEMRCluster_configurationsJson (476.68s)
--- PASS: TestAccAWSEMRCluster_MasterInstanceGroup_BidPrice (1061.94s)
--- PASS: TestAccAWSEMRCluster_disappears (454.72s)
--- PASS: TestAccAWSEMRCluster_CoreInstanceGroup_AutoscalingPolicy (561.98s)
--- PASS: TestAccAWSEMRCluster_root_volume_size (1130.29s)
--- PASS: TestAccAWSEMRCluster_Step_Basic (542.90s)
--- PASS: TestAccAWSEMRCluster_Step_Multiple (606.19s)
--- PASS: TestAccAWSEMRCluster_CoreInstanceGroup_Name (1179.35s)
--- PASS: TestAccAWSEMRCluster_security_config (620.31s)
--- PASS: TestAccAWSEMRCluster_MasterInstanceGroup_InstanceCount (1190.97s)
--- PASS: TestAccAWSEMRCluster_MasterInstanceGroup_Migration_MasterInstanceType (468.27s)
--- PASS: TestAccAWSEMRCluster_CoreInstanceGroup_InstanceType (1236.30s)
--- PASS: TestAccAWSEMRCluster_visibleToAllUsers (837.63s)
--- PASS: TestAccAWSEMRCluster_CoreInstanceGroup_BidPrice (1341.56s)
--- PASS: TestAccAWSEMRCluster_MasterInstanceGroup_Migration_InstanceGroup (447.72s)
--- PASS: TestAccAWSEMRCluster_Step_ConfigMode (841.25s)
--- PASS: TestAccAWSEMRCluster_MasterInstanceGroup_Name (838.47s)
--- PASS: TestAccAWSEMRCluster_MasterInstanceGroup_InstanceType (748.52s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	1693.494s
root@b99c1799daa8:/go/src/github.com/terraform-providers/terraform-provider-aws# 

ʕ •ᴥ•ʔ

@thatderek thatderek requested a review from a team December 1, 2019 19:42
@ghost ghost added size/M Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. documentation Introduces or discusses updates to documentation. service/emr Issues and PRs that pertain to the emr service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Dec 1, 2019
@gdavison gdavison self-assigned this Dec 2, 2019
@gdavison gdavison added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Dec 2, 2019
@gdavison
Copy link
Contributor

gdavison commented Dec 2, 2019

Thanks for the PR, @thatderek. Normally we prefer separate PRs for separate features, but the changes are small enough that the two changes are easy to review.

The errors are because AWS has added a new AZ in us-west-2 that doesn't seem to support a large number of instance types. I've run some of the tests manually, and they pass when AWS allocates a compatible AZ.

For future reference, the aws_availability_zones data source allows you to reject specific AZs using either the blacklisted_names or blacklisted_zone_ids attributes. For example:

data "aws_region" "current" {}

locals {
  region_blacklisted_az_ids = {
    "us-west-2" = ["usw2-az4"]
  }

  blacklisted_az_ids = lookup(local.region_blacklisted_az_ids, data.aws_region.current.name, [])
}

data "aws_availability_zones" "available" {
  state = "available"

  blacklisted_zone_ids = local.blacklisted_az_ids
}

resource "aws_subnet" "main" {
  vpc_id     = "${aws_vpc.main.id}"
 ...

  availability_zone = data.aws_availability_zones.available.names[0]
}

I'll update the test code to use that snippet so that all the tests will pass cleanly.

@gdavison gdavison added this to the v2.41.0 milestone Dec 2, 2019
@gdavison gdavison merged commit a075351 into hashicorp:master Dec 2, 2019
gdavison added a commit that referenced this pull request Dec 2, 2019
@thatderek
Copy link
Contributor Author

thatderek commented Dec 2, 2019

Ohhhhh @gdavison that makes sense. I figured the test happened to already be compatible with whatever subset of AZs AWS had allocated to the account Hashicorp's test-runners. Got it. I will study this more carefully in the future.

On the number of items, no problem. I figured I'd knock it out since I was in the weeds anyhow, but I understand the preference. I'll separate them out in the future.

╭(◔ ◡ ◔)/

@ghost
Copy link

ghost commented Dec 4, 2019

This has been released in version 2.41.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 28, 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 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/emr Issues and PRs that pertain to the emr service. size/M Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Amazon EMR cluster ARN
2 participants