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_instance_group: add autoscaling_policy and bid_price arguments, along with resource importing support #8078

Merged
merged 5 commits into from
May 17, 2019

Conversation

nywilken
Copy link
Contributor

@nywilken nywilken commented Mar 26, 2019

This change updates aws_emr_instance_group resource so that it has full parity with the deprecated instance_group configuration block in the aws_emr_cluster resource.

--- PASS: TestAccAWSEMRInstanceGroup_basic (559.04s)
--- PASS: TestAccAWSEMRInstanceGroup_AutoScalingPolicy (547.62s)
--- PASS: TestAccAWSEMRInstanceGroup_EbsConfig_EbsOptimized (567.56s)
--- PASS: TestAccAWSEMRInstanceGroup_BidPrice (601.52s)
--- PASS: TestAccAWSEMRInstanceGroup_InstanceCount (626.62s)

@ghost ghost added size/XL Managed by automation to categorize the size of a PR. 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 Mar 26, 2019
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Hey @nywilken 👋 Looking pretty good! Please reach out with any questions.

aws/resource_aws_emr_cluster.go Outdated Show resolved Hide resolved
aws/resource_aws_emr_instance_group.go Outdated Show resolved Hide resolved
aws/resource_aws_emr_instance_group.go Outdated Show resolved Hide resolved
"bid_price": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

Not necessarily for this pull request, but if interested, we could potentially make this field optionally ForceNew via CustomizeDiff, e.g.

CustomizeDiff: customdiff.Sequence(
	customdiff.ForceNewIfChange("bid_price", func(old, new, meta interface{}) bool {
		return old == "" || new == ""
	}),
),

Copy link
Contributor Author

@nywilken nywilken Mar 27, 2019

Choose a reason for hiding this comment

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

Thanks for providing this snippet. I will try to implement in this pull request. I am writing test against it now so I should have something new for you to review.

aws/resource_aws_emr_instance_group.go Outdated Show resolved Hide resolved
return "", fmt.Errorf("Not found: %s", resourceName)
}

log.Println(fmt.Sprintf("%s/%s", rs.Primary.Attributes["cluster_id"], rs.Primary.ID))
Copy link
Contributor

Choose a reason for hiding this comment

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

Extraneous log line can be removed 👍

aws/resource_aws_emr_instance_group_test.go Outdated Show resolved Hide resolved
aws/resource_aws_emr_instance_group_test.go Outdated Show resolved Hide resolved
aws/resource_aws_emr_instance_group_test.go Outdated Show resolved Hide resolved
website/docs/r/emr_instance_group.html.markdown Outdated Show resolved Hide resolved
@nywilken nywilken force-pushed the f-aws_emr_instance_group-refactor branch 2 times, most recently from eebadae to b2e7c25 Compare March 27, 2019 16:25
@nywilken
Copy link
Contributor Author

@bflad thanks for the thorough review. I went ahead and implemented the changes and suggestions you called out; making a bit of a refactor to consolidate logic into smaller non shared functions (speaking abut cluster and instance_group) and move things out of structure.go to start. I'll add a few more test and remove the WIP label from the title shortly.

@nywilken nywilken force-pushed the f-aws_emr_instance_group-refactor branch from b2e7c25 to afa5085 Compare April 16, 2019 15:21
@nywilken nywilken force-pushed the f-aws_emr_instance_group-refactor branch from afa5085 to 2af9859 Compare April 25, 2019 16:01
@nywilken nywilken changed the title [WIP] r/aws_emr_instance_group add support for non-task instance groups resource/aws_emr_instance_group add support for non-task instance groups Apr 26, 2019
@bflad
Copy link
Contributor

bflad commented May 13, 2019

@nywilken I just merged the aws_emr_cluster resource pull request. Ping me when this is ready for another review and I'll give it another lookover. 👍 If you have the bid price failure, I'd love to see the output. Thanks!

* Add resource import functionality
* Add ability to update AutoScalingPolicy
* Drop support for non TASK instance groups

```
=== RUN   TestAccAWSEMRInstanceGroup_basic
=== PAUSE TestAccAWSEMRInstanceGroup_basic
=== CONT  TestAccAWSEMRInstanceGroup_basic
=== RUN   TestAccAWSEMRInstanceGroup_updateAutoScalingPolicy
=== PAUSE TestAccAWSEMRInstanceGroup_updateAutoScalingPolicy
=== RUN   TestAccAWSEMRInstanceGroup_updateInstanceCount
=== PAUSE TestAccAWSEMRInstanceGroup_updateInstanceCount
=== CONT  TestAccAWSEMRInstanceGroup_updateAutoScalingPolicy
=== CONT  TestAccAWSEMRInstanceGroup_updateInstanceCount
--- PASS: TestAccAWSEMRInstanceGroup_basic (600.47s)
--- PASS: TestAccAWSEMRInstanceGroup_updateAutoScalingPolicy (634.61s)
--- PASS: TestAccAWSEMRInstanceGroup_updateInstanceCount (648.22s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws
648.229s

```
@nywilken nywilken force-pushed the f-aws_emr_instance_group-refactor branch from 2af9859 to 942a6bc Compare May 16, 2019 19:31
@nywilken nywilken changed the title resource/aws_emr_instance_group add support for non-task instance groups resource/aws_emr_instance_group autoscaling_policy and bid_price arguments May 16, 2019
@bflad bflad added the enhancement Requests to existing resources that expand the functionality or scope. label May 16, 2019
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Looks good! 🚀 Ready to ship with some very minor adjustments noted below.

Output from AWS Standard acceptance testing:

--- PASS: TestAccAWSEMRInstanceGroup_AutoScalingPolicy (556.16s)
--- PASS: TestAccAWSEMRInstanceGroup_updateAutoScalingPolicy (576.55s)
--- PASS: TestAccAWSEMRInstanceGroup_EbsConfig_EbsOptimized (582.51s)
--- PASS: TestAccAWSEMRInstanceGroup_updateInstanceCount (590.52s)
--- PASS: TestAccAWSEMRInstanceGroup_basic (591.16s)
--- PASS: TestAccAWSEMRInstanceGroup_BidPrice (598.07s)

aws/resource_aws_emr_instance_group.go Show resolved Hide resolved
aws/resource_aws_emr_instance_group.go Outdated Show resolved Hide resolved
aws/resource_aws_emr_instance_group.go Outdated Show resolved Hide resolved
aws/resource_aws_emr_instance_group.go Outdated Show resolved Hide resolved
aws/resource_aws_emr_instance_group.go Outdated Show resolved Hide resolved
aws/resource_aws_emr_instance_group_test.go Show resolved Hide resolved
website/docs/r/emr_instance_group.html.markdown Outdated Show resolved Hide resolved
@nywilken nywilken force-pushed the f-aws_emr_instance_group-refactor branch from b16c669 to be8a7d6 Compare May 16, 2019 21:22
@nywilken nywilken changed the title resource/aws_emr_instance_group autoscaling_policy and bid_price arguments resource/aws_emr_instance_group add autoscaling_policy and bid_price arguments, along with resource importing support May 16, 2019
@nywilken nywilken changed the title resource/aws_emr_instance_group add autoscaling_policy and bid_price arguments, along with resource importing support resource/aws_emr_instance_group: add autoscaling_policy and bid_price arguments, along with resource importing support May 17, 2019
@nywilken nywilken merged commit f586c65 into master May 17, 2019
@nywilken nywilken deleted the f-aws_emr_instance_group-refactor branch May 17, 2019 00:02
nywilken added a commit that referenced this pull request May 17, 2019
@bflad bflad added this to the v2.11.0 milestone May 17, 2019
@bflad
Copy link
Contributor

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.

@ghost
Copy link

ghost commented Mar 30, 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 30, 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/XL 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.

2 participants