1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. AsScalingGroup
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.AsScalingGroup

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    Provides a resource to create a group of AS (Auto scaling) instances.

    NOTE: If the resource management rule forward_balancer_id is used, resource tencentcloud.AsLoadBalancer management cannot be used simultaneously under the same auto scaling group id

    Example Usage

    Create a basic Scaling Group

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const zones = tencentcloud.getAvailabilityZonesByProduct({
        product: "as",
    });
    const image = tencentcloud.getImages({
        imageTypes: ["PUBLIC_IMAGE"],
        osName: "TencentOS Server 3.2 (Final)",
    });
    const vpc = new tencentcloud.Vpc("vpc", {cidrBlock: "10.0.0.0/16"});
    const subnet = new tencentcloud.Subnet("subnet", {
        vpcId: vpc.vpcId,
        cidrBlock: "10.0.0.0/16",
        availabilityZone: zones.then(zones => zones.zones?.[0]?.name),
    });
    const exampleAsScalingConfig = new tencentcloud.AsScalingConfig("exampleAsScalingConfig", {
        configurationName: "tf-example",
        imageId: image.then(image => image.images?.[0]?.imageId),
        instanceTypes: [
            "SA1.SMALL1",
            "SA2.SMALL1",
            "SA2.SMALL2",
            "SA2.SMALL4",
        ],
        instanceNameSettings: {
            instanceName: "test-ins-name",
        },
    });
    const exampleAsScalingGroup = new tencentcloud.AsScalingGroup("exampleAsScalingGroup", {
        scalingGroupName: "tf-example",
        configurationId: exampleAsScalingConfig.asScalingConfigId,
        maxSize: 1,
        minSize: 0,
        vpcId: vpc.vpcId,
        subnetIds: [subnet.subnetId],
        healthCheckType: "CLB",
        replaceLoadBalancerUnhealthy: true,
        lbHealthCheckGracePeriod: 30,
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    zones = tencentcloud.get_availability_zones_by_product(product="as")
    image = tencentcloud.get_images(image_types=["PUBLIC_IMAGE"],
        os_name="TencentOS Server 3.2 (Final)")
    vpc = tencentcloud.Vpc("vpc", cidr_block="10.0.0.0/16")
    subnet = tencentcloud.Subnet("subnet",
        vpc_id=vpc.vpc_id,
        cidr_block="10.0.0.0/16",
        availability_zone=zones.zones[0].name)
    example_as_scaling_config = tencentcloud.AsScalingConfig("exampleAsScalingConfig",
        configuration_name="tf-example",
        image_id=image.images[0].image_id,
        instance_types=[
            "SA1.SMALL1",
            "SA2.SMALL1",
            "SA2.SMALL2",
            "SA2.SMALL4",
        ],
        instance_name_settings={
            "instance_name": "test-ins-name",
        })
    example_as_scaling_group = tencentcloud.AsScalingGroup("exampleAsScalingGroup",
        scaling_group_name="tf-example",
        configuration_id=example_as_scaling_config.as_scaling_config_id,
        max_size=1,
        min_size=0,
        vpc_id=vpc.vpc_id,
        subnet_ids=[subnet.subnet_id],
        health_check_type="CLB",
        replace_load_balancer_unhealthy=True,
        lb_health_check_grace_period=30)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		zones, err := tencentcloud.GetAvailabilityZonesByProduct(ctx, &tencentcloud.GetAvailabilityZonesByProductArgs{
    			Product: "as",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		image, err := tencentcloud.GetImages(ctx, &tencentcloud.GetImagesArgs{
    			ImageTypes: []string{
    				"PUBLIC_IMAGE",
    			},
    			OsName: pulumi.StringRef("TencentOS Server 3.2 (Final)"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		vpc, err := tencentcloud.NewVpc(ctx, "vpc", &tencentcloud.VpcArgs{
    			CidrBlock: pulumi.String("10.0.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		subnet, err := tencentcloud.NewSubnet(ctx, "subnet", &tencentcloud.SubnetArgs{
    			VpcId:            vpc.VpcId,
    			CidrBlock:        pulumi.String("10.0.0.0/16"),
    			AvailabilityZone: pulumi.String(zones.Zones[0].Name),
    		})
    		if err != nil {
    			return err
    		}
    		exampleAsScalingConfig, err := tencentcloud.NewAsScalingConfig(ctx, "exampleAsScalingConfig", &tencentcloud.AsScalingConfigArgs{
    			ConfigurationName: pulumi.String("tf-example"),
    			ImageId:           pulumi.String(image.Images[0].ImageId),
    			InstanceTypes: pulumi.StringArray{
    				pulumi.String("SA1.SMALL1"),
    				pulumi.String("SA2.SMALL1"),
    				pulumi.String("SA2.SMALL2"),
    				pulumi.String("SA2.SMALL4"),
    			},
    			InstanceNameSettings: &tencentcloud.AsScalingConfigInstanceNameSettingsArgs{
    				InstanceName: pulumi.String("test-ins-name"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = tencentcloud.NewAsScalingGroup(ctx, "exampleAsScalingGroup", &tencentcloud.AsScalingGroupArgs{
    			ScalingGroupName: pulumi.String("tf-example"),
    			ConfigurationId:  exampleAsScalingConfig.AsScalingConfigId,
    			MaxSize:          pulumi.Float64(1),
    			MinSize:          pulumi.Float64(0),
    			VpcId:            vpc.VpcId,
    			SubnetIds: pulumi.StringArray{
    				subnet.SubnetId,
    			},
    			HealthCheckType:              pulumi.String("CLB"),
    			ReplaceLoadBalancerUnhealthy: pulumi.Bool(true),
    			LbHealthCheckGracePeriod:     pulumi.Float64(30),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var zones = Tencentcloud.GetAvailabilityZonesByProduct.Invoke(new()
        {
            Product = "as",
        });
    
        var image = Tencentcloud.GetImages.Invoke(new()
        {
            ImageTypes = new[]
            {
                "PUBLIC_IMAGE",
            },
            OsName = "TencentOS Server 3.2 (Final)",
        });
    
        var vpc = new Tencentcloud.Vpc("vpc", new()
        {
            CidrBlock = "10.0.0.0/16",
        });
    
        var subnet = new Tencentcloud.Subnet("subnet", new()
        {
            VpcId = vpc.VpcId,
            CidrBlock = "10.0.0.0/16",
            AvailabilityZone = zones.Apply(getAvailabilityZonesByProductResult => getAvailabilityZonesByProductResult.Zones[0]?.Name),
        });
    
        var exampleAsScalingConfig = new Tencentcloud.AsScalingConfig("exampleAsScalingConfig", new()
        {
            ConfigurationName = "tf-example",
            ImageId = image.Apply(getImagesResult => getImagesResult.Images[0]?.ImageId),
            InstanceTypes = new[]
            {
                "SA1.SMALL1",
                "SA2.SMALL1",
                "SA2.SMALL2",
                "SA2.SMALL4",
            },
            InstanceNameSettings = new Tencentcloud.Inputs.AsScalingConfigInstanceNameSettingsArgs
            {
                InstanceName = "test-ins-name",
            },
        });
    
        var exampleAsScalingGroup = new Tencentcloud.AsScalingGroup("exampleAsScalingGroup", new()
        {
            ScalingGroupName = "tf-example",
            ConfigurationId = exampleAsScalingConfig.AsScalingConfigId,
            MaxSize = 1,
            MinSize = 0,
            VpcId = vpc.VpcId,
            SubnetIds = new[]
            {
                subnet.SubnetId,
            },
            HealthCheckType = "CLB",
            ReplaceLoadBalancerUnhealthy = true,
            LbHealthCheckGracePeriod = 30,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.TencentcloudFunctions;
    import com.pulumi.tencentcloud.inputs.GetAvailabilityZonesByProductArgs;
    import com.pulumi.tencentcloud.inputs.GetImagesArgs;
    import com.pulumi.tencentcloud.Vpc;
    import com.pulumi.tencentcloud.VpcArgs;
    import com.pulumi.tencentcloud.Subnet;
    import com.pulumi.tencentcloud.SubnetArgs;
    import com.pulumi.tencentcloud.AsScalingConfig;
    import com.pulumi.tencentcloud.AsScalingConfigArgs;
    import com.pulumi.tencentcloud.inputs.AsScalingConfigInstanceNameSettingsArgs;
    import com.pulumi.tencentcloud.AsScalingGroup;
    import com.pulumi.tencentcloud.AsScalingGroupArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var zones = TencentcloudFunctions.getAvailabilityZonesByProduct(GetAvailabilityZonesByProductArgs.builder()
                .product("as")
                .build());
    
            final var image = TencentcloudFunctions.getImages(GetImagesArgs.builder()
                .imageTypes("PUBLIC_IMAGE")
                .osName("TencentOS Server 3.2 (Final)")
                .build());
    
            var vpc = new Vpc("vpc", VpcArgs.builder()
                .cidrBlock("10.0.0.0/16")
                .build());
    
            var subnet = new Subnet("subnet", SubnetArgs.builder()
                .vpcId(vpc.vpcId())
                .cidrBlock("10.0.0.0/16")
                .availabilityZone(zones.applyValue(getAvailabilityZonesByProductResult -> getAvailabilityZonesByProductResult.zones()[0].name()))
                .build());
    
            var exampleAsScalingConfig = new AsScalingConfig("exampleAsScalingConfig", AsScalingConfigArgs.builder()
                .configurationName("tf-example")
                .imageId(image.applyValue(getImagesResult -> getImagesResult.images()[0].imageId()))
                .instanceTypes(            
                    "SA1.SMALL1",
                    "SA2.SMALL1",
                    "SA2.SMALL2",
                    "SA2.SMALL4")
                .instanceNameSettings(AsScalingConfigInstanceNameSettingsArgs.builder()
                    .instanceName("test-ins-name")
                    .build())
                .build());
    
            var exampleAsScalingGroup = new AsScalingGroup("exampleAsScalingGroup", AsScalingGroupArgs.builder()
                .scalingGroupName("tf-example")
                .configurationId(exampleAsScalingConfig.asScalingConfigId())
                .maxSize(1)
                .minSize(0)
                .vpcId(vpc.vpcId())
                .subnetIds(subnet.subnetId())
                .healthCheckType("CLB")
                .replaceLoadBalancerUnhealthy(true)
                .lbHealthCheckGracePeriod(30)
                .build());
    
        }
    }
    
    resources:
      vpc:
        type: tencentcloud:Vpc
        properties:
          cidrBlock: 10.0.0.0/16
      subnet:
        type: tencentcloud:Subnet
        properties:
          vpcId: ${vpc.vpcId}
          cidrBlock: 10.0.0.0/16
          availabilityZone: ${zones.zones[0].name}
      exampleAsScalingConfig:
        type: tencentcloud:AsScalingConfig
        properties:
          configurationName: tf-example
          imageId: ${image.images[0].imageId}
          instanceTypes:
            - SA1.SMALL1
            - SA2.SMALL1
            - SA2.SMALL2
            - SA2.SMALL4
          instanceNameSettings:
            instanceName: test-ins-name
      exampleAsScalingGroup:
        type: tencentcloud:AsScalingGroup
        properties:
          scalingGroupName: tf-example
          configurationId: ${exampleAsScalingConfig.asScalingConfigId}
          maxSize: 1
          minSize: 0
          vpcId: ${vpc.vpcId}
          subnetIds:
            - ${subnet.subnetId}
          healthCheckType: CLB
          replaceLoadBalancerUnhealthy: true
          lbHealthCheckGracePeriod: 30
    variables:
      zones:
        fn::invoke:
          function: tencentcloud:getAvailabilityZonesByProduct
          arguments:
            product: as
      image:
        fn::invoke:
          function: tencentcloud:getImages
          arguments:
            imageTypes:
              - PUBLIC_IMAGE
            osName: TencentOS Server 3.2 (Final)
    

    Create a complete Scaling Group

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const exampleClbInstance = new tencentcloud.ClbInstance("exampleClbInstance", {
        networkType: "INTERNAL",
        clbName: "clb-example",
        projectId: 0,
        vpcId: tencentcloud_vpc.vpc.id,
        subnetId: tencentcloud_subnet.subnet.id,
        tags: {
            test: "tf",
        },
    });
    const exampleClbListener = new tencentcloud.ClbListener("exampleClbListener", {
        clbId: exampleClbInstance.clbInstanceId,
        listenerName: "listener-example",
        port: 80,
        protocol: "HTTP",
    });
    const exampleClbListenerRule = new tencentcloud.ClbListenerRule("exampleClbListenerRule", {
        listenerId: exampleClbListener.listenerId,
        clbId: exampleClbInstance.clbInstanceId,
        domain: "foo.net",
        url: "/bar",
    });
    const exampleAsScalingGroup = new tencentcloud.AsScalingGroup("exampleAsScalingGroup", {
        scalingGroupName: "tf-example",
        configurationId: tencentcloud_as_scaling_config.example.id,
        maxSize: 1,
        minSize: 0,
        vpcId: tencentcloud_vpc.vpc.id,
        subnetIds: [tencentcloud_subnet.subnet.id],
        projectId: 0,
        defaultCooldown: 400,
        desiredCapacity: 1,
        replaceMonitorUnhealthy: false,
        scalingMode: "CLASSIC_SCALING",
        replaceLoadBalancerUnhealthy: false,
        replaceMode: "RECREATE",
        desiredCapacitySyncWithMaxMinSize: false,
        terminationPolicies: ["NEWEST_INSTANCE"],
        retryPolicy: "INCREMENTAL_INTERVALS",
        forwardBalancerIds: [{
            loadBalancerId: exampleClbInstance.clbInstanceId,
            listenerId: exampleClbListener.listenerId,
            ruleId: exampleClbListenerRule.ruleId,
            targetAttributes: [{
                port: 80,
                weight: 90,
            }],
        }],
        tags: {
            createBy: "tfExample",
        },
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example_clb_instance = tencentcloud.ClbInstance("exampleClbInstance",
        network_type="INTERNAL",
        clb_name="clb-example",
        project_id=0,
        vpc_id=tencentcloud_vpc["vpc"]["id"],
        subnet_id=tencentcloud_subnet["subnet"]["id"],
        tags={
            "test": "tf",
        })
    example_clb_listener = tencentcloud.ClbListener("exampleClbListener",
        clb_id=example_clb_instance.clb_instance_id,
        listener_name="listener-example",
        port=80,
        protocol="HTTP")
    example_clb_listener_rule = tencentcloud.ClbListenerRule("exampleClbListenerRule",
        listener_id=example_clb_listener.listener_id,
        clb_id=example_clb_instance.clb_instance_id,
        domain="foo.net",
        url="/bar")
    example_as_scaling_group = tencentcloud.AsScalingGroup("exampleAsScalingGroup",
        scaling_group_name="tf-example",
        configuration_id=tencentcloud_as_scaling_config["example"]["id"],
        max_size=1,
        min_size=0,
        vpc_id=tencentcloud_vpc["vpc"]["id"],
        subnet_ids=[tencentcloud_subnet["subnet"]["id"]],
        project_id=0,
        default_cooldown=400,
        desired_capacity=1,
        replace_monitor_unhealthy=False,
        scaling_mode="CLASSIC_SCALING",
        replace_load_balancer_unhealthy=False,
        replace_mode="RECREATE",
        desired_capacity_sync_with_max_min_size=False,
        termination_policies=["NEWEST_INSTANCE"],
        retry_policy="INCREMENTAL_INTERVALS",
        forward_balancer_ids=[{
            "load_balancer_id": example_clb_instance.clb_instance_id,
            "listener_id": example_clb_listener.listener_id,
            "rule_id": example_clb_listener_rule.rule_id,
            "target_attributes": [{
                "port": 80,
                "weight": 90,
            }],
        }],
        tags={
            "createBy": "tfExample",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		exampleClbInstance, err := tencentcloud.NewClbInstance(ctx, "exampleClbInstance", &tencentcloud.ClbInstanceArgs{
    			NetworkType: pulumi.String("INTERNAL"),
    			ClbName:     pulumi.String("clb-example"),
    			ProjectId:   pulumi.Float64(0),
    			VpcId:       pulumi.Any(tencentcloud_vpc.Vpc.Id),
    			SubnetId:    pulumi.Any(tencentcloud_subnet.Subnet.Id),
    			Tags: pulumi.StringMap{
    				"test": pulumi.String("tf"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		exampleClbListener, err := tencentcloud.NewClbListener(ctx, "exampleClbListener", &tencentcloud.ClbListenerArgs{
    			ClbId:        exampleClbInstance.ClbInstanceId,
    			ListenerName: pulumi.String("listener-example"),
    			Port:         pulumi.Float64(80),
    			Protocol:     pulumi.String("HTTP"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleClbListenerRule, err := tencentcloud.NewClbListenerRule(ctx, "exampleClbListenerRule", &tencentcloud.ClbListenerRuleArgs{
    			ListenerId: exampleClbListener.ListenerId,
    			ClbId:      exampleClbInstance.ClbInstanceId,
    			Domain:     pulumi.String("foo.net"),
    			Url:        pulumi.String("/bar"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = tencentcloud.NewAsScalingGroup(ctx, "exampleAsScalingGroup", &tencentcloud.AsScalingGroupArgs{
    			ScalingGroupName: pulumi.String("tf-example"),
    			ConfigurationId:  pulumi.Any(tencentcloud_as_scaling_config.Example.Id),
    			MaxSize:          pulumi.Float64(1),
    			MinSize:          pulumi.Float64(0),
    			VpcId:            pulumi.Any(tencentcloud_vpc.Vpc.Id),
    			SubnetIds: pulumi.StringArray{
    				tencentcloud_subnet.Subnet.Id,
    			},
    			ProjectId:                         pulumi.Float64(0),
    			DefaultCooldown:                   pulumi.Float64(400),
    			DesiredCapacity:                   pulumi.Float64(1),
    			ReplaceMonitorUnhealthy:           pulumi.Bool(false),
    			ScalingMode:                       pulumi.String("CLASSIC_SCALING"),
    			ReplaceLoadBalancerUnhealthy:      pulumi.Bool(false),
    			ReplaceMode:                       pulumi.String("RECREATE"),
    			DesiredCapacitySyncWithMaxMinSize: pulumi.Bool(false),
    			TerminationPolicies: pulumi.StringArray{
    				pulumi.String("NEWEST_INSTANCE"),
    			},
    			RetryPolicy: pulumi.String("INCREMENTAL_INTERVALS"),
    			ForwardBalancerIds: tencentcloud.AsScalingGroupForwardBalancerIdArray{
    				&tencentcloud.AsScalingGroupForwardBalancerIdArgs{
    					LoadBalancerId: exampleClbInstance.ClbInstanceId,
    					ListenerId:     exampleClbListener.ListenerId,
    					RuleId:         exampleClbListenerRule.RuleId,
    					TargetAttributes: tencentcloud.AsScalingGroupForwardBalancerIdTargetAttributeArray{
    						&tencentcloud.AsScalingGroupForwardBalancerIdTargetAttributeArgs{
    							Port:   pulumi.Float64(80),
    							Weight: pulumi.Float64(90),
    						},
    					},
    				},
    			},
    			Tags: pulumi.StringMap{
    				"createBy": pulumi.String("tfExample"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleClbInstance = new Tencentcloud.ClbInstance("exampleClbInstance", new()
        {
            NetworkType = "INTERNAL",
            ClbName = "clb-example",
            ProjectId = 0,
            VpcId = tencentcloud_vpc.Vpc.Id,
            SubnetId = tencentcloud_subnet.Subnet.Id,
            Tags = 
            {
                { "test", "tf" },
            },
        });
    
        var exampleClbListener = new Tencentcloud.ClbListener("exampleClbListener", new()
        {
            ClbId = exampleClbInstance.ClbInstanceId,
            ListenerName = "listener-example",
            Port = 80,
            Protocol = "HTTP",
        });
    
        var exampleClbListenerRule = new Tencentcloud.ClbListenerRule("exampleClbListenerRule", new()
        {
            ListenerId = exampleClbListener.ListenerId,
            ClbId = exampleClbInstance.ClbInstanceId,
            Domain = "foo.net",
            Url = "/bar",
        });
    
        var exampleAsScalingGroup = new Tencentcloud.AsScalingGroup("exampleAsScalingGroup", new()
        {
            ScalingGroupName = "tf-example",
            ConfigurationId = tencentcloud_as_scaling_config.Example.Id,
            MaxSize = 1,
            MinSize = 0,
            VpcId = tencentcloud_vpc.Vpc.Id,
            SubnetIds = new[]
            {
                tencentcloud_subnet.Subnet.Id,
            },
            ProjectId = 0,
            DefaultCooldown = 400,
            DesiredCapacity = 1,
            ReplaceMonitorUnhealthy = false,
            ScalingMode = "CLASSIC_SCALING",
            ReplaceLoadBalancerUnhealthy = false,
            ReplaceMode = "RECREATE",
            DesiredCapacitySyncWithMaxMinSize = false,
            TerminationPolicies = new[]
            {
                "NEWEST_INSTANCE",
            },
            RetryPolicy = "INCREMENTAL_INTERVALS",
            ForwardBalancerIds = new[]
            {
                new Tencentcloud.Inputs.AsScalingGroupForwardBalancerIdArgs
                {
                    LoadBalancerId = exampleClbInstance.ClbInstanceId,
                    ListenerId = exampleClbListener.ListenerId,
                    RuleId = exampleClbListenerRule.RuleId,
                    TargetAttributes = new[]
                    {
                        new Tencentcloud.Inputs.AsScalingGroupForwardBalancerIdTargetAttributeArgs
                        {
                            Port = 80,
                            Weight = 90,
                        },
                    },
                },
            },
            Tags = 
            {
                { "createBy", "tfExample" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.ClbInstance;
    import com.pulumi.tencentcloud.ClbInstanceArgs;
    import com.pulumi.tencentcloud.ClbListener;
    import com.pulumi.tencentcloud.ClbListenerArgs;
    import com.pulumi.tencentcloud.ClbListenerRule;
    import com.pulumi.tencentcloud.ClbListenerRuleArgs;
    import com.pulumi.tencentcloud.AsScalingGroup;
    import com.pulumi.tencentcloud.AsScalingGroupArgs;
    import com.pulumi.tencentcloud.inputs.AsScalingGroupForwardBalancerIdArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var exampleClbInstance = new ClbInstance("exampleClbInstance", ClbInstanceArgs.builder()
                .networkType("INTERNAL")
                .clbName("clb-example")
                .projectId(0)
                .vpcId(tencentcloud_vpc.vpc().id())
                .subnetId(tencentcloud_subnet.subnet().id())
                .tags(Map.of("test", "tf"))
                .build());
    
            var exampleClbListener = new ClbListener("exampleClbListener", ClbListenerArgs.builder()
                .clbId(exampleClbInstance.clbInstanceId())
                .listenerName("listener-example")
                .port(80)
                .protocol("HTTP")
                .build());
    
            var exampleClbListenerRule = new ClbListenerRule("exampleClbListenerRule", ClbListenerRuleArgs.builder()
                .listenerId(exampleClbListener.listenerId())
                .clbId(exampleClbInstance.clbInstanceId())
                .domain("foo.net")
                .url("/bar")
                .build());
    
            var exampleAsScalingGroup = new AsScalingGroup("exampleAsScalingGroup", AsScalingGroupArgs.builder()
                .scalingGroupName("tf-example")
                .configurationId(tencentcloud_as_scaling_config.example().id())
                .maxSize(1)
                .minSize(0)
                .vpcId(tencentcloud_vpc.vpc().id())
                .subnetIds(tencentcloud_subnet.subnet().id())
                .projectId(0)
                .defaultCooldown(400)
                .desiredCapacity(1)
                .replaceMonitorUnhealthy(false)
                .scalingMode("CLASSIC_SCALING")
                .replaceLoadBalancerUnhealthy(false)
                .replaceMode("RECREATE")
                .desiredCapacitySyncWithMaxMinSize(false)
                .terminationPolicies("NEWEST_INSTANCE")
                .retryPolicy("INCREMENTAL_INTERVALS")
                .forwardBalancerIds(AsScalingGroupForwardBalancerIdArgs.builder()
                    .loadBalancerId(exampleClbInstance.clbInstanceId())
                    .listenerId(exampleClbListener.listenerId())
                    .ruleId(exampleClbListenerRule.ruleId())
                    .targetAttributes(AsScalingGroupForwardBalancerIdTargetAttributeArgs.builder()
                        .port(80)
                        .weight(90)
                        .build())
                    .build())
                .tags(Map.of("createBy", "tfExample"))
                .build());
    
        }
    }
    
    resources:
      exampleClbInstance:
        type: tencentcloud:ClbInstance
        properties:
          networkType: INTERNAL
          clbName: clb-example
          projectId: 0
          vpcId: ${tencentcloud_vpc.vpc.id}
          subnetId: ${tencentcloud_subnet.subnet.id}
          tags:
            test: tf
      exampleClbListener:
        type: tencentcloud:ClbListener
        properties:
          clbId: ${exampleClbInstance.clbInstanceId}
          listenerName: listener-example
          port: 80
          protocol: HTTP
      exampleClbListenerRule:
        type: tencentcloud:ClbListenerRule
        properties:
          listenerId: ${exampleClbListener.listenerId}
          clbId: ${exampleClbInstance.clbInstanceId}
          domain: foo.net
          url: /bar
      exampleAsScalingGroup:
        type: tencentcloud:AsScalingGroup
        properties:
          scalingGroupName: tf-example
          configurationId: ${tencentcloud_as_scaling_config.example.id}
          maxSize: 1
          minSize: 0
          vpcId: ${tencentcloud_vpc.vpc.id}
          subnetIds:
            - ${tencentcloud_subnet.subnet.id}
          projectId: 0
          defaultCooldown: 400
          desiredCapacity: 1
          replaceMonitorUnhealthy: false
          scalingMode: CLASSIC_SCALING
          replaceLoadBalancerUnhealthy: false
          replaceMode: RECREATE
          desiredCapacitySyncWithMaxMinSize: false
          terminationPolicies:
            - NEWEST_INSTANCE
          retryPolicy: INCREMENTAL_INTERVALS
          forwardBalancerIds:
            - loadBalancerId: ${exampleClbInstance.clbInstanceId}
              listenerId: ${exampleClbListener.listenerId}
              ruleId: ${exampleClbListenerRule.ruleId}
              targetAttributes:
                - port: 80
                  weight: 90
          tags:
            createBy: tfExample
    

    Create AsScalingGroup Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new AsScalingGroup(name: string, args: AsScalingGroupArgs, opts?: CustomResourceOptions);
    @overload
    def AsScalingGroup(resource_name: str,
                       args: AsScalingGroupArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def AsScalingGroup(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       max_size: Optional[float] = None,
                       configuration_id: Optional[str] = None,
                       vpc_id: Optional[str] = None,
                       scaling_group_name: Optional[str] = None,
                       min_size: Optional[float] = None,
                       project_id: Optional[float] = None,
                       replace_mode: Optional[str] = None,
                       lb_health_check_grace_period: Optional[float] = None,
                       load_balancer_ids: Optional[Sequence[str]] = None,
                       forward_balancer_ids: Optional[Sequence[AsScalingGroupForwardBalancerIdArgs]] = None,
                       desired_capacity_sync_with_max_min_size: Optional[bool] = None,
                       multi_zone_subnet_policy: Optional[str] = None,
                       as_scaling_group_id: Optional[str] = None,
                       replace_load_balancer_unhealthy: Optional[bool] = None,
                       health_check_type: Optional[str] = None,
                       replace_monitor_unhealthy: Optional[bool] = None,
                       retry_policy: Optional[str] = None,
                       desired_capacity: Optional[float] = None,
                       scaling_mode: Optional[str] = None,
                       subnet_ids: Optional[Sequence[str]] = None,
                       tags: Optional[Mapping[str, str]] = None,
                       termination_policies: Optional[Sequence[str]] = None,
                       default_cooldown: Optional[float] = None,
                       zones: Optional[Sequence[str]] = None)
    func NewAsScalingGroup(ctx *Context, name string, args AsScalingGroupArgs, opts ...ResourceOption) (*AsScalingGroup, error)
    public AsScalingGroup(string name, AsScalingGroupArgs args, CustomResourceOptions? opts = null)
    public AsScalingGroup(String name, AsScalingGroupArgs args)
    public AsScalingGroup(String name, AsScalingGroupArgs args, CustomResourceOptions options)
    
    type: tencentcloud:AsScalingGroup
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args AsScalingGroupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args AsScalingGroupArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args AsScalingGroupArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AsScalingGroupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AsScalingGroupArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    AsScalingGroup Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The AsScalingGroup resource accepts the following input properties:

    ConfigurationId string
    An available ID for a launch configuration.
    MaxSize double
    Maximum number of CVM instances. Valid value ranges: (0~2000).
    MinSize double
    Minimum number of CVM instances. Valid value ranges: (0~2000).
    ScalingGroupName string
    Name of a scaling group.
    VpcId string
    ID of VPC network.
    AsScalingGroupId string
    ID of the resource.
    DefaultCooldown double
    Default cooldown time in second, and default value is 300.
    DesiredCapacity double
    Desired volume of CVM instances, which is between max_size and min_size.
    DesiredCapacitySyncWithMaxMinSize bool
    The expected number of instances is synchronized with the maximum and minimum values. The default value is False. This parameter is effective only in the scenario where the expected number is not passed in when modifying the scaling group interface. True: When modifying the maximum or minimum value, if there is a conflict with the current expected number, the expected number is adjusted synchronously. For example, when modifying, if the minimum value 2 is passed in and the current expected number is 1, the expected number is adjusted synchronously to 2; False: When modifying the maximum or minimum value, if there is a conflict with the current expected number, an error message is displayed indicating that the modification is not allowed.
    ForwardBalancerIds List<AsScalingGroupForwardBalancerId>
    List of application load balancers, which can't be specified with load_balancer_ids together.
    HealthCheckType string
    Health check type of instances in a scaling group.CVM: confirm whether an instance is healthy based on the network status. If the pinged instance is unreachable, the instance will be considered unhealthy. For more information, see Instance Health CheckCLB: confirm whether an instance is healthy based on the CLB health check status. For more information, see Health Check Overview.If the parameter is set to CLB, the scaling group will check both the network status and the CLB health check status. If the network check indicates unhealthy, the HealthStatus field will return UNHEALTHY. If the CLB health check indicates unhealthy, the HealthStatus field will return CLB_UNHEALTHY. If both checks indicate unhealthy, the HealthStatus field will return UNHEALTHY|CLB_UNHEALTHY. Default value: CLB.
    LbHealthCheckGracePeriod double
    Grace period of the CLB health check during which the IN_SERVICE instances added will not be marked as CLB_UNHEALTHY.Valid range: 0-7200, in seconds. Default value: 0.
    LoadBalancerIds List<string>
    ID list of traditional load balancers.
    MultiZoneSubnetPolicy string
    Multi zone or subnet strategy, Valid values: PRIORITY and EQUALITY.
    ProjectId double
    Specifies to which project the scaling group belongs.
    ReplaceLoadBalancerUnhealthy bool
    Enable unhealthy instance replacement. If set to true, AS will replace instances that are found unhealthy in the CLB health check.
    ReplaceMode string
    Replace mode of unhealthy replacement service. Valid values: RECREATE: Rebuild an instance to replace the original unhealthy instance. RESET: Performing a system reinstallation on unhealthy instances to keep information such as data disks, private IP addresses, and instance IDs unchanged. The instance login settings, HostName, enhanced services, and UserData will remain consistent with the current launch configuration. Default value: RECREATE. Note: This field may return null, indicating that no valid values can be obtained.
    ReplaceMonitorUnhealthy bool
    Enables unhealthy instance replacement. If set to true, AS will replace instances that are flagged as unhealthy by Cloud Monitor.
    RetryPolicy string
    Available values for retry policies. Valid values: IMMEDIATE_RETRY and INCREMENTAL_INTERVALS.
    ScalingMode string
    Indicates scaling mode which creates and terminates instances (classic method), or method first tries to start stopped instances (wake up stopped) to perform scaling operations. Available values: CLASSIC_SCALING, WAKE_UP_STOPPED_SCALING. Default: CLASSIC_SCALING.
    SubnetIds List<string>
    ID list of subnet, and for VPC it is required.
    Tags Dictionary<string, string>
    Tags of a scaling group.
    TerminationPolicies List<string>
    Available values for termination policies. Valid values: OLDEST_INSTANCE and NEWEST_INSTANCE.
    Zones List<string>
    List of available zones, for Basic network it is required.
    ConfigurationId string
    An available ID for a launch configuration.
    MaxSize float64
    Maximum number of CVM instances. Valid value ranges: (0~2000).
    MinSize float64
    Minimum number of CVM instances. Valid value ranges: (0~2000).
    ScalingGroupName string
    Name of a scaling group.
    VpcId string
    ID of VPC network.
    AsScalingGroupId string
    ID of the resource.
    DefaultCooldown float64
    Default cooldown time in second, and default value is 300.
    DesiredCapacity float64
    Desired volume of CVM instances, which is between max_size and min_size.
    DesiredCapacitySyncWithMaxMinSize bool
    The expected number of instances is synchronized with the maximum and minimum values. The default value is False. This parameter is effective only in the scenario where the expected number is not passed in when modifying the scaling group interface. True: When modifying the maximum or minimum value, if there is a conflict with the current expected number, the expected number is adjusted synchronously. For example, when modifying, if the minimum value 2 is passed in and the current expected number is 1, the expected number is adjusted synchronously to 2; False: When modifying the maximum or minimum value, if there is a conflict with the current expected number, an error message is displayed indicating that the modification is not allowed.
    ForwardBalancerIds []AsScalingGroupForwardBalancerIdArgs
    List of application load balancers, which can't be specified with load_balancer_ids together.
    HealthCheckType string
    Health check type of instances in a scaling group.CVM: confirm whether an instance is healthy based on the network status. If the pinged instance is unreachable, the instance will be considered unhealthy. For more information, see Instance Health CheckCLB: confirm whether an instance is healthy based on the CLB health check status. For more information, see Health Check Overview.If the parameter is set to CLB, the scaling group will check both the network status and the CLB health check status. If the network check indicates unhealthy, the HealthStatus field will return UNHEALTHY. If the CLB health check indicates unhealthy, the HealthStatus field will return CLB_UNHEALTHY. If both checks indicate unhealthy, the HealthStatus field will return UNHEALTHY|CLB_UNHEALTHY. Default value: CLB.
    LbHealthCheckGracePeriod float64
    Grace period of the CLB health check during which the IN_SERVICE instances added will not be marked as CLB_UNHEALTHY.Valid range: 0-7200, in seconds. Default value: 0.
    LoadBalancerIds []string
    ID list of traditional load balancers.
    MultiZoneSubnetPolicy string
    Multi zone or subnet strategy, Valid values: PRIORITY and EQUALITY.
    ProjectId float64
    Specifies to which project the scaling group belongs.
    ReplaceLoadBalancerUnhealthy bool
    Enable unhealthy instance replacement. If set to true, AS will replace instances that are found unhealthy in the CLB health check.
    ReplaceMode string
    Replace mode of unhealthy replacement service. Valid values: RECREATE: Rebuild an instance to replace the original unhealthy instance. RESET: Performing a system reinstallation on unhealthy instances to keep information such as data disks, private IP addresses, and instance IDs unchanged. The instance login settings, HostName, enhanced services, and UserData will remain consistent with the current launch configuration. Default value: RECREATE. Note: This field may return null, indicating that no valid values can be obtained.
    ReplaceMonitorUnhealthy bool
    Enables unhealthy instance replacement. If set to true, AS will replace instances that are flagged as unhealthy by Cloud Monitor.
    RetryPolicy string
    Available values for retry policies. Valid values: IMMEDIATE_RETRY and INCREMENTAL_INTERVALS.
    ScalingMode string
    Indicates scaling mode which creates and terminates instances (classic method), or method first tries to start stopped instances (wake up stopped) to perform scaling operations. Available values: CLASSIC_SCALING, WAKE_UP_STOPPED_SCALING. Default: CLASSIC_SCALING.
    SubnetIds []string
    ID list of subnet, and for VPC it is required.
    Tags map[string]string
    Tags of a scaling group.
    TerminationPolicies []string
    Available values for termination policies. Valid values: OLDEST_INSTANCE and NEWEST_INSTANCE.
    Zones []string
    List of available zones, for Basic network it is required.
    configurationId String
    An available ID for a launch configuration.
    maxSize Double
    Maximum number of CVM instances. Valid value ranges: (0~2000).
    minSize Double
    Minimum number of CVM instances. Valid value ranges: (0~2000).
    scalingGroupName String
    Name of a scaling group.
    vpcId String
    ID of VPC network.
    asScalingGroupId String
    ID of the resource.
    defaultCooldown Double
    Default cooldown time in second, and default value is 300.
    desiredCapacity Double
    Desired volume of CVM instances, which is between max_size and min_size.
    desiredCapacitySyncWithMaxMinSize Boolean
    The expected number of instances is synchronized with the maximum and minimum values. The default value is False. This parameter is effective only in the scenario where the expected number is not passed in when modifying the scaling group interface. True: When modifying the maximum or minimum value, if there is a conflict with the current expected number, the expected number is adjusted synchronously. For example, when modifying, if the minimum value 2 is passed in and the current expected number is 1, the expected number is adjusted synchronously to 2; False: When modifying the maximum or minimum value, if there is a conflict with the current expected number, an error message is displayed indicating that the modification is not allowed.
    forwardBalancerIds List<AsScalingGroupForwardBalancerId>
    List of application load balancers, which can't be specified with load_balancer_ids together.
    healthCheckType String
    Health check type of instances in a scaling group.CVM: confirm whether an instance is healthy based on the network status. If the pinged instance is unreachable, the instance will be considered unhealthy. For more information, see Instance Health CheckCLB: confirm whether an instance is healthy based on the CLB health check status. For more information, see Health Check Overview.If the parameter is set to CLB, the scaling group will check both the network status and the CLB health check status. If the network check indicates unhealthy, the HealthStatus field will return UNHEALTHY. If the CLB health check indicates unhealthy, the HealthStatus field will return CLB_UNHEALTHY. If both checks indicate unhealthy, the HealthStatus field will return UNHEALTHY|CLB_UNHEALTHY. Default value: CLB.
    lbHealthCheckGracePeriod Double
    Grace period of the CLB health check during which the IN_SERVICE instances added will not be marked as CLB_UNHEALTHY.Valid range: 0-7200, in seconds. Default value: 0.
    loadBalancerIds List<String>
    ID list of traditional load balancers.
    multiZoneSubnetPolicy String
    Multi zone or subnet strategy, Valid values: PRIORITY and EQUALITY.
    projectId Double
    Specifies to which project the scaling group belongs.
    replaceLoadBalancerUnhealthy Boolean
    Enable unhealthy instance replacement. If set to true, AS will replace instances that are found unhealthy in the CLB health check.
    replaceMode String
    Replace mode of unhealthy replacement service. Valid values: RECREATE: Rebuild an instance to replace the original unhealthy instance. RESET: Performing a system reinstallation on unhealthy instances to keep information such as data disks, private IP addresses, and instance IDs unchanged. The instance login settings, HostName, enhanced services, and UserData will remain consistent with the current launch configuration. Default value: RECREATE. Note: This field may return null, indicating that no valid values can be obtained.
    replaceMonitorUnhealthy Boolean
    Enables unhealthy instance replacement. If set to true, AS will replace instances that are flagged as unhealthy by Cloud Monitor.
    retryPolicy String
    Available values for retry policies. Valid values: IMMEDIATE_RETRY and INCREMENTAL_INTERVALS.
    scalingMode String
    Indicates scaling mode which creates and terminates instances (classic method), or method first tries to start stopped instances (wake up stopped) to perform scaling operations. Available values: CLASSIC_SCALING, WAKE_UP_STOPPED_SCALING. Default: CLASSIC_SCALING.
    subnetIds List<String>
    ID list of subnet, and for VPC it is required.
    tags Map<String,String>
    Tags of a scaling group.
    terminationPolicies List<String>
    Available values for termination policies. Valid values: OLDEST_INSTANCE and NEWEST_INSTANCE.
    zones List<String>
    List of available zones, for Basic network it is required.
    configurationId string
    An available ID for a launch configuration.
    maxSize number
    Maximum number of CVM instances. Valid value ranges: (0~2000).
    minSize number
    Minimum number of CVM instances. Valid value ranges: (0~2000).
    scalingGroupName string
    Name of a scaling group.
    vpcId string
    ID of VPC network.
    asScalingGroupId string
    ID of the resource.
    defaultCooldown number
    Default cooldown time in second, and default value is 300.
    desiredCapacity number
    Desired volume of CVM instances, which is between max_size and min_size.
    desiredCapacitySyncWithMaxMinSize boolean
    The expected number of instances is synchronized with the maximum and minimum values. The default value is False. This parameter is effective only in the scenario where the expected number is not passed in when modifying the scaling group interface. True: When modifying the maximum or minimum value, if there is a conflict with the current expected number, the expected number is adjusted synchronously. For example, when modifying, if the minimum value 2 is passed in and the current expected number is 1, the expected number is adjusted synchronously to 2; False: When modifying the maximum or minimum value, if there is a conflict with the current expected number, an error message is displayed indicating that the modification is not allowed.
    forwardBalancerIds AsScalingGroupForwardBalancerId[]
    List of application load balancers, which can't be specified with load_balancer_ids together.
    healthCheckType string
    Health check type of instances in a scaling group.CVM: confirm whether an instance is healthy based on the network status. If the pinged instance is unreachable, the instance will be considered unhealthy. For more information, see Instance Health CheckCLB: confirm whether an instance is healthy based on the CLB health check status. For more information, see Health Check Overview.If the parameter is set to CLB, the scaling group will check both the network status and the CLB health check status. If the network check indicates unhealthy, the HealthStatus field will return UNHEALTHY. If the CLB health check indicates unhealthy, the HealthStatus field will return CLB_UNHEALTHY. If both checks indicate unhealthy, the HealthStatus field will return UNHEALTHY|CLB_UNHEALTHY. Default value: CLB.
    lbHealthCheckGracePeriod number
    Grace period of the CLB health check during which the IN_SERVICE instances added will not be marked as CLB_UNHEALTHY.Valid range: 0-7200, in seconds. Default value: 0.
    loadBalancerIds string[]
    ID list of traditional load balancers.
    multiZoneSubnetPolicy string
    Multi zone or subnet strategy, Valid values: PRIORITY and EQUALITY.
    projectId number
    Specifies to which project the scaling group belongs.
    replaceLoadBalancerUnhealthy boolean
    Enable unhealthy instance replacement. If set to true, AS will replace instances that are found unhealthy in the CLB health check.
    replaceMode string
    Replace mode of unhealthy replacement service. Valid values: RECREATE: Rebuild an instance to replace the original unhealthy instance. RESET: Performing a system reinstallation on unhealthy instances to keep information such as data disks, private IP addresses, and instance IDs unchanged. The instance login settings, HostName, enhanced services, and UserData will remain consistent with the current launch configuration. Default value: RECREATE. Note: This field may return null, indicating that no valid values can be obtained.
    replaceMonitorUnhealthy boolean
    Enables unhealthy instance replacement. If set to true, AS will replace instances that are flagged as unhealthy by Cloud Monitor.
    retryPolicy string
    Available values for retry policies. Valid values: IMMEDIATE_RETRY and INCREMENTAL_INTERVALS.
    scalingMode string
    Indicates scaling mode which creates and terminates instances (classic method), or method first tries to start stopped instances (wake up stopped) to perform scaling operations. Available values: CLASSIC_SCALING, WAKE_UP_STOPPED_SCALING. Default: CLASSIC_SCALING.
    subnetIds string[]
    ID list of subnet, and for VPC it is required.
    tags {[key: string]: string}
    Tags of a scaling group.
    terminationPolicies string[]
    Available values for termination policies. Valid values: OLDEST_INSTANCE and NEWEST_INSTANCE.
    zones string[]
    List of available zones, for Basic network it is required.
    configuration_id str
    An available ID for a launch configuration.
    max_size float
    Maximum number of CVM instances. Valid value ranges: (0~2000).
    min_size float
    Minimum number of CVM instances. Valid value ranges: (0~2000).
    scaling_group_name str
    Name of a scaling group.
    vpc_id str
    ID of VPC network.
    as_scaling_group_id str
    ID of the resource.
    default_cooldown float
    Default cooldown time in second, and default value is 300.
    desired_capacity float
    Desired volume of CVM instances, which is between max_size and min_size.
    desired_capacity_sync_with_max_min_size bool
    The expected number of instances is synchronized with the maximum and minimum values. The default value is False. This parameter is effective only in the scenario where the expected number is not passed in when modifying the scaling group interface. True: When modifying the maximum or minimum value, if there is a conflict with the current expected number, the expected number is adjusted synchronously. For example, when modifying, if the minimum value 2 is passed in and the current expected number is 1, the expected number is adjusted synchronously to 2; False: When modifying the maximum or minimum value, if there is a conflict with the current expected number, an error message is displayed indicating that the modification is not allowed.
    forward_balancer_ids Sequence[AsScalingGroupForwardBalancerIdArgs]
    List of application load balancers, which can't be specified with load_balancer_ids together.
    health_check_type str
    Health check type of instances in a scaling group.CVM: confirm whether an instance is healthy based on the network status. If the pinged instance is unreachable, the instance will be considered unhealthy. For more information, see Instance Health CheckCLB: confirm whether an instance is healthy based on the CLB health check status. For more information, see Health Check Overview.If the parameter is set to CLB, the scaling group will check both the network status and the CLB health check status. If the network check indicates unhealthy, the HealthStatus field will return UNHEALTHY. If the CLB health check indicates unhealthy, the HealthStatus field will return CLB_UNHEALTHY. If both checks indicate unhealthy, the HealthStatus field will return UNHEALTHY|CLB_UNHEALTHY. Default value: CLB.
    lb_health_check_grace_period float
    Grace period of the CLB health check during which the IN_SERVICE instances added will not be marked as CLB_UNHEALTHY.Valid range: 0-7200, in seconds. Default value: 0.
    load_balancer_ids Sequence[str]
    ID list of traditional load balancers.
    multi_zone_subnet_policy str
    Multi zone or subnet strategy, Valid values: PRIORITY and EQUALITY.
    project_id float
    Specifies to which project the scaling group belongs.
    replace_load_balancer_unhealthy bool
    Enable unhealthy instance replacement. If set to true, AS will replace instances that are found unhealthy in the CLB health check.
    replace_mode str
    Replace mode of unhealthy replacement service. Valid values: RECREATE: Rebuild an instance to replace the original unhealthy instance. RESET: Performing a system reinstallation on unhealthy instances to keep information such as data disks, private IP addresses, and instance IDs unchanged. The instance login settings, HostName, enhanced services, and UserData will remain consistent with the current launch configuration. Default value: RECREATE. Note: This field may return null, indicating that no valid values can be obtained.
    replace_monitor_unhealthy bool
    Enables unhealthy instance replacement. If set to true, AS will replace instances that are flagged as unhealthy by Cloud Monitor.
    retry_policy str
    Available values for retry policies. Valid values: IMMEDIATE_RETRY and INCREMENTAL_INTERVALS.
    scaling_mode str
    Indicates scaling mode which creates and terminates instances (classic method), or method first tries to start stopped instances (wake up stopped) to perform scaling operations. Available values: CLASSIC_SCALING, WAKE_UP_STOPPED_SCALING. Default: CLASSIC_SCALING.
    subnet_ids Sequence[str]
    ID list of subnet, and for VPC it is required.
    tags Mapping[str, str]
    Tags of a scaling group.
    termination_policies Sequence[str]
    Available values for termination policies. Valid values: OLDEST_INSTANCE and NEWEST_INSTANCE.
    zones Sequence[str]
    List of available zones, for Basic network it is required.
    configurationId String
    An available ID for a launch configuration.
    maxSize Number
    Maximum number of CVM instances. Valid value ranges: (0~2000).
    minSize Number
    Minimum number of CVM instances. Valid value ranges: (0~2000).
    scalingGroupName String
    Name of a scaling group.
    vpcId String
    ID of VPC network.
    asScalingGroupId String
    ID of the resource.
    defaultCooldown Number
    Default cooldown time in second, and default value is 300.
    desiredCapacity Number
    Desired volume of CVM instances, which is between max_size and min_size.
    desiredCapacitySyncWithMaxMinSize Boolean
    The expected number of instances is synchronized with the maximum and minimum values. The default value is False. This parameter is effective only in the scenario where the expected number is not passed in when modifying the scaling group interface. True: When modifying the maximum or minimum value, if there is a conflict with the current expected number, the expected number is adjusted synchronously. For example, when modifying, if the minimum value 2 is passed in and the current expected number is 1, the expected number is adjusted synchronously to 2; False: When modifying the maximum or minimum value, if there is a conflict with the current expected number, an error message is displayed indicating that the modification is not allowed.
    forwardBalancerIds List<Property Map>
    List of application load balancers, which can't be specified with load_balancer_ids together.
    healthCheckType String
    Health check type of instances in a scaling group.CVM: confirm whether an instance is healthy based on the network status. If the pinged instance is unreachable, the instance will be considered unhealthy. For more information, see Instance Health CheckCLB: confirm whether an instance is healthy based on the CLB health check status. For more information, see Health Check Overview.If the parameter is set to CLB, the scaling group will check both the network status and the CLB health check status. If the network check indicates unhealthy, the HealthStatus field will return UNHEALTHY. If the CLB health check indicates unhealthy, the HealthStatus field will return CLB_UNHEALTHY. If both checks indicate unhealthy, the HealthStatus field will return UNHEALTHY|CLB_UNHEALTHY. Default value: CLB.
    lbHealthCheckGracePeriod Number
    Grace period of the CLB health check during which the IN_SERVICE instances added will not be marked as CLB_UNHEALTHY.Valid range: 0-7200, in seconds. Default value: 0.
    loadBalancerIds List<String>
    ID list of traditional load balancers.
    multiZoneSubnetPolicy String
    Multi zone or subnet strategy, Valid values: PRIORITY and EQUALITY.
    projectId Number
    Specifies to which project the scaling group belongs.
    replaceLoadBalancerUnhealthy Boolean
    Enable unhealthy instance replacement. If set to true, AS will replace instances that are found unhealthy in the CLB health check.
    replaceMode String
    Replace mode of unhealthy replacement service. Valid values: RECREATE: Rebuild an instance to replace the original unhealthy instance. RESET: Performing a system reinstallation on unhealthy instances to keep information such as data disks, private IP addresses, and instance IDs unchanged. The instance login settings, HostName, enhanced services, and UserData will remain consistent with the current launch configuration. Default value: RECREATE. Note: This field may return null, indicating that no valid values can be obtained.
    replaceMonitorUnhealthy Boolean
    Enables unhealthy instance replacement. If set to true, AS will replace instances that are flagged as unhealthy by Cloud Monitor.
    retryPolicy String
    Available values for retry policies. Valid values: IMMEDIATE_RETRY and INCREMENTAL_INTERVALS.
    scalingMode String
    Indicates scaling mode which creates and terminates instances (classic method), or method first tries to start stopped instances (wake up stopped) to perform scaling operations. Available values: CLASSIC_SCALING, WAKE_UP_STOPPED_SCALING. Default: CLASSIC_SCALING.
    subnetIds List<String>
    ID list of subnet, and for VPC it is required.
    tags Map<String>
    Tags of a scaling group.
    terminationPolicies List<String>
    Available values for termination policies. Valid values: OLDEST_INSTANCE and NEWEST_INSTANCE.
    zones List<String>
    List of available zones, for Basic network it is required.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the AsScalingGroup resource produces the following output properties:

    CreateTime string
    The time when the AS group was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    InstanceCount double
    Instance number of a scaling group.
    Status string
    Current status of a scaling group.
    CreateTime string
    The time when the AS group was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    InstanceCount float64
    Instance number of a scaling group.
    Status string
    Current status of a scaling group.
    createTime String
    The time when the AS group was created.
    id String
    The provider-assigned unique ID for this managed resource.
    instanceCount Double
    Instance number of a scaling group.
    status String
    Current status of a scaling group.
    createTime string
    The time when the AS group was created.
    id string
    The provider-assigned unique ID for this managed resource.
    instanceCount number
    Instance number of a scaling group.
    status string
    Current status of a scaling group.
    create_time str
    The time when the AS group was created.
    id str
    The provider-assigned unique ID for this managed resource.
    instance_count float
    Instance number of a scaling group.
    status str
    Current status of a scaling group.
    createTime String
    The time when the AS group was created.
    id String
    The provider-assigned unique ID for this managed resource.
    instanceCount Number
    Instance number of a scaling group.
    status String
    Current status of a scaling group.

    Look up Existing AsScalingGroup Resource

    Get an existing AsScalingGroup resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: AsScalingGroupState, opts?: CustomResourceOptions): AsScalingGroup
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            as_scaling_group_id: Optional[str] = None,
            configuration_id: Optional[str] = None,
            create_time: Optional[str] = None,
            default_cooldown: Optional[float] = None,
            desired_capacity: Optional[float] = None,
            desired_capacity_sync_with_max_min_size: Optional[bool] = None,
            forward_balancer_ids: Optional[Sequence[AsScalingGroupForwardBalancerIdArgs]] = None,
            health_check_type: Optional[str] = None,
            instance_count: Optional[float] = None,
            lb_health_check_grace_period: Optional[float] = None,
            load_balancer_ids: Optional[Sequence[str]] = None,
            max_size: Optional[float] = None,
            min_size: Optional[float] = None,
            multi_zone_subnet_policy: Optional[str] = None,
            project_id: Optional[float] = None,
            replace_load_balancer_unhealthy: Optional[bool] = None,
            replace_mode: Optional[str] = None,
            replace_monitor_unhealthy: Optional[bool] = None,
            retry_policy: Optional[str] = None,
            scaling_group_name: Optional[str] = None,
            scaling_mode: Optional[str] = None,
            status: Optional[str] = None,
            subnet_ids: Optional[Sequence[str]] = None,
            tags: Optional[Mapping[str, str]] = None,
            termination_policies: Optional[Sequence[str]] = None,
            vpc_id: Optional[str] = None,
            zones: Optional[Sequence[str]] = None) -> AsScalingGroup
    func GetAsScalingGroup(ctx *Context, name string, id IDInput, state *AsScalingGroupState, opts ...ResourceOption) (*AsScalingGroup, error)
    public static AsScalingGroup Get(string name, Input<string> id, AsScalingGroupState? state, CustomResourceOptions? opts = null)
    public static AsScalingGroup get(String name, Output<String> id, AsScalingGroupState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:AsScalingGroup    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    AsScalingGroupId string
    ID of the resource.
    ConfigurationId string
    An available ID for a launch configuration.
    CreateTime string
    The time when the AS group was created.
    DefaultCooldown double
    Default cooldown time in second, and default value is 300.
    DesiredCapacity double
    Desired volume of CVM instances, which is between max_size and min_size.
    DesiredCapacitySyncWithMaxMinSize bool
    The expected number of instances is synchronized with the maximum and minimum values. The default value is False. This parameter is effective only in the scenario where the expected number is not passed in when modifying the scaling group interface. True: When modifying the maximum or minimum value, if there is a conflict with the current expected number, the expected number is adjusted synchronously. For example, when modifying, if the minimum value 2 is passed in and the current expected number is 1, the expected number is adjusted synchronously to 2; False: When modifying the maximum or minimum value, if there is a conflict with the current expected number, an error message is displayed indicating that the modification is not allowed.
    ForwardBalancerIds List<AsScalingGroupForwardBalancerId>
    List of application load balancers, which can't be specified with load_balancer_ids together.
    HealthCheckType string
    Health check type of instances in a scaling group.CVM: confirm whether an instance is healthy based on the network status. If the pinged instance is unreachable, the instance will be considered unhealthy. For more information, see Instance Health CheckCLB: confirm whether an instance is healthy based on the CLB health check status. For more information, see Health Check Overview.If the parameter is set to CLB, the scaling group will check both the network status and the CLB health check status. If the network check indicates unhealthy, the HealthStatus field will return UNHEALTHY. If the CLB health check indicates unhealthy, the HealthStatus field will return CLB_UNHEALTHY. If both checks indicate unhealthy, the HealthStatus field will return UNHEALTHY|CLB_UNHEALTHY. Default value: CLB.
    InstanceCount double
    Instance number of a scaling group.
    LbHealthCheckGracePeriod double
    Grace period of the CLB health check during which the IN_SERVICE instances added will not be marked as CLB_UNHEALTHY.Valid range: 0-7200, in seconds. Default value: 0.
    LoadBalancerIds List<string>
    ID list of traditional load balancers.
    MaxSize double
    Maximum number of CVM instances. Valid value ranges: (0~2000).
    MinSize double
    Minimum number of CVM instances. Valid value ranges: (0~2000).
    MultiZoneSubnetPolicy string
    Multi zone or subnet strategy, Valid values: PRIORITY and EQUALITY.
    ProjectId double
    Specifies to which project the scaling group belongs.
    ReplaceLoadBalancerUnhealthy bool
    Enable unhealthy instance replacement. If set to true, AS will replace instances that are found unhealthy in the CLB health check.
    ReplaceMode string
    Replace mode of unhealthy replacement service. Valid values: RECREATE: Rebuild an instance to replace the original unhealthy instance. RESET: Performing a system reinstallation on unhealthy instances to keep information such as data disks, private IP addresses, and instance IDs unchanged. The instance login settings, HostName, enhanced services, and UserData will remain consistent with the current launch configuration. Default value: RECREATE. Note: This field may return null, indicating that no valid values can be obtained.
    ReplaceMonitorUnhealthy bool
    Enables unhealthy instance replacement. If set to true, AS will replace instances that are flagged as unhealthy by Cloud Monitor.
    RetryPolicy string
    Available values for retry policies. Valid values: IMMEDIATE_RETRY and INCREMENTAL_INTERVALS.
    ScalingGroupName string
    Name of a scaling group.
    ScalingMode string
    Indicates scaling mode which creates and terminates instances (classic method), or method first tries to start stopped instances (wake up stopped) to perform scaling operations. Available values: CLASSIC_SCALING, WAKE_UP_STOPPED_SCALING. Default: CLASSIC_SCALING.
    Status string
    Current status of a scaling group.
    SubnetIds List<string>
    ID list of subnet, and for VPC it is required.
    Tags Dictionary<string, string>
    Tags of a scaling group.
    TerminationPolicies List<string>
    Available values for termination policies. Valid values: OLDEST_INSTANCE and NEWEST_INSTANCE.
    VpcId string
    ID of VPC network.
    Zones List<string>
    List of available zones, for Basic network it is required.
    AsScalingGroupId string
    ID of the resource.
    ConfigurationId string
    An available ID for a launch configuration.
    CreateTime string
    The time when the AS group was created.
    DefaultCooldown float64
    Default cooldown time in second, and default value is 300.
    DesiredCapacity float64
    Desired volume of CVM instances, which is between max_size and min_size.
    DesiredCapacitySyncWithMaxMinSize bool
    The expected number of instances is synchronized with the maximum and minimum values. The default value is False. This parameter is effective only in the scenario where the expected number is not passed in when modifying the scaling group interface. True: When modifying the maximum or minimum value, if there is a conflict with the current expected number, the expected number is adjusted synchronously. For example, when modifying, if the minimum value 2 is passed in and the current expected number is 1, the expected number is adjusted synchronously to 2; False: When modifying the maximum or minimum value, if there is a conflict with the current expected number, an error message is displayed indicating that the modification is not allowed.
    ForwardBalancerIds []AsScalingGroupForwardBalancerIdArgs
    List of application load balancers, which can't be specified with load_balancer_ids together.
    HealthCheckType string
    Health check type of instances in a scaling group.CVM: confirm whether an instance is healthy based on the network status. If the pinged instance is unreachable, the instance will be considered unhealthy. For more information, see Instance Health CheckCLB: confirm whether an instance is healthy based on the CLB health check status. For more information, see Health Check Overview.If the parameter is set to CLB, the scaling group will check both the network status and the CLB health check status. If the network check indicates unhealthy, the HealthStatus field will return UNHEALTHY. If the CLB health check indicates unhealthy, the HealthStatus field will return CLB_UNHEALTHY. If both checks indicate unhealthy, the HealthStatus field will return UNHEALTHY|CLB_UNHEALTHY. Default value: CLB.
    InstanceCount float64
    Instance number of a scaling group.
    LbHealthCheckGracePeriod float64
    Grace period of the CLB health check during which the IN_SERVICE instances added will not be marked as CLB_UNHEALTHY.Valid range: 0-7200, in seconds. Default value: 0.
    LoadBalancerIds []string
    ID list of traditional load balancers.
    MaxSize float64
    Maximum number of CVM instances. Valid value ranges: (0~2000).
    MinSize float64
    Minimum number of CVM instances. Valid value ranges: (0~2000).
    MultiZoneSubnetPolicy string
    Multi zone or subnet strategy, Valid values: PRIORITY and EQUALITY.
    ProjectId float64
    Specifies to which project the scaling group belongs.
    ReplaceLoadBalancerUnhealthy bool
    Enable unhealthy instance replacement. If set to true, AS will replace instances that are found unhealthy in the CLB health check.
    ReplaceMode string
    Replace mode of unhealthy replacement service. Valid values: RECREATE: Rebuild an instance to replace the original unhealthy instance. RESET: Performing a system reinstallation on unhealthy instances to keep information such as data disks, private IP addresses, and instance IDs unchanged. The instance login settings, HostName, enhanced services, and UserData will remain consistent with the current launch configuration. Default value: RECREATE. Note: This field may return null, indicating that no valid values can be obtained.
    ReplaceMonitorUnhealthy bool
    Enables unhealthy instance replacement. If set to true, AS will replace instances that are flagged as unhealthy by Cloud Monitor.
    RetryPolicy string
    Available values for retry policies. Valid values: IMMEDIATE_RETRY and INCREMENTAL_INTERVALS.
    ScalingGroupName string
    Name of a scaling group.
    ScalingMode string
    Indicates scaling mode which creates and terminates instances (classic method), or method first tries to start stopped instances (wake up stopped) to perform scaling operations. Available values: CLASSIC_SCALING, WAKE_UP_STOPPED_SCALING. Default: CLASSIC_SCALING.
    Status string
    Current status of a scaling group.
    SubnetIds []string
    ID list of subnet, and for VPC it is required.
    Tags map[string]string
    Tags of a scaling group.
    TerminationPolicies []string
    Available values for termination policies. Valid values: OLDEST_INSTANCE and NEWEST_INSTANCE.
    VpcId string
    ID of VPC network.
    Zones []string
    List of available zones, for Basic network it is required.
    asScalingGroupId String
    ID of the resource.
    configurationId String
    An available ID for a launch configuration.
    createTime String
    The time when the AS group was created.
    defaultCooldown Double
    Default cooldown time in second, and default value is 300.
    desiredCapacity Double
    Desired volume of CVM instances, which is between max_size and min_size.
    desiredCapacitySyncWithMaxMinSize Boolean
    The expected number of instances is synchronized with the maximum and minimum values. The default value is False. This parameter is effective only in the scenario where the expected number is not passed in when modifying the scaling group interface. True: When modifying the maximum or minimum value, if there is a conflict with the current expected number, the expected number is adjusted synchronously. For example, when modifying, if the minimum value 2 is passed in and the current expected number is 1, the expected number is adjusted synchronously to 2; False: When modifying the maximum or minimum value, if there is a conflict with the current expected number, an error message is displayed indicating that the modification is not allowed.
    forwardBalancerIds List<AsScalingGroupForwardBalancerId>
    List of application load balancers, which can't be specified with load_balancer_ids together.
    healthCheckType String
    Health check type of instances in a scaling group.CVM: confirm whether an instance is healthy based on the network status. If the pinged instance is unreachable, the instance will be considered unhealthy. For more information, see Instance Health CheckCLB: confirm whether an instance is healthy based on the CLB health check status. For more information, see Health Check Overview.If the parameter is set to CLB, the scaling group will check both the network status and the CLB health check status. If the network check indicates unhealthy, the HealthStatus field will return UNHEALTHY. If the CLB health check indicates unhealthy, the HealthStatus field will return CLB_UNHEALTHY. If both checks indicate unhealthy, the HealthStatus field will return UNHEALTHY|CLB_UNHEALTHY. Default value: CLB.
    instanceCount Double
    Instance number of a scaling group.
    lbHealthCheckGracePeriod Double
    Grace period of the CLB health check during which the IN_SERVICE instances added will not be marked as CLB_UNHEALTHY.Valid range: 0-7200, in seconds. Default value: 0.
    loadBalancerIds List<String>
    ID list of traditional load balancers.
    maxSize Double
    Maximum number of CVM instances. Valid value ranges: (0~2000).
    minSize Double
    Minimum number of CVM instances. Valid value ranges: (0~2000).
    multiZoneSubnetPolicy String
    Multi zone or subnet strategy, Valid values: PRIORITY and EQUALITY.
    projectId Double
    Specifies to which project the scaling group belongs.
    replaceLoadBalancerUnhealthy Boolean
    Enable unhealthy instance replacement. If set to true, AS will replace instances that are found unhealthy in the CLB health check.
    replaceMode String
    Replace mode of unhealthy replacement service. Valid values: RECREATE: Rebuild an instance to replace the original unhealthy instance. RESET: Performing a system reinstallation on unhealthy instances to keep information such as data disks, private IP addresses, and instance IDs unchanged. The instance login settings, HostName, enhanced services, and UserData will remain consistent with the current launch configuration. Default value: RECREATE. Note: This field may return null, indicating that no valid values can be obtained.
    replaceMonitorUnhealthy Boolean
    Enables unhealthy instance replacement. If set to true, AS will replace instances that are flagged as unhealthy by Cloud Monitor.
    retryPolicy String
    Available values for retry policies. Valid values: IMMEDIATE_RETRY and INCREMENTAL_INTERVALS.
    scalingGroupName String
    Name of a scaling group.
    scalingMode String
    Indicates scaling mode which creates and terminates instances (classic method), or method first tries to start stopped instances (wake up stopped) to perform scaling operations. Available values: CLASSIC_SCALING, WAKE_UP_STOPPED_SCALING. Default: CLASSIC_SCALING.
    status String
    Current status of a scaling group.
    subnetIds List<String>
    ID list of subnet, and for VPC it is required.
    tags Map<String,String>
    Tags of a scaling group.
    terminationPolicies List<String>
    Available values for termination policies. Valid values: OLDEST_INSTANCE and NEWEST_INSTANCE.
    vpcId String
    ID of VPC network.
    zones List<String>
    List of available zones, for Basic network it is required.
    asScalingGroupId string
    ID of the resource.
    configurationId string
    An available ID for a launch configuration.
    createTime string
    The time when the AS group was created.
    defaultCooldown number
    Default cooldown time in second, and default value is 300.
    desiredCapacity number
    Desired volume of CVM instances, which is between max_size and min_size.
    desiredCapacitySyncWithMaxMinSize boolean
    The expected number of instances is synchronized with the maximum and minimum values. The default value is False. This parameter is effective only in the scenario where the expected number is not passed in when modifying the scaling group interface. True: When modifying the maximum or minimum value, if there is a conflict with the current expected number, the expected number is adjusted synchronously. For example, when modifying, if the minimum value 2 is passed in and the current expected number is 1, the expected number is adjusted synchronously to 2; False: When modifying the maximum or minimum value, if there is a conflict with the current expected number, an error message is displayed indicating that the modification is not allowed.
    forwardBalancerIds AsScalingGroupForwardBalancerId[]
    List of application load balancers, which can't be specified with load_balancer_ids together.
    healthCheckType string
    Health check type of instances in a scaling group.CVM: confirm whether an instance is healthy based on the network status. If the pinged instance is unreachable, the instance will be considered unhealthy. For more information, see Instance Health CheckCLB: confirm whether an instance is healthy based on the CLB health check status. For more information, see Health Check Overview.If the parameter is set to CLB, the scaling group will check both the network status and the CLB health check status. If the network check indicates unhealthy, the HealthStatus field will return UNHEALTHY. If the CLB health check indicates unhealthy, the HealthStatus field will return CLB_UNHEALTHY. If both checks indicate unhealthy, the HealthStatus field will return UNHEALTHY|CLB_UNHEALTHY. Default value: CLB.
    instanceCount number
    Instance number of a scaling group.
    lbHealthCheckGracePeriod number
    Grace period of the CLB health check during which the IN_SERVICE instances added will not be marked as CLB_UNHEALTHY.Valid range: 0-7200, in seconds. Default value: 0.
    loadBalancerIds string[]
    ID list of traditional load balancers.
    maxSize number
    Maximum number of CVM instances. Valid value ranges: (0~2000).
    minSize number
    Minimum number of CVM instances. Valid value ranges: (0~2000).
    multiZoneSubnetPolicy string
    Multi zone or subnet strategy, Valid values: PRIORITY and EQUALITY.
    projectId number
    Specifies to which project the scaling group belongs.
    replaceLoadBalancerUnhealthy boolean
    Enable unhealthy instance replacement. If set to true, AS will replace instances that are found unhealthy in the CLB health check.
    replaceMode string
    Replace mode of unhealthy replacement service. Valid values: RECREATE: Rebuild an instance to replace the original unhealthy instance. RESET: Performing a system reinstallation on unhealthy instances to keep information such as data disks, private IP addresses, and instance IDs unchanged. The instance login settings, HostName, enhanced services, and UserData will remain consistent with the current launch configuration. Default value: RECREATE. Note: This field may return null, indicating that no valid values can be obtained.
    replaceMonitorUnhealthy boolean
    Enables unhealthy instance replacement. If set to true, AS will replace instances that are flagged as unhealthy by Cloud Monitor.
    retryPolicy string
    Available values for retry policies. Valid values: IMMEDIATE_RETRY and INCREMENTAL_INTERVALS.
    scalingGroupName string
    Name of a scaling group.
    scalingMode string
    Indicates scaling mode which creates and terminates instances (classic method), or method first tries to start stopped instances (wake up stopped) to perform scaling operations. Available values: CLASSIC_SCALING, WAKE_UP_STOPPED_SCALING. Default: CLASSIC_SCALING.
    status string
    Current status of a scaling group.
    subnetIds string[]
    ID list of subnet, and for VPC it is required.
    tags {[key: string]: string}
    Tags of a scaling group.
    terminationPolicies string[]
    Available values for termination policies. Valid values: OLDEST_INSTANCE and NEWEST_INSTANCE.
    vpcId string
    ID of VPC network.
    zones string[]
    List of available zones, for Basic network it is required.
    as_scaling_group_id str
    ID of the resource.
    configuration_id str
    An available ID for a launch configuration.
    create_time str
    The time when the AS group was created.
    default_cooldown float
    Default cooldown time in second, and default value is 300.
    desired_capacity float
    Desired volume of CVM instances, which is between max_size and min_size.
    desired_capacity_sync_with_max_min_size bool
    The expected number of instances is synchronized with the maximum and minimum values. The default value is False. This parameter is effective only in the scenario where the expected number is not passed in when modifying the scaling group interface. True: When modifying the maximum or minimum value, if there is a conflict with the current expected number, the expected number is adjusted synchronously. For example, when modifying, if the minimum value 2 is passed in and the current expected number is 1, the expected number is adjusted synchronously to 2; False: When modifying the maximum or minimum value, if there is a conflict with the current expected number, an error message is displayed indicating that the modification is not allowed.
    forward_balancer_ids Sequence[AsScalingGroupForwardBalancerIdArgs]
    List of application load balancers, which can't be specified with load_balancer_ids together.
    health_check_type str
    Health check type of instances in a scaling group.CVM: confirm whether an instance is healthy based on the network status. If the pinged instance is unreachable, the instance will be considered unhealthy. For more information, see Instance Health CheckCLB: confirm whether an instance is healthy based on the CLB health check status. For more information, see Health Check Overview.If the parameter is set to CLB, the scaling group will check both the network status and the CLB health check status. If the network check indicates unhealthy, the HealthStatus field will return UNHEALTHY. If the CLB health check indicates unhealthy, the HealthStatus field will return CLB_UNHEALTHY. If both checks indicate unhealthy, the HealthStatus field will return UNHEALTHY|CLB_UNHEALTHY. Default value: CLB.
    instance_count float
    Instance number of a scaling group.
    lb_health_check_grace_period float
    Grace period of the CLB health check during which the IN_SERVICE instances added will not be marked as CLB_UNHEALTHY.Valid range: 0-7200, in seconds. Default value: 0.
    load_balancer_ids Sequence[str]
    ID list of traditional load balancers.
    max_size float
    Maximum number of CVM instances. Valid value ranges: (0~2000).
    min_size float
    Minimum number of CVM instances. Valid value ranges: (0~2000).
    multi_zone_subnet_policy str
    Multi zone or subnet strategy, Valid values: PRIORITY and EQUALITY.
    project_id float
    Specifies to which project the scaling group belongs.
    replace_load_balancer_unhealthy bool
    Enable unhealthy instance replacement. If set to true, AS will replace instances that are found unhealthy in the CLB health check.
    replace_mode str
    Replace mode of unhealthy replacement service. Valid values: RECREATE: Rebuild an instance to replace the original unhealthy instance. RESET: Performing a system reinstallation on unhealthy instances to keep information such as data disks, private IP addresses, and instance IDs unchanged. The instance login settings, HostName, enhanced services, and UserData will remain consistent with the current launch configuration. Default value: RECREATE. Note: This field may return null, indicating that no valid values can be obtained.
    replace_monitor_unhealthy bool
    Enables unhealthy instance replacement. If set to true, AS will replace instances that are flagged as unhealthy by Cloud Monitor.
    retry_policy str
    Available values for retry policies. Valid values: IMMEDIATE_RETRY and INCREMENTAL_INTERVALS.
    scaling_group_name str
    Name of a scaling group.
    scaling_mode str
    Indicates scaling mode which creates and terminates instances (classic method), or method first tries to start stopped instances (wake up stopped) to perform scaling operations. Available values: CLASSIC_SCALING, WAKE_UP_STOPPED_SCALING. Default: CLASSIC_SCALING.
    status str
    Current status of a scaling group.
    subnet_ids Sequence[str]
    ID list of subnet, and for VPC it is required.
    tags Mapping[str, str]
    Tags of a scaling group.
    termination_policies Sequence[str]
    Available values for termination policies. Valid values: OLDEST_INSTANCE and NEWEST_INSTANCE.
    vpc_id str
    ID of VPC network.
    zones Sequence[str]
    List of available zones, for Basic network it is required.
    asScalingGroupId String
    ID of the resource.
    configurationId String
    An available ID for a launch configuration.
    createTime String
    The time when the AS group was created.
    defaultCooldown Number
    Default cooldown time in second, and default value is 300.
    desiredCapacity Number
    Desired volume of CVM instances, which is between max_size and min_size.
    desiredCapacitySyncWithMaxMinSize Boolean
    The expected number of instances is synchronized with the maximum and minimum values. The default value is False. This parameter is effective only in the scenario where the expected number is not passed in when modifying the scaling group interface. True: When modifying the maximum or minimum value, if there is a conflict with the current expected number, the expected number is adjusted synchronously. For example, when modifying, if the minimum value 2 is passed in and the current expected number is 1, the expected number is adjusted synchronously to 2; False: When modifying the maximum or minimum value, if there is a conflict with the current expected number, an error message is displayed indicating that the modification is not allowed.
    forwardBalancerIds List<Property Map>
    List of application load balancers, which can't be specified with load_balancer_ids together.
    healthCheckType String
    Health check type of instances in a scaling group.CVM: confirm whether an instance is healthy based on the network status. If the pinged instance is unreachable, the instance will be considered unhealthy. For more information, see Instance Health CheckCLB: confirm whether an instance is healthy based on the CLB health check status. For more information, see Health Check Overview.If the parameter is set to CLB, the scaling group will check both the network status and the CLB health check status. If the network check indicates unhealthy, the HealthStatus field will return UNHEALTHY. If the CLB health check indicates unhealthy, the HealthStatus field will return CLB_UNHEALTHY. If both checks indicate unhealthy, the HealthStatus field will return UNHEALTHY|CLB_UNHEALTHY. Default value: CLB.
    instanceCount Number
    Instance number of a scaling group.
    lbHealthCheckGracePeriod Number
    Grace period of the CLB health check during which the IN_SERVICE instances added will not be marked as CLB_UNHEALTHY.Valid range: 0-7200, in seconds. Default value: 0.
    loadBalancerIds List<String>
    ID list of traditional load balancers.
    maxSize Number
    Maximum number of CVM instances. Valid value ranges: (0~2000).
    minSize Number
    Minimum number of CVM instances. Valid value ranges: (0~2000).
    multiZoneSubnetPolicy String
    Multi zone or subnet strategy, Valid values: PRIORITY and EQUALITY.
    projectId Number
    Specifies to which project the scaling group belongs.
    replaceLoadBalancerUnhealthy Boolean
    Enable unhealthy instance replacement. If set to true, AS will replace instances that are found unhealthy in the CLB health check.
    replaceMode String
    Replace mode of unhealthy replacement service. Valid values: RECREATE: Rebuild an instance to replace the original unhealthy instance. RESET: Performing a system reinstallation on unhealthy instances to keep information such as data disks, private IP addresses, and instance IDs unchanged. The instance login settings, HostName, enhanced services, and UserData will remain consistent with the current launch configuration. Default value: RECREATE. Note: This field may return null, indicating that no valid values can be obtained.
    replaceMonitorUnhealthy Boolean
    Enables unhealthy instance replacement. If set to true, AS will replace instances that are flagged as unhealthy by Cloud Monitor.
    retryPolicy String
    Available values for retry policies. Valid values: IMMEDIATE_RETRY and INCREMENTAL_INTERVALS.
    scalingGroupName String
    Name of a scaling group.
    scalingMode String
    Indicates scaling mode which creates and terminates instances (classic method), or method first tries to start stopped instances (wake up stopped) to perform scaling operations. Available values: CLASSIC_SCALING, WAKE_UP_STOPPED_SCALING. Default: CLASSIC_SCALING.
    status String
    Current status of a scaling group.
    subnetIds List<String>
    ID list of subnet, and for VPC it is required.
    tags Map<String>
    Tags of a scaling group.
    terminationPolicies List<String>
    Available values for termination policies. Valid values: OLDEST_INSTANCE and NEWEST_INSTANCE.
    vpcId String
    ID of VPC network.
    zones List<String>
    List of available zones, for Basic network it is required.

    Supporting Types

    AsScalingGroupForwardBalancerId, AsScalingGroupForwardBalancerIdArgs

    ListenerId string
    Listener ID for application load balancers.
    LoadBalancerId string
    ID of available load balancers.
    TargetAttributes List<AsScalingGroupForwardBalancerIdTargetAttribute>
    Attribute list of target rules.
    RuleId string
    ID of forwarding rules.
    ListenerId string
    Listener ID for application load balancers.
    LoadBalancerId string
    ID of available load balancers.
    TargetAttributes []AsScalingGroupForwardBalancerIdTargetAttribute
    Attribute list of target rules.
    RuleId string
    ID of forwarding rules.
    listenerId String
    Listener ID for application load balancers.
    loadBalancerId String
    ID of available load balancers.
    targetAttributes List<AsScalingGroupForwardBalancerIdTargetAttribute>
    Attribute list of target rules.
    ruleId String
    ID of forwarding rules.
    listenerId string
    Listener ID for application load balancers.
    loadBalancerId string
    ID of available load balancers.
    targetAttributes AsScalingGroupForwardBalancerIdTargetAttribute[]
    Attribute list of target rules.
    ruleId string
    ID of forwarding rules.
    listener_id str
    Listener ID for application load balancers.
    load_balancer_id str
    ID of available load balancers.
    target_attributes Sequence[AsScalingGroupForwardBalancerIdTargetAttribute]
    Attribute list of target rules.
    rule_id str
    ID of forwarding rules.
    listenerId String
    Listener ID for application load balancers.
    loadBalancerId String
    ID of available load balancers.
    targetAttributes List<Property Map>
    Attribute list of target rules.
    ruleId String
    ID of forwarding rules.

    AsScalingGroupForwardBalancerIdTargetAttribute, AsScalingGroupForwardBalancerIdTargetAttributeArgs

    Port double
    Port number.
    Weight double
    Weight.
    Port float64
    Port number.
    Weight float64
    Weight.
    port Double
    Port number.
    weight Double
    Weight.
    port number
    Port number.
    weight number
    Weight.
    port float
    Port number.
    weight float
    Weight.
    port Number
    Port number.
    weight Number
    Weight.

    Import

    AutoScaling Groups can be imported using the id, e.g.

    $ pulumi import tencentcloud:index/asScalingGroup:AsScalingGroup example asg-n32ymck2
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack