-
Notifications
You must be signed in to change notification settings - Fork 564
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/alicloud_ess_scaling_group: add attributes of compensate_with_on_demand, capacity_options_on_demand_base_capacity, capacity_options_on_demand_percentage_above_base_capacity, capacity_options_compensate_with_on_demand and capacity_options_spot_auto_replace_on_demand. #8320
base: master
Are you sure you want to change the base?
Conversation
1f238b3
to
367a36e
Compare
@@ -140,6 +140,11 @@ The following arguments are supported: | |||
* `spot_allocation_strategy` - (Optional, Available since v1.225.1) The allocation policy of preemptible instances. You can use this parameter to individually specify the allocation policy for preemptible instances. This parameter takes effect only if you set MultiAZPolicy to COMPOSABLE. | |||
* `allocation_strategy` - (Optional, Available since v1.225.1) The allocation policy of instances. Auto Scaling selects instance types based on the allocation policy to create instances. The policy can be applied to pay-as-you-go instances and preemptible instances. This parameter takes effect only if you set MultiAZPolicy to COMPOSABLE. | |||
* `on_demand_base_capacity` - (Optional, Available since v1.54.0) The minimum amount of the Auto Scaling group's capacity that must be fulfilled by On-Demand Instances. This base portion is provisioned first as your group scales. | |||
* `compensate_with_on_demand` - (Optional, Available since v1.243.0) Specifies whether to automatically create pay-as-you-go instances to meet the requirement on the number of ECS instances when the expected capacity of preemptible instances cannot be provided due to reasons such as cost-related issues and insufficient resources. This parameter is supported only if you set MultiAZPolicy to COST_OPTIMIZED. Valid values: true, false. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1.244.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
367a36e
to
cadadd6
Compare
@@ -186,6 +186,33 @@ func resourceAlicloudEssScalingGroup() *schema.Resource { | |||
Optional: true, | |||
Computed: true, | |||
}, | |||
"compensate_with_on_demand": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compensate_with_on_demand,capacity_options_compensate_with_on_demand,capacity_options_spot_auto_replace_on_demand这三个bool类型的字段默认值都是true吗?capacity_options_on_demand_base_capacity和capacity_options_on_demand_percentage_above_base_capacity的默认值是非0的吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ompensate_with_on_demand,capacity_options_compensate_with_on_demand,capacity_options_spot_auto_replace_on_demand这三个bool类型的字段默认值都是true吗? 不是 某些情况用户没有设置,对应的属性,在后端服务是不会被设置上值的
capacity_options_on_demand_base_capacity和capacity_options_on_demand_percentage_above_base_capacity的默认值是非0的吗?
不是,不同情况,默认值不同
@@ -540,10 +585,30 @@ func resourceAliyunEssScalingGroupUpdate(d *schema.ResourceData, meta interface{ | |||
request["SpotInstancePools"] = requests.NewInteger(d.Get("spot_instance_pools").(int)) | |||
} | |||
|
|||
if d.HasChange("capacity_options_on_demand_base_capacity") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
之前说过很多次,针对bool和int类型的字段,不要用d.Get直接获取,要用d.GetOkExists判断获取,改!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -765,10 +830,30 @@ func buildAlicloudEssScalingGroupArgs(d *schema.ResourceData, meta interface{}) | |||
request["SpotInstancePools"] = v | |||
} | |||
|
|||
if v, ok := d.GetOk("capacity_options_on_demand_base_capacity"); ok { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -984,6 +992,227 @@ func TestAccAliCloudEssScalingGroup_costoptimized(t *testing.T) { | |||
|
|||
} | |||
|
|||
func TestAccAliCloudEssScalingGroup_costoptimized_capacityOptions(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compensate_with_on_demand缺少第0步,也就是只有创建操作设置的单测。capacity_options_compensate_with_on_demand,capacity_options_spot_auto_replace_on_demand,capacity_options_on_demand_base_capacity和capacity_options_on_demand_percentage_above_base_capacity缺少第0步不设置,只在更新操作设置的单测
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -140,6 +140,11 @@ The following arguments are supported: | |||
* `spot_allocation_strategy` - (Optional, Available since v1.225.1) The allocation policy of preemptible instances. You can use this parameter to individually specify the allocation policy for preemptible instances. This parameter takes effect only if you set MultiAZPolicy to COMPOSABLE. | |||
* `allocation_strategy` - (Optional, Available since v1.225.1) The allocation policy of instances. Auto Scaling selects instance types based on the allocation policy to create instances. The policy can be applied to pay-as-you-go instances and preemptible instances. This parameter takes effect only if you set MultiAZPolicy to COMPOSABLE. | |||
* `on_demand_base_capacity` - (Optional, Available since v1.54.0) The minimum amount of the Auto Scaling group's capacity that must be fulfilled by On-Demand Instances. This base portion is provisioned first as your group scales. | |||
* `compensate_with_on_demand` - (Optional, Available since v1.244.0) Specifies whether to automatically create pay-as-you-go instances to meet the requirement on the number of ECS instances when the expected capacity of preemptible instances cannot be provided due to reasons such as cost-related issues and insufficient resources. This parameter is supported only if you set MultiAZPolicy to COST_OPTIMIZED. Valid values: true, false. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个资源里面有字段名字是MultiAZPolicy的吗?改成tf中的字段名,用单引号着重显示。下面几个字段都一样,改
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
…h_on_demand, capacity_options_on_demand_base_capacity, capacity_options_on_demand_percentage_above_base_capacity, capacity_options_compensate_with_on_demand and capacity_options_spot_auto_replace_on_demand.
cadadd6
to
7df94b2
Compare
resource/alicloud_ess_scaling_group: add attributes of compensate_with_on_demand, capacity_options_on_demand_base_capacity, capacity_options_on_demand_percentage_above_base_capacity, capacity_options_compensate_with_on_demand and capacity_options_spot_auto_replace_on_demand.