-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
resource/aws_emr_cluster Add support for subnet_ids attribute #17219
resource/aws_emr_cluster Add support for subnet_ids attribute #17219
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome @kristerjaanhold 👋
It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTING guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.
Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.
Thanks again, and welcome to the community! 😃
Hey @gdavison 👋 We're wondering if there's something we can do to bump this up? Checks are passing, code is there, this would be really useful to many people 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, @kristerjaanhold.
The new acceptance test step is currently failing, showing a plan difference. To run the specific test, you can run
$ make testacc TESTARGS='-run=TestAccAWSEMRCluster_basic'
To run all of the EMR Cluster tests, run
$ make testacc TESTARGS='-run=TestAccAWSEMRCluster_'
I've also added a number of changes to consider.
applications = ["Spark"] | ||
|
||
ec2_attributes { | ||
subnet_ids = [aws_subnet.test.id] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test should have multiple subnets
@@ -98,6 +98,17 @@ func TestAccAWSEMRCluster_basic(t *testing.T) { | |||
resource.TestCheckResourceAttr(resourceName, "bootstrap_action.#", "0"), | |||
), | |||
}, | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should have an Import test after the first step, as well as after, to ensure that terraform import
will work in both cases
{ | ||
Config: testAccAWSEmrClusterConfigMultipleSubnets(rName), | ||
Check: resource.ComposeTestCheckFunc( | ||
testAccCheckAWSEmrClusterExists(resourceName, &cluster), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For completeness, this step should include a call to testAccCheckAWSEmrClusterRecreated()
, since both subnet_id
and subnet_ids
are ForceNew
resource.TestCheckResourceAttr(resourceName, "step.#", "0"), | ||
resource.TestCheckResourceAttrSet(resourceName, "arn"), | ||
resource.TestCheckNoResourceAttr(resourceName, "additional_info"), | ||
resource.TestCheckResourceAttr(resourceName, "bootstrap_action.#", "0"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should test that ec2_attributes.0. subnet_ids
has the correct number of values and that the correct values are set and that ec2_attributes.0. subnet_id
is not set. TypeSet
values can be checked using resource.TestCheckTypeSetElemAttrPair
.
In addition, in the first test step, the test should confirm that ec2_attributes.0. subnet_id
is set to the correct value and that ec2_attributes.0. subnet_ids
has zero elements.
Hi @kristerjaanhold. We've had a lot of requests for this PR, so we'd like to get it merged in. If you'd like to continue working on it, let me know. Otherwise, I'll pick it up from here and make the needed changes, probably Monday, 12 April, Pacific time (UTC-7). I'll make sure that your contributions are still credited 🙂 |
Hi @gdavison, feel free to pick it up from here. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Acceptance test results
--- PASS: TestAccAWSEMRCluster_disappears (836.36s)
--- PASS: TestAccAWSEMRCluster_configurationsJson (943.43s)
--- PASS: TestAccAWSEMRCluster_security_config (948.97s)
--- PASS: TestAccAWSEMRCluster_basic (987.39s)
--- PASS: TestAccAWSEMRCluster_Step_Basic (1009.17s)
--- PASS: TestAccAWSEMRCluster_InstanceFleet_master_only (1020.61s)
--- PASS: TestAccAWSEMRCluster_custom_ami_id (1055.85s)
--- PASS: TestAccAWSEMRCluster_Kerberos_ClusterDedicatedKdc (1071.61s)
--- PASS: TestAccAWSEMRCluster_CoreInstanceGroup_AutoscalingPolicy (1119.10s)
--- PASS: TestAccAWSEMRCluster_CoreInstanceGroup_InstanceCount (1157.16s)
--- PASS: TestAccAWSEMRCluster_MasterInstanceGroup_InstanceType (1200.88s)
--- PASS: TestAccAWSEMRCluster_Ec2Attributes_DefaultManagedSecurityGroups (1303.71s)
--- PASS: TestAccAWSEMRCluster_tags (1308.94s)
--- PASS: TestAccAWSEMRCluster_additionalInfo (451.51s)
--- PASS: TestAccAWSEMRCluster_MasterInstanceGroup_BidPrice (1432.37s)
--- PASS: TestAccAWSEMRCluster_ebs_config (644.82s)
--- PASS: TestAccAWSEMRCluster_CoreInstanceGroup_InstanceType (1504.15s)
--- PASS: TestAccAWSEMRCluster_MasterInstanceGroup_InstanceCount (1518.15s)
--- PASS: TestAccAWSEMRCluster_CoreInstanceGroup_BidPrice (1527.34s)
--- PASS: TestAccAWSEMRCluster_Step_Multiple (521.91s)
--- PASS: TestAccAWSEMRCluster_step_concurrency_level (576.21s)
--- PASS: TestAccAWSEMRCluster_CoreInstanceGroup_Name (1614.24s)
--- PASS: TestAccAWSEMRCluster_s3Logging (637.90s)
--- PASS: TestAccAWSEMRCluster_terminationProtected (664.23s)
--- PASS: TestAccAWSEMRCluster_MasterInstanceGroup_Name (1673.52s)
--- PASS: TestAccAWSEMRCluster_keepJob (559.41s)
--- PASS: TestAccAWSEMRCluster_InstanceFleet_basic (1780.47s)
--- PASS: TestAccAWSEMRCluster_root_volume_size (972.90s)
--- PASS: TestAccAWSEMRCluster_visibleToAllUsers (912.02s)
--- PASS: TestAccAWSEMRCluster_Step_ConfigMode (1087.24s)
--- PASS: TestAccAWSEMRCluster_bootstrap_ordering (1454.59s)
This has been released in version 3.37.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! |
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! |
Community Note
Closes #15970
Closes #15911
Release note for CHANGELOG:
Output from acceptance testing: