diff --git a/alicloud/data_source_alicloud_ess_scalinggroups.go b/alicloud/data_source_alicloud_ess_scalinggroups.go index c0b93efc199e..e739fda6247b 100644 --- a/alicloud/data_source_alicloud_ess_scalinggroups.go +++ b/alicloud/data_source_alicloud_ess_scalinggroups.go @@ -76,6 +76,10 @@ func dataSourceAlicloudEssScalingGroups() *schema.Resource { Type: schema.TypeInt, Computed: true, }, + "stop_instance_timeout": { + Type: schema.TypeInt, + Computed: true, + }, "cooldown_time": { Type: schema.TypeInt, Computed: true, @@ -265,6 +269,7 @@ func scalingGroupsDescriptionAttribute(d *schema.ResourceData, scalingGroups []i "min_size": object["MinSize"], "max_size": object["MaxSize"], "cooldown_time": object["DefaultCooldown"], + "stop_instance_timeout": object["StopInstanceTimeout"], "lifecycle_state": object["LifecycleState"], "total_capacity": object["TotalCapacity"], "active_capacity": object["ActiveCapacity"], diff --git a/alicloud/data_source_alicloud_ess_scalinggroups_test.go b/alicloud/data_source_alicloud_ess_scalinggroups_test.go index 9aa59850abec..8e69c9a739e7 100644 --- a/alicloud/data_source_alicloud_ess_scalinggroups_test.go +++ b/alicloud/data_source_alicloud_ess_scalinggroups_test.go @@ -8,32 +8,32 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" ) -func TestAccAlicloudEssScalingGroupsDataSource(t *testing.T) { +func TestAccAliCloudEssScalingGroupsDataSource(t *testing.T) { rand := acctest.RandInt() nameRegexConf := dataSourceTestAccConfig{ - existConfig: testAccCheckAlicloudEssScalinggroupsDataSourceConfig(rand, map[string]string{ + existConfig: testAccCheckAliCloudEssScalinggroupsDataSourceConfig(rand, map[string]string{ "name_regex": `"${alicloud_ess_scaling_group.default.scaling_group_name}"`, }), - fakeConfig: testAccCheckAlicloudEssScalinggroupsDataSourceConfig(rand, map[string]string{ + fakeConfig: testAccCheckAliCloudEssScalinggroupsDataSourceConfig(rand, map[string]string{ "name_regex": `"${alicloud_ess_scaling_group.default.scaling_group_name}_fake"`, }), } idsConf := dataSourceTestAccConfig{ - existConfig: testAccCheckAlicloudEssScalinggroupsDataSourceConfig(rand, map[string]string{ + existConfig: testAccCheckAliCloudEssScalinggroupsDataSourceConfig(rand, map[string]string{ "ids": `["${alicloud_ess_scaling_group.default.id}"]`, }), - fakeConfig: testAccCheckAlicloudEssScalinggroupsDataSourceConfig(rand, map[string]string{ + fakeConfig: testAccCheckAliCloudEssScalinggroupsDataSourceConfig(rand, map[string]string{ "ids": `["${alicloud_ess_scaling_group.default.id}_fake"]`, }), } allConf := dataSourceTestAccConfig{ - existConfig: testAccCheckAlicloudEssScalinggroupsDataSourceConfig(rand, map[string]string{ + existConfig: testAccCheckAliCloudEssScalinggroupsDataSourceConfig(rand, map[string]string{ "ids": `["${alicloud_ess_scaling_group.default.id}"]`, "name_regex": `"${alicloud_ess_scaling_group.default.scaling_group_name}"`, }), - fakeConfig: testAccCheckAlicloudEssScalinggroupsDataSourceConfig(rand, map[string]string{ + fakeConfig: testAccCheckAliCloudEssScalinggroupsDataSourceConfig(rand, map[string]string{ "ids": `["${alicloud_ess_scaling_group.default.id}_fake"]`, "name_regex": `"${alicloud_ess_scaling_group.default.scaling_group_name}"`, }), @@ -50,6 +50,7 @@ func TestAccAlicloudEssScalingGroupsDataSource(t *testing.T) { "groups.0.min_size": "0", "groups.0.max_size": "2", "groups.0.cooldown_time": "20", + "groups.0.stop_instance_timeout": "30", "groups.0.removal_policies.#": "2", "groups.0.removal_policies.0": "OldestInstance", "groups.0.removal_policies.1": "NewestInstance", @@ -90,7 +91,7 @@ func TestAccAlicloudEssScalingGroupsDataSource(t *testing.T) { essScalingGroupsCheckInfo.dataSourceTestCheck(t, rand, nameRegexConf, idsConf, allConf) } -func testAccCheckAlicloudEssScalinggroupsDataSourceConfig(rand int, attrMap map[string]string) string { +func testAccCheckAliCloudEssScalinggroupsDataSourceConfig(rand int, attrMap map[string]string) string { var pairs []string for k, v := range attrMap { pairs = append(pairs, k+" = "+v) @@ -110,6 +111,7 @@ resource "alicloud_ess_scaling_group" "default" { default_cooldown = 20 removal_policies = ["OldestInstance", "NewestInstance"] vswitch_ids = ["${alicloud_vswitch.default.id}"] + stop_instance_timeout = 30 tags = {"key": "value"} } diff --git a/website/docs/d/ess_scaling_groups.html.markdown b/website/docs/d/ess_scaling_groups.html.markdown index e7b88f8823c9..42a1cc2792ee 100644 --- a/website/docs/d/ess_scaling_groups.html.markdown +++ b/website/docs/d/ess_scaling_groups.html.markdown @@ -66,5 +66,7 @@ The following attributes are exported in addition to the arguments listed above: * `removing_capacity` - Number of removing instances in scaling group. * `creation_time` - Creation time of scaling group. * `tags` - A mapping of tags to assign to the resource. + * `stop_instance_timeout` - (Optional, Available since v1.241.0) The period of time required by the ECS instance to enter the Stopped state. Unit: seconds. Valid values: 30 to 240. +