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

aws_emr_cluster Spot price natively set to 'Max (on-demand)' feature for more cost efficient and more secure Workload #7155

Open
dthauvin opened this issue Jan 16, 2019 · 4 comments
Labels
enhancement Requests to existing resources that expand the functionality or scope.

Comments

@dthauvin
Copy link

dthauvin commented Jan 16, 2019

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

The api EMR natively provided the way to set the maximum Spot price at On-demand price whenMarket parameter is set to SPOT and BidPrice at NULL.

This is really important when you pay attention to the price.

This feature allows us to assign the current price of the SPOT course and allows us to keep our emr workload up to the On-demand price.
This more cost efficient and more secure for your Workload .

This information is not in the aws APIreference but you can find it on boto3 documentation.

bidPrice EMR API-reference

boto3 EMR bidPrice and Market parameters

BidPrice (string) --
The maximum Spot price you are willing to pay for EC2 instances.

An optional, nullable field that applies if the MarketType for the instance group is specified as SPOT.
Specify the maximum spot price in USD.
If the value is NULL and SPOT is specified, the maximum Spot price is set equal to the On-Demand price.

Affected Resource(s)

  • aws_emr_cluster

Potential Terraform Configuration

We can add a new parameter like Market which can take two value : ON_DEMAND | SPOT
bid_price parameter if set to blank send a null value in the API payload .

  instance_group {
    instance_role  = "CORE"
    instance_type  = "c4.large"
    instance_count = "1"
    ebs_config {
      size                 = "40"
      type                 = "gp2"
      volumes_per_instance = 1
    }
    market              = "SPOT | ON-DEMAND"
    bid_price          = ""
}

Actual CODE

terraform-provider-aws/aws/resource_aws_emr_cluster.go

unc expandBidPrice(config *emr.InstanceGroupConfig, configAttributes map[string]interface{}) {
	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")
		}
	}
}

Screen

capture d ecran 2019-01-16 a 11 51 18

info wrong in Docs

Info about biprice on Master Instance group is wrong
Actually i can bid on Master Instance group

bid_price - (Optional) If set, the bid price for each EC2 instance in the instance group, expressed in USD.
By setting this attribute, the instance group is being declared as a Spot Instance, and will implicitly create a Spot request. 
Leave this blank to use On-Demand Instances.
bid_price can not be set for the MASTER instance group, since that group must always be On-Demand
@dthauvin dthauvin added the enhancement Requests to existing resources that expand the functionality or scope. label Jan 16, 2019
@dthauvin dthauvin changed the title aws_emr_cluster Spot price natively set to 'Max (on-demand)' feature for more cost efficient and more Workload aws_emr_cluster Spot price natively set to 'Max (on-demand)' feature for more cost efficient and more secure Workload Jan 17, 2019
@zeako
Copy link

zeako commented Apr 21, 2019

Any update regarding this issue?
seems like a minor change

@realvictorprm
Copy link

same question here

@karannnn-exe
Copy link

Any updated on this?

@karannnn-exe
Copy link

bid_price = "OnDemandPrice"
I used this parameter to use_on_demand_as_max_price. But it failed
Error: ValidationException: The bid price is invalid. Revise the configuration and resubmit.
│ status code: 400, request id: c07e612b-fd9d-4324-a9ab-522276c0cee8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Requests to existing resources that expand the functionality or scope.
Projects
None yet
4 participants