tencent cloud

弹性伸缩

产品简介
产品概述
产品优势
应用场景
使用限制
访问管理
购买指南
快速入门
五分钟创建伸缩方案
步骤1:创建启动配置
步骤2:创建伸缩组
步骤3:创建伸缩策略
教程
创建 Web 服务
创建高性能计算集群
创建请求类服务器
配置高可用业务
启动配置
启动配置概述
创建启动配置
查看启动配置列表
更改启动配置
检测异常
伸缩组
伸缩组概述
创建伸缩组
查看伸缩组列表
修改伸缩组
修改伸缩组绑定的实例
将负载均衡与伸缩组结合
删除伸缩组
创建通知
创建伸缩活动通知
指定通知接收人
扩缩容
生命周期挂钩
管理定时任务
管理告警触发策略
实例健康检查
手动扩容
缩容处理
查看伸缩活动
暂停及恢复扩缩容
指定实例免于缩容
伸缩活动取消
伸缩活动失败
冷却时间说明
监控
监控告警指标
运行状态检查
定时任务
定时任务执行时间说明
故障处理
伸缩组失效
伸缩活动失败
实践教程
为伸缩组设置固定出口 IP
部署弹性 Web 应用服务
设置服务开机启动
客户案例
高性能计算:碳云数据挖掘
API 文档
History
Introduction
API Category
Making API Requests
Scaling Group APIs
Scaling Group Instances APIs
Launch Configuration APIs
Scheduled Action APIs
Alarm Trigger Policy APIs
Notification APIs
Lifecycle Hook APIs
Instance Refresh APIs
Other APIs
Data Types
Error Codes
常见问题
联系我们
词汇表

ModifyAutoScalingGroup

PDF
聚焦模式
字号
最后更新时间: 2026-03-26 22:22:53

1. API Description

Domain name for API request: as.intl.tencentcloudapi.com.

This API (ModifyAutoScalingGroup) is used to modify an auto scaling group.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: ModifyAutoScalingGroup.
Version Yes String Common Params. The value used for this API: 2018-04-19.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
AutoScalingGroupId Yes String

Scaling group ID. obtain available scaling group ids in the following ways:

  • query scaling group ids by logging in to the console.
  • obtain scaling group ids by calling the DescribeAutoScalingGroups api and retrieving AutoScalingGroupId from the returned information.
  • .
    AutoScalingGroupName No String

    The scaling group name must be unique in your account. name only supports chinese, english, digits, underscore, separator "-", and decimal point. the maximum length cannot exceed 55 bytes.

    .
    DefaultCooldown No Integer

    Default cooldown in seconds, value ranges from 0 to 3600, default value is 300.

    .
    DesiredCapacity No Integer

    Expected number of instances. value range [0,2000]. to meet the maximum value equal to or greater than the expected value, and the expected value equal to or greater than the minimum value.

    .
    LaunchConfigurationId No String

    Launch configuration ID. obtain available launch configuration ids in the following ways:

  • query the launch configuration ID by logging in to the console.
  • obtain the launch configuration ID by calling the DescribeLaunchConfigurations api and retrieving the LaunchConfigurationId from the returned information.
  • .
    MaxSize No Integer

    Maximum number of instances. value range: [0,2000]. to meet the requirement, the maximum value must be equal to or greater than the expected value, and the expected value must be equal to or greater than the minimum value.

    .
    MinSize No Integer

    Minimum number of instances. value range: [0,2000]. to meet the requirement, the maximum value must be equal to or greater than the expected value, and the expected value must be equal to or greater than the minimum value.

    .
    ProjectId No Integer

    Project ID. obtain this parameter by calling the ProjectId field in the return value of DescribeProject. default value is 0, indicating usage of the default project.

    .
    SubnetIds.N No Array of String

    subnet ID list. valid vpc subnet ids can be obtained by logging in to the console for querying. you can also call the API DescribeSubnets and retrieve them from the SubnetId field in the API response.

    .
    TerminationPolicies.N No Array of String

    Termination policy, whose maximum length is currently 1. valid values: OLDEST_INSTANCE and NEWEST_INSTANCE.

  • OLDEST_INSTANCE terminates the OLDEST INSTANCE in the scaling group first.
  • NEWEST_INSTANCE terminates the NEWEST INSTANCE in the scaling group first.
  • .
    VpcId No String

    vpc ID. when modifying the vpc, you need to change the SubnetIds parameter to the subnet of this vpc. effective VpcId can be queried by logging in to the console; you can also call the DescribeVpc api and get the VpcId field from the api response.

    .
    Zones.N No Array of String

    AZ list

    .
    RetryPolicy No String

    RETRY policy, whose valid values include IMMEDIATE_RETRY, INCREMENTAL_INTERVALS, and NO_RETRY, with the default value being IMMEDIATE_RETRY. a partially successful scaling operation is considered a failed activity.

  • IMMEDIATE_RETRY: RETRY immediately, attempting retries in rapid succession over a short period, and cease further retries after a certain number of consecutive failures (5 times).
  • INCREMENTAL_INTERVALS: INCREMENTAL interval RETRY, with the RETRY interval gradually increasing as the number of consecutive failures rises, ranging from seconds to 1 day.
  • NO_RETRY: NO RETRY until a user call or Alarm information is received again.
  • .
    ZonesCheckPolicy No String

    Availability Zone validation policy. valid values include ALL and ANY. default value: ANY. it is effective when scaling group actual change resource-related fields (launch configuration, az, subnet) are modified.

  • ALL: verification passes if ALL azs (Zone) or subnets (SubnetId) are available. otherwise, a verification error will be reported.
  • ANY: verification passes if ANY AZ (Zone) or subnet (SubnetId) is available. otherwise, a verification error will be reported.
  • common causes for unavailable azs or subnets include CVM instancetype sold out in the az, CBS cloud disk sold out in the az, insufficient quota in the az, or insufficient IP addresses in the subnet.

    if Zones/SubnetIds contain nonexistent azs or subnets, a verification error will be reported regardless of the values of ZonesCheckPolicy.

    .
    ServiceSettings No ServiceSettings

    Service settings, including cloud monitoring and unhealthy instance replacement.

    .
    Ipv6AddressCount No Integer

    The instance has a configuration for the number of IPv6 addresses. valid values include 0 and 1. the default value is 0, which means the instance does not allocate an IPv6 address. you need to use a VPC that supports IPv6 and enable IPv6 CIDR in the subnet.

    MultiZoneSubnetPolicy No String

    The multi-az/subnet policy, with values including PRIORITY and EQUALITY, defaults to PRIORITY.

  • PRIORITY: attempt to create instances taking the order of the az/subnet list as the PRIORITY. if instances can be successfully created in the az/subnet with the highest PRIORITY, they will always be created there.
  • EQUALITY: instances added through scale-out will be distributed across multiple azs/subnets to ensure A relatively balanced number of instances in each az/subnet after expansion.
  • points to consider:

  • when the scaling group is based on A classic network, this policy applies to multi-az. when the scaling group is based on A VPC network, this policy applies to multi-subnet, no longer considering AZ factors. for example, with four subnets labeled A, B, c, and D, where A, B, and c are in availability zone 1 and D is in availability zone 2, consider subnets A, B, c, and D for sorting, without considering availability zones 1 and 2.
  • this policy applies to multi-az/subnet but is not applicable to the instancetypes parameter of the launch configuration. selection of multiple models is according to PRIORITY policy.
  • when creating instances according to the PRIORITY policy, ensure the policy for multiple models first, then the policy for multi-az/subnet. for example, with multiple models A and B, and multiple subnets 1, 2, and 3, attempts will be made in the order A1, A2, A3, B1, B2, B3. if A1 is sold out, A2 will be attempted (not B1).
  • .
    HealthCheckType No String

    Scaling group instance health check type, values are as follows:

  • CVM: determine whether an instance is unhealthy based on its network status. an unhealthy network status refers to an event where instances become unreachable via PING. for detailed criteria of judgment, refer to instance health check.
  • CLB: determine whether an instance is unhealthy based on the health check status of CLB. for the principle of CLB health check, see health check.
  • .
    LoadBalancerHealthCheckGracePeriod No Integer

    Specifies the CLB health check grace period in seconds.

    value range: [0, 7200].

    default value: 0.

    InstanceAllocationPolicy No String

    Instance allocation policy. valid values include LAUNCH_CONFIGURATION and SPOT_MIXED.

  • LAUNCH_CONFIGURATION represents the traditional startup CONFIGURATION mode.
  • SPOT_MIXED represents the SPOT hybrid mode. currently only support hybrid mode when the LAUNCH CONFIGURATION uses pay-as-you-go billing mode. in hybrid mode, the scaling group will scale out based on the SPOT model. the billing type of the associated LAUNCH CONFIGURATION cannot be modified when using hybrid mode.
  • .
    SpotMixedAllocationPolicy No SpotMixedAllocationPolicy

    Allocation policy of instances for each billing type in SPOT hybrid mode.
    available only when InstanceAllocationPolicy is set to SPOT_MIXED.

    .
    CapacityRebalance No Boolean

    The capacity rebalancing feature is only applicable to spot instances within the scaling group. valid values:

  • TRUE: enable this feature. when spot instances within the scaling group are about to be automatically recycled by the spot instance service, AS initiates the termination process of spot instances. if a scale-in hook is configured, trigger before termination. after the termination process starts, AS asynchronously initiates scale-out to reach the expected number of instances.
  • FALSE: disable this feature. AS waits for the spot instance to be terminated before scaling out to reach the number of instances expected by the scaling group.
  • .
    InstanceNameIndexSettings No InstanceNameIndexSettings

    Instance name sequencing settings. once enabled, append incremental numeric sequence to the names of instances automatically created within the scaling group.

    .
    HostNameIndexSettings No HostNameIndexSettings

    Instance hostname sequencing settings. once enabled, append incremental numeric sequence to the hostname of instances automatically created within the scaling group.

    .
    ConcurrentScaleOutForDesiredCapacity No Boolean

    The concurrent scaling up functionality for matching expected numbers cannot be set when InstanceAllocationPolicy is in spot hybrid mode or when ScalingMode is in the scaling-prioritized startup mode. currently only two matching expected number scale-out activities are supported to run concurrently. other types of activities such as specified quantity scale-out or scale-in cannot be specified. set to FALSE indicates disabled.

    .

    3. Output Parameters

    Parameter Name Type Description
    RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

    4. Example

    Example1 Modifying the VPC subnet information of a scaling group

    This example shows you how to modify the VpcId and SubnetIds of the specific scaling group.

    Input Example

    POST / HTTP/1.1
    Host: as.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: ModifyAutoScalingGroup
    <Common request parameters>
    
    {
        "AutoScalingGroupId": "asg-ka0s0q80",
        "SubnetIds": [
            "subnet-b0vxjhot",
            "subnet-3tmerl37"
        ],
        "VpcId": "vpc-hy436tmc"
    }
    

    Output Example

    {
        "Response": {
            "RequestId": "c503ddc6-496c-44c9-8cec-e9f1c3f9c11c"
        }
    }
    

    Example2 Modifying the desired, maximum, and minimum capacity of a scaling group

    This example shows you how to modify the desired capacity of a scaling group to 3, the maximum capacity to 10, and the minimum capacity to 1.

    Input Example

    POST / HTTP/1.1
    Host: as.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: ModifyAutoScalingGroup
    <Common request parameters>
    
    {
        "AutoScalingGroupId": "asg-ka0s0q80",
        "MinSize": 1,
        "MaxSize": 10,
        "DesiredCapacity": 3
    }
    

    Output Example

    {
        "Response": {
            "RequestId": "b41d8d30-21d4-412c-b7f3-53041879968c"
        }
    }
    

    5. Developer Resources

    SDK

    TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

    Command Line Interface

    6. Error Code

    The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

    Error Code Description
    InternalError.CallVpcError VPC API call failed.
    InternalError.RequestError An internal request error occurred.
    InvalidParameter.ActionNotFound Invalid Action request.
    InvalidParameter.Conflict Multiple parameters specified conflict and cannot co-exist.
    InvalidParameter.InScenario The parameter is invalid in a specific scenario.
    InvalidParameterValue.AssertDesiredCapacityFailed The declared original expected instance number does not match the actual original expected instance number.
    InvalidParameterValue.BaseCapacityTooLarge The specified base capacity cannot exceed the max capacity.
    InvalidParameterValue.CvmError Exception with CVM parameter validation.
    InvalidParameterValue.DuplicatedSubnet Duplicated subnet.
    InvalidParameterValue.GroupNameDuplicated The auto scaling group name already exists.
    InvalidParameterValue.InvalidAutoScalingGroupId Invalid scaling group ID.
    InvalidParameterValue.InvalidLaunchConfigurationId Invalid launch configuration ID.
    InvalidParameterValue.InvalidSubnetId Invalid subnet ID.
    InvalidParameterValue.LaunchConfigurationNotFound The specified launch configuration was not found.
    InvalidParameterValue.LbProjectInconsistent The load balancer is in a different project.
    InvalidParameterValue.LimitExceeded The value exceeds the limit.
    InvalidParameterValue.OnlyVpc The account only supports VPCs.
    InvalidParameterValue.ProjectIdNotFound The project ID does not exist.
    InvalidParameterValue.Range The value is outside the specified range.
    InvalidParameterValue.Size The value of maximum, minimum, or desired number of instances in the auto scaling group is invalid.
    InvalidParameterValue.SubnetIds The subnet information is invalid.
    InvalidParameterValue.SubnetNotInDedicatedCluster The subnet is not in the designated local dedicated cluster.
    InvalidParameterValue.TooLong Too many values.
    LimitExceeded The quota limit is exceeded.
    LimitExceeded.MaxSizeLimitExceeded The maximum number of instances exceeds the limit.
    LimitExceeded.MinSizeLimitExceeded The minimum number of instances is below the limit.
    MissingParameter Parameter missing.
    MissingParameter.InScenario A parameter is missing in a specific scenario.
    ResourceNotFound.AutoScalingGroupNotFound The scaling group does not exist.
    ResourceUnavailable.ForbiddenModifyVpc You cannot modify the VPC of a scaling group bound with a load balancer.
    ResourceUnavailable.LaunchConfigurationStatusAbnormal The launch configuration is exceptional.
    ResourceUnavailable.ProjectInconsistent Project inconsistency.

    帮助和支持

    本页内容是否解决了您的问题?

    填写满意度调查问卷,共创更好文档体验。

    文档反馈