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

resource/aws_emr_cluster Add support for subnet_ids attribute #17219

Merged
merged 15 commits into from
Apr 15, 2021

Conversation

kristerjaanhold
Copy link
Contributor

@kristerjaanhold kristerjaanhold commented Jan 21, 2021

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" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #15970
Closes #15911

Release note for CHANGELOG:

Add support for subnet_ids attribute for aws_emr_cluster. 

Output from acceptance testing:

$ make testacc TESTARGS='-run=testAccAWSEmrClusterConfigMultipleSubnets'

...

@ghost ghost added size/XS Managed by automation to categorize the size of a PR. service/emr Issues and PRs that pertain to the emr service. labels Jan 21, 2021
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Jan 21, 2021
Copy link

@github-actions github-actions bot left a 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! 😃

@ghost ghost added the documentation Introduces or discusses updates to documentation. label Jan 21, 2021
@ghost ghost added size/M Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. and removed size/XS Managed by automation to categorize the size of a PR. labels Jan 21, 2021
@kristerjaanhold kristerjaanhold marked this pull request as ready for review January 22, 2021 14:00
@kristerjaanhold kristerjaanhold requested a review from a team as a code owner January 22, 2021 14:00
Base automatically changed from master to main January 23, 2021 01:00
@kasparg
Copy link

kasparg commented Apr 1, 2021

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 🙂

Copy link
Contributor

@gdavison gdavison left a 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]
Copy link
Contributor

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"),
),
},
{
Copy link
Contributor

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),
Copy link
Contributor

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"),
Copy link
Contributor

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.

@gdavison gdavison added the waiting-response Maintainers are waiting on response from community or contributor. label Apr 5, 2021
@gdavison
Copy link
Contributor

gdavison commented Apr 9, 2021

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 🙂

@kristerjaanhold
Copy link
Contributor Author

Hi @gdavison, feel free to pick it up from here. Thanks!

@ghost ghost removed waiting-response Maintainers are waiting on response from community or contributor. labels Apr 12, 2021
Copy link
Contributor

@gdavison gdavison left a 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)

@gdavison gdavison merged commit 5d55d97 into hashicorp:main Apr 15, 2021
@github-actions github-actions bot added this to the v3.37.0 milestone Apr 15, 2021
@ghost
Copy link

ghost commented Apr 16, 2021

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!

@ghost
Copy link

ghost commented May 16, 2021

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 as resolved and limited conversation to collaborators May 16, 2021
@breathingdust breathingdust removed the needs-triage Waiting for first response or review from a maintainer. label Sep 17, 2021
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. 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.

Multiple subnet_id-s are not supported with EMR instance fleets Possibility to Add multiple subnets on Emr
4 participants