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 master_instance_group and core_instance_group configuration blocks, deprecate other instance group configuration methods #8459

Merged
merged 3 commits into from
May 13, 2019

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Apr 26, 2019

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 #8245

Output from acceptance testing (will kick off full resource testing shortly):

--- PASS: TestAccAWSEMRCluster_CoreInstanceGroup_AutoscalingPolicy (487.78s)
--- PASS: TestAccAWSEMRCluster_CoreInstanceGroup_BidPrice (1006.42s)
--- PASS: TestAccAWSEMRCluster_CoreInstanceGroup_InstanceCount (1004.90s)
--- PASS: TestAccAWSEMRCluster_CoreInstanceGroup_InstanceType (869.47s)
--- PASS: TestAccAWSEMRCluster_CoreInstanceGroup_Migration_CoreInstanceType (415.45s)
--- PASS: TestAccAWSEMRCluster_CoreInstanceGroup_Migration_InstanceGroup (485.50s)
--- PASS: TestAccAWSEMRCluster_CoreInstanceGroup_Name (769.30s)
--- PASS: TestAccAWSEMRCluster_MasterInstanceGroup_BidPrice (849.98s)
--- PASS: TestAccAWSEMRCluster_MasterInstanceGroup_InstanceType (756.42s)
--- PASS: TestAccAWSEMRCluster_MasterInstanceGroup_Migration_InstanceGroup (414.36s)
--- PASS: TestAccAWSEMRCluster_MasterInstanceGroup_Migration_MasterInstanceType (423.02s)
--- PASS: TestAccAWSEMRCluster_MasterInstanceGroup_Name (735.58s)

@bflad bflad added service/emr Issues and PRs that pertain to the emr service. technical-debt Addresses areas of the codebase that need refactoring or redesign. labels Apr 26, 2019
@bflad bflad requested a review from a team April 26, 2019 19:55
@ghost ghost added size/XXL Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Apr 26, 2019
…_group configuration blocks, deprecate other instance group configuration methods

Reference: #8245

Output from acceptance testing:

```
--- PASS: TestAccAWSEMRCluster_CoreInstanceGroup_AutoscalingPolicy (487.78s)
--- PASS: TestAccAWSEMRCluster_CoreInstanceGroup_BidPrice (1006.42s)
--- PASS: TestAccAWSEMRCluster_CoreInstanceGroup_InstanceCount (1004.90s)
--- PASS: TestAccAWSEMRCluster_CoreInstanceGroup_InstanceType (869.47s)
--- PASS: TestAccAWSEMRCluster_CoreInstanceGroup_Migration_CoreInstanceType (415.45s)
--- PASS: TestAccAWSEMRCluster_CoreInstanceGroup_Migration_InstanceGroup (485.50s)
--- PASS: TestAccAWSEMRCluster_CoreInstanceGroup_Name (769.30s)
--- PASS: TestAccAWSEMRCluster_MasterInstanceGroup_BidPrice (849.98s)
--- PASS: TestAccAWSEMRCluster_MasterInstanceGroup_InstanceType (756.42s)
--- PASS: TestAccAWSEMRCluster_MasterInstanceGroup_Migration_InstanceGroup (414.36s)
--- PASS: TestAccAWSEMRCluster_MasterInstanceGroup_Migration_MasterInstanceType (423.02s)
--- PASS: TestAccAWSEMRCluster_MasterInstanceGroup_Name (735.58s)
```
@bflad bflad force-pushed the td-aws_emr_cluster-instance_group-split branch from 6cd6a5f to c2ce886 Compare April 26, 2019 20:18
@nywilken nywilken added this to the v3.0.0 milestone May 1, 2019
Copy link
Contributor

@nywilken nywilken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking pretty solid, and the upgrade guide is nicely written 👍🏼

I’m still working through the resource changes but there are a few minor things worth calling out.

website/docs/guides/version-3-upgrade.html.md Outdated Show resolved Hide resolved
website/docs/r/emr_cluster.html.markdown Outdated Show resolved Hide resolved
@@ -2523,161 +3169,478 @@ resource "aws_kms_key" "foo" {
}
POLICY
}
`, r, r, r, r, r, r, r, r, r)
`, r, r, r, r, r, r, r, r, r)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let’s switch to index notation for the verbs as opposed to positional.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated this unrelated test to index notation, but I'd really prefer to treat testing cleanup separate from code changes for this resource so we can simplify/fix all the test configurations together (e.g. use testAccAWSEmrClusterConfigBaseVpc) and keep the review here concise.

--- PASS: TestAccAWSEMRCluster_security_config (404.88s)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

bflad and others added 2 commits May 13, 2019 08:37
Co-Authored-By: Wilken Rivera <dev@wilkenrivera.com>
…urityConfiguration to index notation

Reference: https://github.com/terraform-providers/terraform-provider-aws/pull/8459/files#r282175062

Output from acceptance testing:

```
--- PASS: TestAccAWSEMRCluster_security_config (404.88s)
```
@bflad bflad removed this from the v3.0.0 milestone May 13, 2019
Copy link
Contributor

@nywilken nywilken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 👍

@bflad bflad added this to the v2.11.0 milestone May 13, 2019
@bflad bflad merged commit 3ce7db6 into master May 13, 2019
@bflad bflad deleted the td-aws_emr_cluster-instance_group-split branch May 13, 2019 21:10
bflad added a commit that referenced this pull request May 13, 2019
@bflad
Copy link
Contributor Author

bflad commented May 17, 2019

This has been released in version 2.11.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@dthauvin
Copy link

Hello @bflad why remove the capabilities of launching an instance_group Core and TASK in a single terraform apply with aws_emr_cluster ressource .
When we used BOTO or other SDK with a single API call we can :

```python
client.run_job_flow(
            Name=cluster_name,
            LogUri=bucket_log,
            ReleaseLabel='emr-5.20.0',
            Instances={
                'KeepJobFlowAliveWhenNoSteps': False,
                'TerminationProtected': False,
                'Ec2SubnetId': subnet_id,
                'Ec2KeyName': 'key_pair',
                'InstanceGroups': [
                    {
                        'Name': 'master',
                                'InstanceRole': 'MASTER',
                        'InstanceType': instance_type,
                        'InstanceCount': 1,
                        'Market': 'SPOT',
                    },
                    {
                        'Name': 'core',
                                'InstanceRole': 'CORE',
                                'InstanceType': instance_type,
                        'InstanceCount': instance_core_count,
                        'Market': 'SPOT',
                        'AutoScalingPolicy': autoscaling_policy
                    },
                    {
                        'Name': 'task',
                                'InstanceRole': 'TASK',
                                'InstanceType': instance_type,
                        'InstanceCount': instance_task_count,
                        'Market': 'SPOT',
                        'AutoScalingPolicy': autoscaling_policy,
                    }
                ]
            },
            VisibleToAllUsers=True,
            Steps=steps,
            BootstrapActions=bootstrapping,
            Applications=applications,
            JobFlowRole='EMR_EC2_DefaultRole',
            ServiceRole='EMR_DefaultRole',
            AutoScalingRole='EMR_AutoScaling_DefaultRole',
            Tags=tags,
            EbsRootVolumeSize=ebs_size,
            SecurityConfiguration=security_configuration
        )

thank you

@anouvel
Copy link
Contributor

anouvel commented Jun 6, 2019

Hi,

I think this behaviour could be the same as security group inline rule vs security group rule as resources. @bflad Any opinion / suggestion?

@ghost
Copy link

ghost commented Nov 3, 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 3, 2019
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/XXL Managed by automation to categorize the size of a PR. technical-debt Addresses areas of the codebase that need refactoring or redesign. 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.

Split aws_emr_cluster Resource instance_group Configuration Block Handling
4 participants