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

Enable EMR cluster configuration through the InstanceGroup param #1071

Merged
merged 6 commits into from
Aug 24, 2017
Prev Previous commit
Next Next commit
Pass bid_price to the InstanceGroup
apetresc committed Jul 10, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit f60b3341fbdd1b6f8a6d3eb5c6b3abd8e9f1b5da
11 changes: 10 additions & 1 deletion aws/resource_aws_emr_cluster.go
Original file line number Diff line number Diff line change
@@ -132,6 +132,7 @@ func resourceAwsEMRCluster() *schema.Resource {
"bid_price": {
Type: schema.TypeString,
Optional: true,
Required: false,
},
"ebs_config": {
Type: schema.TypeSet,
@@ -830,8 +831,16 @@ func expandInstanceGroupConfigs(instanceGroupConfigs []interface{}) []*emr.Insta
InstanceCount: aws.Int64(int64(configInstanceCount)),
}

if bidPrice, ok := configAttributes["bid_price"]; ok {
if bidPrice != "" {
config.BidPrice = aws.String(bidPrice.(string))
config.Market = aws.String("SPOT")
} else {
config.Market = aws.String("ON_DEMAND")
}
}

if rawEbsConfigs, ok := configAttributes["ebs_config"]; ok {
//ebsConfig := readEmrEBSConfig(raw.(schema.ResourceData))
ebsConfig := &emr.EbsConfiguration{}

ebsBlockDeviceConfigs := make([]*emr.EbsBlockDeviceConfig, 0)