'Unable to launch Spot instance fleet in EMR cluster using terraform Module
I am trying to create an EMR cluster with, with instance fleet. I have mentioned bid_price, it was giving me error as below so did try with mentioning bid_price_as_percentage_of_on_demand_price. Tried without specifying both options as well, still somehow, it's erroring out with same details everytime -
│ Error: error running EMR Job Flow: ValidationException: Specify at most one of bidPrice or bidPriceAsPercentageOfOnDemandPrice value for the Spot Instance fleet : request.
│ status code: 400, request id: c6bfea8e-e596-43ac-a504-203dbf122d5f
This is my core instance fleet block from terraform module-
core_instance_fleet {
dynamic "instance_type_configs" {
for_each = var.instance_type_configs_core
content {
bid_price = instance_type_configs.value.bid_price
bid_price_as_percentage_of_on_demand_price = instance_type_configs.value.bid_price_as_percentage_of_on_demand_price
instance_type = instance_type_configs.value.instance_type
weighted_capacity = instance_type_configs.value.weighted_capacity
ebs_config {
size = var.ebs_core_size
type = var.ebs_core_type
volumes_per_instance = var.ebs_volumes_per_instance_core
}
}
}
launch_specifications {
spot_specification {
allocation_strategy = var.allocation_strategy_spotInstance
timeout_action = var.timeout_action
timeout_duration_minutes = var.timeout_duration_minutes
}
}
name = var.emr_core_node
target_spot_capacity = var.target_on_spot_capacity_core
}
my terraform.vars-
instance_type_configs_core = {
"one" = {
bid_price = "3"
#bid_price_as_percentage_of_on_demand_price = "0"
instance_type = "c5.xlarge"
weighted_capacity = "1"
},
"two" = {
bid_price = "3"
#bid_price_as_percentage_of_on_demand_price = "100"
instance_type = "c4.xlarge"
weighted_capacity = "1"
}
}
terraform -v
Terraform v1.1.4
on darwin_amd64
provider registry.terraform.io/hashicorp/aws v3.73.0
So not sure where I am going wrong. Any suggestion would be appreciated. Thanks!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
