1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. sae
  5. ApplicationScalingRule
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.sae.ApplicationScalingRule

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

    Provides a Serverless App Engine (SAE) Application Scaling Rule resource.

    For information about Serverless App Engine (SAE) Application Scaling Rule and how to use it, see What is Application Scaling Rule.

    NOTE: Available since v1.159.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    import * as random from "@pulumi/random";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "tf-example";
    const default = alicloud.getRegions({
        current: true,
    });
    const defaultInteger = new random.index.Integer("default", {
        max: 99999,
        min: 10000,
    });
    const defaultGetZones = alicloud.getZones({
        availableResourceCreation: "VSwitch",
    });
    const defaultNetwork = new alicloud.vpc.Network("default", {
        vpcName: name,
        cidrBlock: "10.4.0.0/16",
    });
    const defaultSwitch = new alicloud.vpc.Switch("default", {
        vswitchName: name,
        cidrBlock: "10.4.0.0/24",
        vpcId: defaultNetwork.id,
        zoneId: defaultGetZones.then(defaultGetZones => defaultGetZones.zones?.[0]?.id),
    });
    const defaultSecurityGroup = new alicloud.ecs.SecurityGroup("default", {vpcId: defaultNetwork.id});
    const defaultNamespace = new alicloud.sae.Namespace("default", {
        namespaceId: _default.then(_default => `${_default.regions?.[0]?.id}:example${defaultInteger.result}`),
        namespaceName: name,
        namespaceDescription: name,
        enableMicroRegistration: false,
    });
    const defaultApplication = new alicloud.sae.Application("default", {
        appDescription: name,
        appName: `${name}-${defaultInteger.result}`,
        namespaceId: defaultNamespace.id,
        imageUrl: _default.then(_default => `registry-vpc.${_default.regions?.[0]?.id}.aliyuncs.com/sae-demo-image/consumer:1.0`),
        packageType: "Image",
        securityGroupId: defaultSecurityGroup.id,
        vpcId: defaultNetwork.id,
        vswitchId: defaultSwitch.id,
        timezone: "Asia/Beijing",
        replicas: 5,
        cpu: 500,
        memory: 2048,
    });
    const defaultApplicationScalingRule = new alicloud.sae.ApplicationScalingRule("default", {
        appId: defaultApplication.id,
        scalingRuleName: name,
        scalingRuleEnable: true,
        scalingRuleType: "mix",
        minReadyInstances: 3,
        minReadyInstanceRatio: -1,
        scalingRuleTimer: {
            period: "* * *",
            schedules: [
                {
                    atTime: "08:00",
                    maxReplicas: 10,
                    minReplicas: 3,
                },
                {
                    atTime: "20:00",
                    maxReplicas: 50,
                    minReplicas: 3,
                },
            ],
        },
        scalingRuleMetric: {
            maxReplicas: 50,
            minReplicas: 3,
            metrics: [
                {
                    metricType: "CPU",
                    metricTargetAverageUtilization: 20,
                },
                {
                    metricType: "MEMORY",
                    metricTargetAverageUtilization: 30,
                },
                {
                    metricType: "tcpActiveConn",
                    metricTargetAverageUtilization: 20,
                },
            ],
            scaleUpRules: {
                step: 10,
                disabled: false,
                stabilizationWindowSeconds: 0,
            },
            scaleDownRules: {
                step: 10,
                disabled: false,
                stabilizationWindowSeconds: 10,
            },
        },
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    import pulumi_random as random
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "tf-example"
    default = alicloud.get_regions(current=True)
    default_integer = random.index.Integer("default",
        max=99999,
        min=10000)
    default_get_zones = alicloud.get_zones(available_resource_creation="VSwitch")
    default_network = alicloud.vpc.Network("default",
        vpc_name=name,
        cidr_block="10.4.0.0/16")
    default_switch = alicloud.vpc.Switch("default",
        vswitch_name=name,
        cidr_block="10.4.0.0/24",
        vpc_id=default_network.id,
        zone_id=default_get_zones.zones[0].id)
    default_security_group = alicloud.ecs.SecurityGroup("default", vpc_id=default_network.id)
    default_namespace = alicloud.sae.Namespace("default",
        namespace_id=f"{default.regions[0].id}:example{default_integer['result']}",
        namespace_name=name,
        namespace_description=name,
        enable_micro_registration=False)
    default_application = alicloud.sae.Application("default",
        app_description=name,
        app_name=f"{name}-{default_integer['result']}",
        namespace_id=default_namespace.id,
        image_url=f"registry-vpc.{default.regions[0].id}.aliyuncs.com/sae-demo-image/consumer:1.0",
        package_type="Image",
        security_group_id=default_security_group.id,
        vpc_id=default_network.id,
        vswitch_id=default_switch.id,
        timezone="Asia/Beijing",
        replicas=5,
        cpu=500,
        memory=2048)
    default_application_scaling_rule = alicloud.sae.ApplicationScalingRule("default",
        app_id=default_application.id,
        scaling_rule_name=name,
        scaling_rule_enable=True,
        scaling_rule_type="mix",
        min_ready_instances=3,
        min_ready_instance_ratio=-1,
        scaling_rule_timer={
            "period": "* * *",
            "schedules": [
                {
                    "at_time": "08:00",
                    "max_replicas": 10,
                    "min_replicas": 3,
                },
                {
                    "at_time": "20:00",
                    "max_replicas": 50,
                    "min_replicas": 3,
                },
            ],
        },
        scaling_rule_metric={
            "max_replicas": 50,
            "min_replicas": 3,
            "metrics": [
                {
                    "metric_type": "CPU",
                    "metric_target_average_utilization": 20,
                },
                {
                    "metric_type": "MEMORY",
                    "metric_target_average_utilization": 30,
                },
                {
                    "metric_type": "tcpActiveConn",
                    "metric_target_average_utilization": 20,
                },
            ],
            "scale_up_rules": {
                "step": 10,
                "disabled": False,
                "stabilization_window_seconds": 0,
            },
            "scale_down_rules": {
                "step": 10,
                "disabled": False,
                "stabilization_window_seconds": 10,
            },
        })
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/sae"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
    	"github.com/pulumi/pulumi-random/sdk/v4/go/random"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "tf-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_default, err := alicloud.GetRegions(ctx, &alicloud.GetRegionsArgs{
    			Current: pulumi.BoolRef(true),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		defaultInteger, err := random.NewInteger(ctx, "default", &random.IntegerArgs{
    			Max: 99999,
    			Min: 10000,
    		})
    		if err != nil {
    			return err
    		}
    		defaultGetZones, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
    			AvailableResourceCreation: pulumi.StringRef("VSwitch"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		defaultNetwork, err := vpc.NewNetwork(ctx, "default", &vpc.NetworkArgs{
    			VpcName:   pulumi.String(name),
    			CidrBlock: pulumi.String("10.4.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultSwitch, err := vpc.NewSwitch(ctx, "default", &vpc.SwitchArgs{
    			VswitchName: pulumi.String(name),
    			CidrBlock:   pulumi.String("10.4.0.0/24"),
    			VpcId:       defaultNetwork.ID(),
    			ZoneId:      pulumi.String(defaultGetZones.Zones[0].Id),
    		})
    		if err != nil {
    			return err
    		}
    		defaultSecurityGroup, err := ecs.NewSecurityGroup(ctx, "default", &ecs.SecurityGroupArgs{
    			VpcId: defaultNetwork.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		defaultNamespace, err := sae.NewNamespace(ctx, "default", &sae.NamespaceArgs{
    			NamespaceId:             pulumi.Sprintf("%v:example%v", _default.Regions[0].Id, defaultInteger.Result),
    			NamespaceName:           pulumi.String(name),
    			NamespaceDescription:    pulumi.String(name),
    			EnableMicroRegistration: pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		defaultApplication, err := sae.NewApplication(ctx, "default", &sae.ApplicationArgs{
    			AppDescription:  pulumi.String(name),
    			AppName:         pulumi.Sprintf("%v-%v", name, defaultInteger.Result),
    			NamespaceId:     defaultNamespace.ID(),
    			ImageUrl:        pulumi.Sprintf("registry-vpc.%v.aliyuncs.com/sae-demo-image/consumer:1.0", _default.Regions[0].Id),
    			PackageType:     pulumi.String("Image"),
    			SecurityGroupId: defaultSecurityGroup.ID(),
    			VpcId:           defaultNetwork.ID(),
    			VswitchId:       defaultSwitch.ID(),
    			Timezone:        pulumi.String("Asia/Beijing"),
    			Replicas:        pulumi.Int(5),
    			Cpu:             pulumi.Int(500),
    			Memory:          pulumi.Int(2048),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = sae.NewApplicationScalingRule(ctx, "default", &sae.ApplicationScalingRuleArgs{
    			AppId:                 defaultApplication.ID(),
    			ScalingRuleName:       pulumi.String(name),
    			ScalingRuleEnable:     pulumi.Bool(true),
    			ScalingRuleType:       pulumi.String("mix"),
    			MinReadyInstances:     pulumi.Int(3),
    			MinReadyInstanceRatio: pulumi.Int(-1),
    			ScalingRuleTimer: &sae.ApplicationScalingRuleScalingRuleTimerArgs{
    				Period: pulumi.String("* * *"),
    				Schedules: sae.ApplicationScalingRuleScalingRuleTimerScheduleArray{
    					&sae.ApplicationScalingRuleScalingRuleTimerScheduleArgs{
    						AtTime:      pulumi.String("08:00"),
    						MaxReplicas: pulumi.Int(10),
    						MinReplicas: pulumi.Int(3),
    					},
    					&sae.ApplicationScalingRuleScalingRuleTimerScheduleArgs{
    						AtTime:      pulumi.String("20:00"),
    						MaxReplicas: pulumi.Int(50),
    						MinReplicas: pulumi.Int(3),
    					},
    				},
    			},
    			ScalingRuleMetric: &sae.ApplicationScalingRuleScalingRuleMetricArgs{
    				MaxReplicas: pulumi.Int(50),
    				MinReplicas: pulumi.Int(3),
    				Metrics: sae.ApplicationScalingRuleScalingRuleMetricMetricArray{
    					&sae.ApplicationScalingRuleScalingRuleMetricMetricArgs{
    						MetricType:                     pulumi.String("CPU"),
    						MetricTargetAverageUtilization: pulumi.Int(20),
    					},
    					&sae.ApplicationScalingRuleScalingRuleMetricMetricArgs{
    						MetricType:                     pulumi.String("MEMORY"),
    						MetricTargetAverageUtilization: pulumi.Int(30),
    					},
    					&sae.ApplicationScalingRuleScalingRuleMetricMetricArgs{
    						MetricType:                     pulumi.String("tcpActiveConn"),
    						MetricTargetAverageUtilization: pulumi.Int(20),
    					},
    				},
    				ScaleUpRules: &sae.ApplicationScalingRuleScalingRuleMetricScaleUpRulesArgs{
    					Step:                       pulumi.Int(10),
    					Disabled:                   pulumi.Bool(false),
    					StabilizationWindowSeconds: pulumi.Int(0),
    				},
    				ScaleDownRules: &sae.ApplicationScalingRuleScalingRuleMetricScaleDownRulesArgs{
    					Step:                       pulumi.Int(10),
    					Disabled:                   pulumi.Bool(false),
    					StabilizationWindowSeconds: pulumi.Int(10),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    using Random = Pulumi.Random;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "tf-example";
        var @default = AliCloud.GetRegions.Invoke(new()
        {
            Current = true,
        });
    
        var defaultInteger = new Random.Index.Integer("default", new()
        {
            Max = 99999,
            Min = 10000,
        });
    
        var defaultGetZones = AliCloud.GetZones.Invoke(new()
        {
            AvailableResourceCreation = "VSwitch",
        });
    
        var defaultNetwork = new AliCloud.Vpc.Network("default", new()
        {
            VpcName = name,
            CidrBlock = "10.4.0.0/16",
        });
    
        var defaultSwitch = new AliCloud.Vpc.Switch("default", new()
        {
            VswitchName = name,
            CidrBlock = "10.4.0.0/24",
            VpcId = defaultNetwork.Id,
            ZoneId = defaultGetZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
        });
    
        var defaultSecurityGroup = new AliCloud.Ecs.SecurityGroup("default", new()
        {
            VpcId = defaultNetwork.Id,
        });
    
        var defaultNamespace = new AliCloud.Sae.Namespace("default", new()
        {
            NamespaceId = @default.Apply(@default => $"{@default.Apply(getRegionsResult => getRegionsResult.Regions[0]?.Id)}:example{defaultInteger.Result}"),
            NamespaceName = name,
            NamespaceDescription = name,
            EnableMicroRegistration = false,
        });
    
        var defaultApplication = new AliCloud.Sae.Application("default", new()
        {
            AppDescription = name,
            AppName = $"{name}-{defaultInteger.Result}",
            NamespaceId = defaultNamespace.Id,
            ImageUrl = @default.Apply(@default => $"registry-vpc.{@default.Apply(getRegionsResult => getRegionsResult.Regions[0]?.Id)}.aliyuncs.com/sae-demo-image/consumer:1.0"),
            PackageType = "Image",
            SecurityGroupId = defaultSecurityGroup.Id,
            VpcId = defaultNetwork.Id,
            VswitchId = defaultSwitch.Id,
            Timezone = "Asia/Beijing",
            Replicas = 5,
            Cpu = 500,
            Memory = 2048,
        });
    
        var defaultApplicationScalingRule = new AliCloud.Sae.ApplicationScalingRule("default", new()
        {
            AppId = defaultApplication.Id,
            ScalingRuleName = name,
            ScalingRuleEnable = true,
            ScalingRuleType = "mix",
            MinReadyInstances = 3,
            MinReadyInstanceRatio = -1,
            ScalingRuleTimer = new AliCloud.Sae.Inputs.ApplicationScalingRuleScalingRuleTimerArgs
            {
                Period = "* * *",
                Schedules = new[]
                {
                    new AliCloud.Sae.Inputs.ApplicationScalingRuleScalingRuleTimerScheduleArgs
                    {
                        AtTime = "08:00",
                        MaxReplicas = 10,
                        MinReplicas = 3,
                    },
                    new AliCloud.Sae.Inputs.ApplicationScalingRuleScalingRuleTimerScheduleArgs
                    {
                        AtTime = "20:00",
                        MaxReplicas = 50,
                        MinReplicas = 3,
                    },
                },
            },
            ScalingRuleMetric = new AliCloud.Sae.Inputs.ApplicationScalingRuleScalingRuleMetricArgs
            {
                MaxReplicas = 50,
                MinReplicas = 3,
                Metrics = new[]
                {
                    new AliCloud.Sae.Inputs.ApplicationScalingRuleScalingRuleMetricMetricArgs
                    {
                        MetricType = "CPU",
                        MetricTargetAverageUtilization = 20,
                    },
                    new AliCloud.Sae.Inputs.ApplicationScalingRuleScalingRuleMetricMetricArgs
                    {
                        MetricType = "MEMORY",
                        MetricTargetAverageUtilization = 30,
                    },
                    new AliCloud.Sae.Inputs.ApplicationScalingRuleScalingRuleMetricMetricArgs
                    {
                        MetricType = "tcpActiveConn",
                        MetricTargetAverageUtilization = 20,
                    },
                },
                ScaleUpRules = new AliCloud.Sae.Inputs.ApplicationScalingRuleScalingRuleMetricScaleUpRulesArgs
                {
                    Step = 10,
                    Disabled = false,
                    StabilizationWindowSeconds = 0,
                },
                ScaleDownRules = new AliCloud.Sae.Inputs.ApplicationScalingRuleScalingRuleMetricScaleDownRulesArgs
                {
                    Step = 10,
                    Disabled = false,
                    StabilizationWindowSeconds = 10,
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.AlicloudFunctions;
    import com.pulumi.alicloud.inputs.GetRegionsArgs;
    import com.pulumi.random.integer;
    import com.pulumi.random.IntegerArgs;
    import com.pulumi.alicloud.inputs.GetZonesArgs;
    import com.pulumi.alicloud.vpc.Network;
    import com.pulumi.alicloud.vpc.NetworkArgs;
    import com.pulumi.alicloud.vpc.Switch;
    import com.pulumi.alicloud.vpc.SwitchArgs;
    import com.pulumi.alicloud.ecs.SecurityGroup;
    import com.pulumi.alicloud.ecs.SecurityGroupArgs;
    import com.pulumi.alicloud.sae.Namespace;
    import com.pulumi.alicloud.sae.NamespaceArgs;
    import com.pulumi.alicloud.sae.Application;
    import com.pulumi.alicloud.sae.ApplicationArgs;
    import com.pulumi.alicloud.sae.ApplicationScalingRule;
    import com.pulumi.alicloud.sae.ApplicationScalingRuleArgs;
    import com.pulumi.alicloud.sae.inputs.ApplicationScalingRuleScalingRuleTimerArgs;
    import com.pulumi.alicloud.sae.inputs.ApplicationScalingRuleScalingRuleMetricArgs;
    import com.pulumi.alicloud.sae.inputs.ApplicationScalingRuleScalingRuleMetricScaleUpRulesArgs;
    import com.pulumi.alicloud.sae.inputs.ApplicationScalingRuleScalingRuleMetricScaleDownRulesArgs;
    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 config = ctx.config();
            final var name = config.get("name").orElse("tf-example");
            final var default = AlicloudFunctions.getRegions(GetRegionsArgs.builder()
                .current(true)
                .build());
    
            var defaultInteger = new Integer("defaultInteger", IntegerArgs.builder()
                .max(99999)
                .min(10000)
                .build());
    
            final var defaultGetZones = AlicloudFunctions.getZones(GetZonesArgs.builder()
                .availableResourceCreation("VSwitch")
                .build());
    
            var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
                .vpcName(name)
                .cidrBlock("10.4.0.0/16")
                .build());
    
            var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
                .vswitchName(name)
                .cidrBlock("10.4.0.0/24")
                .vpcId(defaultNetwork.id())
                .zoneId(defaultGetZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
                .build());
    
            var defaultSecurityGroup = new SecurityGroup("defaultSecurityGroup", SecurityGroupArgs.builder()
                .vpcId(defaultNetwork.id())
                .build());
    
            var defaultNamespace = new Namespace("defaultNamespace", NamespaceArgs.builder()
                .namespaceId(String.format("%s:example%s", default_.regions()[0].id(),defaultInteger.result()))
                .namespaceName(name)
                .namespaceDescription(name)
                .enableMicroRegistration(false)
                .build());
    
            var defaultApplication = new Application("defaultApplication", ApplicationArgs.builder()
                .appDescription(name)
                .appName(String.format("%s-%s", name,defaultInteger.result()))
                .namespaceId(defaultNamespace.id())
                .imageUrl(String.format("registry-vpc.%s.aliyuncs.com/sae-demo-image/consumer:1.0", default_.regions()[0].id()))
                .packageType("Image")
                .securityGroupId(defaultSecurityGroup.id())
                .vpcId(defaultNetwork.id())
                .vswitchId(defaultSwitch.id())
                .timezone("Asia/Beijing")
                .replicas("5")
                .cpu("500")
                .memory("2048")
                .build());
    
            var defaultApplicationScalingRule = new ApplicationScalingRule("defaultApplicationScalingRule", ApplicationScalingRuleArgs.builder()
                .appId(defaultApplication.id())
                .scalingRuleName(name)
                .scalingRuleEnable(true)
                .scalingRuleType("mix")
                .minReadyInstances("3")
                .minReadyInstanceRatio("-1")
                .scalingRuleTimer(ApplicationScalingRuleScalingRuleTimerArgs.builder()
                    .period("* * *")
                    .schedules(                
                        ApplicationScalingRuleScalingRuleTimerScheduleArgs.builder()
                            .atTime("08:00")
                            .maxReplicas(10)
                            .minReplicas(3)
                            .build(),
                        ApplicationScalingRuleScalingRuleTimerScheduleArgs.builder()
                            .atTime("20:00")
                            .maxReplicas(50)
                            .minReplicas(3)
                            .build())
                    .build())
                .scalingRuleMetric(ApplicationScalingRuleScalingRuleMetricArgs.builder()
                    .maxReplicas(50)
                    .minReplicas(3)
                    .metrics(                
                        ApplicationScalingRuleScalingRuleMetricMetricArgs.builder()
                            .metricType("CPU")
                            .metricTargetAverageUtilization(20)
                            .build(),
                        ApplicationScalingRuleScalingRuleMetricMetricArgs.builder()
                            .metricType("MEMORY")
                            .metricTargetAverageUtilization(30)
                            .build(),
                        ApplicationScalingRuleScalingRuleMetricMetricArgs.builder()
                            .metricType("tcpActiveConn")
                            .metricTargetAverageUtilization(20)
                            .build())
                    .scaleUpRules(ApplicationScalingRuleScalingRuleMetricScaleUpRulesArgs.builder()
                        .step(10)
                        .disabled(false)
                        .stabilizationWindowSeconds(0)
                        .build())
                    .scaleDownRules(ApplicationScalingRuleScalingRuleMetricScaleDownRulesArgs.builder()
                        .step(10)
                        .disabled(false)
                        .stabilizationWindowSeconds(10)
                        .build())
                    .build())
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: tf-example
    resources:
      defaultInteger:
        type: random:integer
        name: default
        properties:
          max: 99999
          min: 10000
      defaultNetwork:
        type: alicloud:vpc:Network
        name: default
        properties:
          vpcName: ${name}
          cidrBlock: 10.4.0.0/16
      defaultSwitch:
        type: alicloud:vpc:Switch
        name: default
        properties:
          vswitchName: ${name}
          cidrBlock: 10.4.0.0/24
          vpcId: ${defaultNetwork.id}
          zoneId: ${defaultGetZones.zones[0].id}
      defaultSecurityGroup:
        type: alicloud:ecs:SecurityGroup
        name: default
        properties:
          vpcId: ${defaultNetwork.id}
      defaultNamespace:
        type: alicloud:sae:Namespace
        name: default
        properties:
          namespaceId: ${default.regions[0].id}:example${defaultInteger.result}
          namespaceName: ${name}
          namespaceDescription: ${name}
          enableMicroRegistration: false
      defaultApplication:
        type: alicloud:sae:Application
        name: default
        properties:
          appDescription: ${name}
          appName: ${name}-${defaultInteger.result}
          namespaceId: ${defaultNamespace.id}
          imageUrl: registry-vpc.${default.regions[0].id}.aliyuncs.com/sae-demo-image/consumer:1.0
          packageType: Image
          securityGroupId: ${defaultSecurityGroup.id}
          vpcId: ${defaultNetwork.id}
          vswitchId: ${defaultSwitch.id}
          timezone: Asia/Beijing
          replicas: '5'
          cpu: '500'
          memory: '2048'
      defaultApplicationScalingRule:
        type: alicloud:sae:ApplicationScalingRule
        name: default
        properties:
          appId: ${defaultApplication.id}
          scalingRuleName: ${name}
          scalingRuleEnable: true
          scalingRuleType: mix
          minReadyInstances: '3'
          minReadyInstanceRatio: '-1'
          scalingRuleTimer:
            period: '* * *'
            schedules:
              - atTime: 08:00
                maxReplicas: 10
                minReplicas: 3
              - atTime: 20:00
                maxReplicas: 50
                minReplicas: 3
          scalingRuleMetric:
            maxReplicas: 50
            minReplicas: 3
            metrics:
              - metricType: CPU
                metricTargetAverageUtilization: 20
              - metricType: MEMORY
                metricTargetAverageUtilization: 30
              - metricType: tcpActiveConn
                metricTargetAverageUtilization: 20
            scaleUpRules:
              step: 10
              disabled: false
              stabilizationWindowSeconds: 0
            scaleDownRules:
              step: 10
              disabled: false
              stabilizationWindowSeconds: 10
    variables:
      default:
        fn::invoke:
          Function: alicloud:getRegions
          Arguments:
            current: true
      defaultGetZones:
        fn::invoke:
          Function: alicloud:getZones
          Arguments:
            availableResourceCreation: VSwitch
    

    Create ApplicationScalingRule Resource

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

    Constructor syntax

    new ApplicationScalingRule(name: string, args: ApplicationScalingRuleArgs, opts?: CustomResourceOptions);
    @overload
    def ApplicationScalingRule(resource_name: str,
                               args: ApplicationScalingRuleArgs,
                               opts: Optional[ResourceOptions] = None)
    
    @overload
    def ApplicationScalingRule(resource_name: str,
                               opts: Optional[ResourceOptions] = None,
                               app_id: Optional[str] = None,
                               scaling_rule_name: Optional[str] = None,
                               scaling_rule_type: Optional[str] = None,
                               min_ready_instance_ratio: Optional[int] = None,
                               min_ready_instances: Optional[int] = None,
                               scaling_rule_enable: Optional[bool] = None,
                               scaling_rule_metric: Optional[ApplicationScalingRuleScalingRuleMetricArgs] = None,
                               scaling_rule_timer: Optional[ApplicationScalingRuleScalingRuleTimerArgs] = None)
    func NewApplicationScalingRule(ctx *Context, name string, args ApplicationScalingRuleArgs, opts ...ResourceOption) (*ApplicationScalingRule, error)
    public ApplicationScalingRule(string name, ApplicationScalingRuleArgs args, CustomResourceOptions? opts = null)
    public ApplicationScalingRule(String name, ApplicationScalingRuleArgs args)
    public ApplicationScalingRule(String name, ApplicationScalingRuleArgs args, CustomResourceOptions options)
    
    type: alicloud:sae:ApplicationScalingRule
    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 ApplicationScalingRuleArgs
    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 ApplicationScalingRuleArgs
    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 ApplicationScalingRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ApplicationScalingRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ApplicationScalingRuleArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var applicationScalingRuleResource = new AliCloud.Sae.ApplicationScalingRule("applicationScalingRuleResource", new()
    {
        AppId = "string",
        ScalingRuleName = "string",
        ScalingRuleType = "string",
        MinReadyInstanceRatio = 0,
        MinReadyInstances = 0,
        ScalingRuleEnable = false,
        ScalingRuleMetric = new AliCloud.Sae.Inputs.ApplicationScalingRuleScalingRuleMetricArgs
        {
            MaxReplicas = 0,
            Metrics = new[]
            {
                new AliCloud.Sae.Inputs.ApplicationScalingRuleScalingRuleMetricMetricArgs
                {
                    MetricTargetAverageUtilization = 0,
                    MetricType = "string",
                    SlbId = "string",
                    SlbLogStore = "string",
                    SlbProject = "string",
                    Vport = "string",
                },
            },
            MinReplicas = 0,
            ScaleDownRules = new AliCloud.Sae.Inputs.ApplicationScalingRuleScalingRuleMetricScaleDownRulesArgs
            {
                Disabled = false,
                StabilizationWindowSeconds = 0,
                Step = 0,
            },
            ScaleUpRules = new AliCloud.Sae.Inputs.ApplicationScalingRuleScalingRuleMetricScaleUpRulesArgs
            {
                Disabled = false,
                StabilizationWindowSeconds = 0,
                Step = 0,
            },
        },
        ScalingRuleTimer = new AliCloud.Sae.Inputs.ApplicationScalingRuleScalingRuleTimerArgs
        {
            BeginDate = "string",
            EndDate = "string",
            Period = "string",
            Schedules = new[]
            {
                new AliCloud.Sae.Inputs.ApplicationScalingRuleScalingRuleTimerScheduleArgs
                {
                    AtTime = "string",
                    MaxReplicas = 0,
                    MinReplicas = 0,
                    TargetReplicas = 0,
                },
            },
        },
    });
    
    example, err := sae.NewApplicationScalingRule(ctx, "applicationScalingRuleResource", &sae.ApplicationScalingRuleArgs{
    	AppId:                 pulumi.String("string"),
    	ScalingRuleName:       pulumi.String("string"),
    	ScalingRuleType:       pulumi.String("string"),
    	MinReadyInstanceRatio: pulumi.Int(0),
    	MinReadyInstances:     pulumi.Int(0),
    	ScalingRuleEnable:     pulumi.Bool(false),
    	ScalingRuleMetric: &sae.ApplicationScalingRuleScalingRuleMetricArgs{
    		MaxReplicas: pulumi.Int(0),
    		Metrics: sae.ApplicationScalingRuleScalingRuleMetricMetricArray{
    			&sae.ApplicationScalingRuleScalingRuleMetricMetricArgs{
    				MetricTargetAverageUtilization: pulumi.Int(0),
    				MetricType:                     pulumi.String("string"),
    				SlbId:                          pulumi.String("string"),
    				SlbLogStore:                    pulumi.String("string"),
    				SlbProject:                     pulumi.String("string"),
    				Vport:                          pulumi.String("string"),
    			},
    		},
    		MinReplicas: pulumi.Int(0),
    		ScaleDownRules: &sae.ApplicationScalingRuleScalingRuleMetricScaleDownRulesArgs{
    			Disabled:                   pulumi.Bool(false),
    			StabilizationWindowSeconds: pulumi.Int(0),
    			Step:                       pulumi.Int(0),
    		},
    		ScaleUpRules: &sae.ApplicationScalingRuleScalingRuleMetricScaleUpRulesArgs{
    			Disabled:                   pulumi.Bool(false),
    			StabilizationWindowSeconds: pulumi.Int(0),
    			Step:                       pulumi.Int(0),
    		},
    	},
    	ScalingRuleTimer: &sae.ApplicationScalingRuleScalingRuleTimerArgs{
    		BeginDate: pulumi.String("string"),
    		EndDate:   pulumi.String("string"),
    		Period:    pulumi.String("string"),
    		Schedules: sae.ApplicationScalingRuleScalingRuleTimerScheduleArray{
    			&sae.ApplicationScalingRuleScalingRuleTimerScheduleArgs{
    				AtTime:         pulumi.String("string"),
    				MaxReplicas:    pulumi.Int(0),
    				MinReplicas:    pulumi.Int(0),
    				TargetReplicas: pulumi.Int(0),
    			},
    		},
    	},
    })
    
    var applicationScalingRuleResource = new ApplicationScalingRule("applicationScalingRuleResource", ApplicationScalingRuleArgs.builder()
        .appId("string")
        .scalingRuleName("string")
        .scalingRuleType("string")
        .minReadyInstanceRatio(0)
        .minReadyInstances(0)
        .scalingRuleEnable(false)
        .scalingRuleMetric(ApplicationScalingRuleScalingRuleMetricArgs.builder()
            .maxReplicas(0)
            .metrics(ApplicationScalingRuleScalingRuleMetricMetricArgs.builder()
                .metricTargetAverageUtilization(0)
                .metricType("string")
                .slbId("string")
                .slbLogStore("string")
                .slbProject("string")
                .vport("string")
                .build())
            .minReplicas(0)
            .scaleDownRules(ApplicationScalingRuleScalingRuleMetricScaleDownRulesArgs.builder()
                .disabled(false)
                .stabilizationWindowSeconds(0)
                .step(0)
                .build())
            .scaleUpRules(ApplicationScalingRuleScalingRuleMetricScaleUpRulesArgs.builder()
                .disabled(false)
                .stabilizationWindowSeconds(0)
                .step(0)
                .build())
            .build())
        .scalingRuleTimer(ApplicationScalingRuleScalingRuleTimerArgs.builder()
            .beginDate("string")
            .endDate("string")
            .period("string")
            .schedules(ApplicationScalingRuleScalingRuleTimerScheduleArgs.builder()
                .atTime("string")
                .maxReplicas(0)
                .minReplicas(0)
                .targetReplicas(0)
                .build())
            .build())
        .build());
    
    application_scaling_rule_resource = alicloud.sae.ApplicationScalingRule("applicationScalingRuleResource",
        app_id="string",
        scaling_rule_name="string",
        scaling_rule_type="string",
        min_ready_instance_ratio=0,
        min_ready_instances=0,
        scaling_rule_enable=False,
        scaling_rule_metric={
            "max_replicas": 0,
            "metrics": [{
                "metric_target_average_utilization": 0,
                "metric_type": "string",
                "slb_id": "string",
                "slb_log_store": "string",
                "slb_project": "string",
                "vport": "string",
            }],
            "min_replicas": 0,
            "scale_down_rules": {
                "disabled": False,
                "stabilization_window_seconds": 0,
                "step": 0,
            },
            "scale_up_rules": {
                "disabled": False,
                "stabilization_window_seconds": 0,
                "step": 0,
            },
        },
        scaling_rule_timer={
            "begin_date": "string",
            "end_date": "string",
            "period": "string",
            "schedules": [{
                "at_time": "string",
                "max_replicas": 0,
                "min_replicas": 0,
                "target_replicas": 0,
            }],
        })
    
    const applicationScalingRuleResource = new alicloud.sae.ApplicationScalingRule("applicationScalingRuleResource", {
        appId: "string",
        scalingRuleName: "string",
        scalingRuleType: "string",
        minReadyInstanceRatio: 0,
        minReadyInstances: 0,
        scalingRuleEnable: false,
        scalingRuleMetric: {
            maxReplicas: 0,
            metrics: [{
                metricTargetAverageUtilization: 0,
                metricType: "string",
                slbId: "string",
                slbLogStore: "string",
                slbProject: "string",
                vport: "string",
            }],
            minReplicas: 0,
            scaleDownRules: {
                disabled: false,
                stabilizationWindowSeconds: 0,
                step: 0,
            },
            scaleUpRules: {
                disabled: false,
                stabilizationWindowSeconds: 0,
                step: 0,
            },
        },
        scalingRuleTimer: {
            beginDate: "string",
            endDate: "string",
            period: "string",
            schedules: [{
                atTime: "string",
                maxReplicas: 0,
                minReplicas: 0,
                targetReplicas: 0,
            }],
        },
    });
    
    type: alicloud:sae:ApplicationScalingRule
    properties:
        appId: string
        minReadyInstanceRatio: 0
        minReadyInstances: 0
        scalingRuleEnable: false
        scalingRuleMetric:
            maxReplicas: 0
            metrics:
                - metricTargetAverageUtilization: 0
                  metricType: string
                  slbId: string
                  slbLogStore: string
                  slbProject: string
                  vport: string
            minReplicas: 0
            scaleDownRules:
                disabled: false
                stabilizationWindowSeconds: 0
                step: 0
            scaleUpRules:
                disabled: false
                stabilizationWindowSeconds: 0
                step: 0
        scalingRuleName: string
        scalingRuleTimer:
            beginDate: string
            endDate: string
            period: string
            schedules:
                - atTime: string
                  maxReplicas: 0
                  minReplicas: 0
                  targetReplicas: 0
        scalingRuleType: string
    

    ApplicationScalingRule 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 ApplicationScalingRule resource accepts the following input properties:

    AppId string
    Application ID.
    ScalingRuleName string
    The name of a custom elastic scaling policy. In the application, the policy name cannot be repeated. It must start with a lowercase letter, and can only contain lowercase letters, numbers, and dashes (-), and no more than 32 characters. After the scaling policy is successfully created, the policy name cannot be modified.
    ScalingRuleType string
    Flexible strategy type. Valid values: mix, timing and metric.
    MinReadyInstanceRatio int
    The min ready instance ratio.
    MinReadyInstances int
    The min ready instances.
    ScalingRuleEnable bool
    True whether the auto scaling policy is enabled. The value description is as follows: true: enabled state. false: disabled status. Valid values: false, true.
    ScalingRuleMetric Pulumi.AliCloud.Sae.Inputs.ApplicationScalingRuleScalingRuleMetric
    Monitor the configuration of the indicator elasticity strategy. See scaling_rule_metric below.
    ScalingRuleTimer Pulumi.AliCloud.Sae.Inputs.ApplicationScalingRuleScalingRuleTimer
    Configuration of Timing Resilient Policies. See scaling_rule_timer below.
    AppId string
    Application ID.
    ScalingRuleName string
    The name of a custom elastic scaling policy. In the application, the policy name cannot be repeated. It must start with a lowercase letter, and can only contain lowercase letters, numbers, and dashes (-), and no more than 32 characters. After the scaling policy is successfully created, the policy name cannot be modified.
    ScalingRuleType string
    Flexible strategy type. Valid values: mix, timing and metric.
    MinReadyInstanceRatio int
    The min ready instance ratio.
    MinReadyInstances int
    The min ready instances.
    ScalingRuleEnable bool
    True whether the auto scaling policy is enabled. The value description is as follows: true: enabled state. false: disabled status. Valid values: false, true.
    ScalingRuleMetric ApplicationScalingRuleScalingRuleMetricArgs
    Monitor the configuration of the indicator elasticity strategy. See scaling_rule_metric below.
    ScalingRuleTimer ApplicationScalingRuleScalingRuleTimerArgs
    Configuration of Timing Resilient Policies. See scaling_rule_timer below.
    appId String
    Application ID.
    scalingRuleName String
    The name of a custom elastic scaling policy. In the application, the policy name cannot be repeated. It must start with a lowercase letter, and can only contain lowercase letters, numbers, and dashes (-), and no more than 32 characters. After the scaling policy is successfully created, the policy name cannot be modified.
    scalingRuleType String
    Flexible strategy type. Valid values: mix, timing and metric.
    minReadyInstanceRatio Integer
    The min ready instance ratio.
    minReadyInstances Integer
    The min ready instances.
    scalingRuleEnable Boolean
    True whether the auto scaling policy is enabled. The value description is as follows: true: enabled state. false: disabled status. Valid values: false, true.
    scalingRuleMetric ApplicationScalingRuleScalingRuleMetric
    Monitor the configuration of the indicator elasticity strategy. See scaling_rule_metric below.
    scalingRuleTimer ApplicationScalingRuleScalingRuleTimer
    Configuration of Timing Resilient Policies. See scaling_rule_timer below.
    appId string
    Application ID.
    scalingRuleName string
    The name of a custom elastic scaling policy. In the application, the policy name cannot be repeated. It must start with a lowercase letter, and can only contain lowercase letters, numbers, and dashes (-), and no more than 32 characters. After the scaling policy is successfully created, the policy name cannot be modified.
    scalingRuleType string
    Flexible strategy type. Valid values: mix, timing and metric.
    minReadyInstanceRatio number
    The min ready instance ratio.
    minReadyInstances number
    The min ready instances.
    scalingRuleEnable boolean
    True whether the auto scaling policy is enabled. The value description is as follows: true: enabled state. false: disabled status. Valid values: false, true.
    scalingRuleMetric ApplicationScalingRuleScalingRuleMetric
    Monitor the configuration of the indicator elasticity strategy. See scaling_rule_metric below.
    scalingRuleTimer ApplicationScalingRuleScalingRuleTimer
    Configuration of Timing Resilient Policies. See scaling_rule_timer below.
    app_id str
    Application ID.
    scaling_rule_name str
    The name of a custom elastic scaling policy. In the application, the policy name cannot be repeated. It must start with a lowercase letter, and can only contain lowercase letters, numbers, and dashes (-), and no more than 32 characters. After the scaling policy is successfully created, the policy name cannot be modified.
    scaling_rule_type str
    Flexible strategy type. Valid values: mix, timing and metric.
    min_ready_instance_ratio int
    The min ready instance ratio.
    min_ready_instances int
    The min ready instances.
    scaling_rule_enable bool
    True whether the auto scaling policy is enabled. The value description is as follows: true: enabled state. false: disabled status. Valid values: false, true.
    scaling_rule_metric ApplicationScalingRuleScalingRuleMetricArgs
    Monitor the configuration of the indicator elasticity strategy. See scaling_rule_metric below.
    scaling_rule_timer ApplicationScalingRuleScalingRuleTimerArgs
    Configuration of Timing Resilient Policies. See scaling_rule_timer below.
    appId String
    Application ID.
    scalingRuleName String
    The name of a custom elastic scaling policy. In the application, the policy name cannot be repeated. It must start with a lowercase letter, and can only contain lowercase letters, numbers, and dashes (-), and no more than 32 characters. After the scaling policy is successfully created, the policy name cannot be modified.
    scalingRuleType String
    Flexible strategy type. Valid values: mix, timing and metric.
    minReadyInstanceRatio Number
    The min ready instance ratio.
    minReadyInstances Number
    The min ready instances.
    scalingRuleEnable Boolean
    True whether the auto scaling policy is enabled. The value description is as follows: true: enabled state. false: disabled status. Valid values: false, true.
    scalingRuleMetric Property Map
    Monitor the configuration of the indicator elasticity strategy. See scaling_rule_metric below.
    scalingRuleTimer Property Map
    Configuration of Timing Resilient Policies. See scaling_rule_timer below.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ApplicationScalingRule Resource

    Get an existing ApplicationScalingRule 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?: ApplicationScalingRuleState, opts?: CustomResourceOptions): ApplicationScalingRule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            app_id: Optional[str] = None,
            min_ready_instance_ratio: Optional[int] = None,
            min_ready_instances: Optional[int] = None,
            scaling_rule_enable: Optional[bool] = None,
            scaling_rule_metric: Optional[ApplicationScalingRuleScalingRuleMetricArgs] = None,
            scaling_rule_name: Optional[str] = None,
            scaling_rule_timer: Optional[ApplicationScalingRuleScalingRuleTimerArgs] = None,
            scaling_rule_type: Optional[str] = None) -> ApplicationScalingRule
    func GetApplicationScalingRule(ctx *Context, name string, id IDInput, state *ApplicationScalingRuleState, opts ...ResourceOption) (*ApplicationScalingRule, error)
    public static ApplicationScalingRule Get(string name, Input<string> id, ApplicationScalingRuleState? state, CustomResourceOptions? opts = null)
    public static ApplicationScalingRule get(String name, Output<String> id, ApplicationScalingRuleState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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:
    AppId string
    Application ID.
    MinReadyInstanceRatio int
    The min ready instance ratio.
    MinReadyInstances int
    The min ready instances.
    ScalingRuleEnable bool
    True whether the auto scaling policy is enabled. The value description is as follows: true: enabled state. false: disabled status. Valid values: false, true.
    ScalingRuleMetric Pulumi.AliCloud.Sae.Inputs.ApplicationScalingRuleScalingRuleMetric
    Monitor the configuration of the indicator elasticity strategy. See scaling_rule_metric below.
    ScalingRuleName string
    The name of a custom elastic scaling policy. In the application, the policy name cannot be repeated. It must start with a lowercase letter, and can only contain lowercase letters, numbers, and dashes (-), and no more than 32 characters. After the scaling policy is successfully created, the policy name cannot be modified.
    ScalingRuleTimer Pulumi.AliCloud.Sae.Inputs.ApplicationScalingRuleScalingRuleTimer
    Configuration of Timing Resilient Policies. See scaling_rule_timer below.
    ScalingRuleType string
    Flexible strategy type. Valid values: mix, timing and metric.
    AppId string
    Application ID.
    MinReadyInstanceRatio int
    The min ready instance ratio.
    MinReadyInstances int
    The min ready instances.
    ScalingRuleEnable bool
    True whether the auto scaling policy is enabled. The value description is as follows: true: enabled state. false: disabled status. Valid values: false, true.
    ScalingRuleMetric ApplicationScalingRuleScalingRuleMetricArgs
    Monitor the configuration of the indicator elasticity strategy. See scaling_rule_metric below.
    ScalingRuleName string
    The name of a custom elastic scaling policy. In the application, the policy name cannot be repeated. It must start with a lowercase letter, and can only contain lowercase letters, numbers, and dashes (-), and no more than 32 characters. After the scaling policy is successfully created, the policy name cannot be modified.
    ScalingRuleTimer ApplicationScalingRuleScalingRuleTimerArgs
    Configuration of Timing Resilient Policies. See scaling_rule_timer below.
    ScalingRuleType string
    Flexible strategy type. Valid values: mix, timing and metric.
    appId String
    Application ID.
    minReadyInstanceRatio Integer
    The min ready instance ratio.
    minReadyInstances Integer
    The min ready instances.
    scalingRuleEnable Boolean
    True whether the auto scaling policy is enabled. The value description is as follows: true: enabled state. false: disabled status. Valid values: false, true.
    scalingRuleMetric ApplicationScalingRuleScalingRuleMetric
    Monitor the configuration of the indicator elasticity strategy. See scaling_rule_metric below.
    scalingRuleName String
    The name of a custom elastic scaling policy. In the application, the policy name cannot be repeated. It must start with a lowercase letter, and can only contain lowercase letters, numbers, and dashes (-), and no more than 32 characters. After the scaling policy is successfully created, the policy name cannot be modified.
    scalingRuleTimer ApplicationScalingRuleScalingRuleTimer
    Configuration of Timing Resilient Policies. See scaling_rule_timer below.
    scalingRuleType String
    Flexible strategy type. Valid values: mix, timing and metric.
    appId string
    Application ID.
    minReadyInstanceRatio number
    The min ready instance ratio.
    minReadyInstances number
    The min ready instances.
    scalingRuleEnable boolean
    True whether the auto scaling policy is enabled. The value description is as follows: true: enabled state. false: disabled status. Valid values: false, true.
    scalingRuleMetric ApplicationScalingRuleScalingRuleMetric
    Monitor the configuration of the indicator elasticity strategy. See scaling_rule_metric below.
    scalingRuleName string
    The name of a custom elastic scaling policy. In the application, the policy name cannot be repeated. It must start with a lowercase letter, and can only contain lowercase letters, numbers, and dashes (-), and no more than 32 characters. After the scaling policy is successfully created, the policy name cannot be modified.
    scalingRuleTimer ApplicationScalingRuleScalingRuleTimer
    Configuration of Timing Resilient Policies. See scaling_rule_timer below.
    scalingRuleType string
    Flexible strategy type. Valid values: mix, timing and metric.
    app_id str
    Application ID.
    min_ready_instance_ratio int
    The min ready instance ratio.
    min_ready_instances int
    The min ready instances.
    scaling_rule_enable bool
    True whether the auto scaling policy is enabled. The value description is as follows: true: enabled state. false: disabled status. Valid values: false, true.
    scaling_rule_metric ApplicationScalingRuleScalingRuleMetricArgs
    Monitor the configuration of the indicator elasticity strategy. See scaling_rule_metric below.
    scaling_rule_name str
    The name of a custom elastic scaling policy. In the application, the policy name cannot be repeated. It must start with a lowercase letter, and can only contain lowercase letters, numbers, and dashes (-), and no more than 32 characters. After the scaling policy is successfully created, the policy name cannot be modified.
    scaling_rule_timer ApplicationScalingRuleScalingRuleTimerArgs
    Configuration of Timing Resilient Policies. See scaling_rule_timer below.
    scaling_rule_type str
    Flexible strategy type. Valid values: mix, timing and metric.
    appId String
    Application ID.
    minReadyInstanceRatio Number
    The min ready instance ratio.
    minReadyInstances Number
    The min ready instances.
    scalingRuleEnable Boolean
    True whether the auto scaling policy is enabled. The value description is as follows: true: enabled state. false: disabled status. Valid values: false, true.
    scalingRuleMetric Property Map
    Monitor the configuration of the indicator elasticity strategy. See scaling_rule_metric below.
    scalingRuleName String
    The name of a custom elastic scaling policy. In the application, the policy name cannot be repeated. It must start with a lowercase letter, and can only contain lowercase letters, numbers, and dashes (-), and no more than 32 characters. After the scaling policy is successfully created, the policy name cannot be modified.
    scalingRuleTimer Property Map
    Configuration of Timing Resilient Policies. See scaling_rule_timer below.
    scalingRuleType String
    Flexible strategy type. Valid values: mix, timing and metric.

    Supporting Types

    ApplicationScalingRuleScalingRuleMetric, ApplicationScalingRuleScalingRuleMetricArgs

    MaxReplicas int
    Maximum number of instances applied.
    Metrics List<Pulumi.AliCloud.Sae.Inputs.ApplicationScalingRuleScalingRuleMetricMetric>
    Indicator rule configuration. See metrics below.
    MinReplicas int
    Minimum number of instances applied.
    ScaleDownRules Pulumi.AliCloud.Sae.Inputs.ApplicationScalingRuleScalingRuleMetricScaleDownRules
    Apply shrink rules. See scale_down_rules below.
    ScaleUpRules Pulumi.AliCloud.Sae.Inputs.ApplicationScalingRuleScalingRuleMetricScaleUpRules
    Apply expansion rules. See scale_up_rules below.
    MaxReplicas int
    Maximum number of instances applied.
    Metrics []ApplicationScalingRuleScalingRuleMetricMetric
    Indicator rule configuration. See metrics below.
    MinReplicas int
    Minimum number of instances applied.
    ScaleDownRules ApplicationScalingRuleScalingRuleMetricScaleDownRules
    Apply shrink rules. See scale_down_rules below.
    ScaleUpRules ApplicationScalingRuleScalingRuleMetricScaleUpRules
    Apply expansion rules. See scale_up_rules below.
    maxReplicas Integer
    Maximum number of instances applied.
    metrics List<ApplicationScalingRuleScalingRuleMetricMetric>
    Indicator rule configuration. See metrics below.
    minReplicas Integer
    Minimum number of instances applied.
    scaleDownRules ApplicationScalingRuleScalingRuleMetricScaleDownRules
    Apply shrink rules. See scale_down_rules below.
    scaleUpRules ApplicationScalingRuleScalingRuleMetricScaleUpRules
    Apply expansion rules. See scale_up_rules below.
    maxReplicas number
    Maximum number of instances applied.
    metrics ApplicationScalingRuleScalingRuleMetricMetric[]
    Indicator rule configuration. See metrics below.
    minReplicas number
    Minimum number of instances applied.
    scaleDownRules ApplicationScalingRuleScalingRuleMetricScaleDownRules
    Apply shrink rules. See scale_down_rules below.
    scaleUpRules ApplicationScalingRuleScalingRuleMetricScaleUpRules
    Apply expansion rules. See scale_up_rules below.
    max_replicas int
    Maximum number of instances applied.
    metrics Sequence[ApplicationScalingRuleScalingRuleMetricMetric]
    Indicator rule configuration. See metrics below.
    min_replicas int
    Minimum number of instances applied.
    scale_down_rules ApplicationScalingRuleScalingRuleMetricScaleDownRules
    Apply shrink rules. See scale_down_rules below.
    scale_up_rules ApplicationScalingRuleScalingRuleMetricScaleUpRules
    Apply expansion rules. See scale_up_rules below.
    maxReplicas Number
    Maximum number of instances applied.
    metrics List<Property Map>
    Indicator rule configuration. See metrics below.
    minReplicas Number
    Minimum number of instances applied.
    scaleDownRules Property Map
    Apply shrink rules. See scale_down_rules below.
    scaleUpRules Property Map
    Apply expansion rules. See scale_up_rules below.

    ApplicationScalingRuleScalingRuleMetricMetric, ApplicationScalingRuleScalingRuleMetricMetricArgs

    MetricTargetAverageUtilization int
    According to different metric_type, set the target value of the corresponding monitoring index.
    MetricType string
    Monitoring indicator trigger condition. Valid values: CPU, MEMORY, tcpActiveConn, QPS, RT, SLB_QPS, SLB_RT, INTRANET_SLB_QPS and INTRANET_SLB_RT. The values are described as follows:

    • CPU: CPU usage.
    • MEMORY: MEMORY usage.
    • tcpActiveConn: The average number of TCP active connections for a single instance in 30 seconds.
    • QPS: The average QPS of a single instance within 1 minute of JAVA application.
    • RT: The average response time of all service interfaces within 1 minute of JAVA application.
    • SLB_QPS: The average public network SLB QPS of a single instance within 15 seconds.
    • SLB_RT: The average response time of public network SLB within 15 seconds.
    • INTRANET_SLB_QPS: The average private network SLB QPS of a single instance within 15 seconds.
    • INTRANET_SLB_RT: The average response time of private network SLB within 15 seconds. NOTE: From version 1.206.0, metric_type can be set to QPS, RT, INTRANET_SLB_QPS, INTRANET_SLB_RT.
    SlbId string
    SLB ID.
    SlbLogStore string
    The log store of the Log Service.
    SlbProject string
    The project of the Log Service.
    Vport string
    SLB listening port.
    MetricTargetAverageUtilization int
    According to different metric_type, set the target value of the corresponding monitoring index.
    MetricType string
    Monitoring indicator trigger condition. Valid values: CPU, MEMORY, tcpActiveConn, QPS, RT, SLB_QPS, SLB_RT, INTRANET_SLB_QPS and INTRANET_SLB_RT. The values are described as follows:

    • CPU: CPU usage.
    • MEMORY: MEMORY usage.
    • tcpActiveConn: The average number of TCP active connections for a single instance in 30 seconds.
    • QPS: The average QPS of a single instance within 1 minute of JAVA application.
    • RT: The average response time of all service interfaces within 1 minute of JAVA application.
    • SLB_QPS: The average public network SLB QPS of a single instance within 15 seconds.
    • SLB_RT: The average response time of public network SLB within 15 seconds.
    • INTRANET_SLB_QPS: The average private network SLB QPS of a single instance within 15 seconds.
    • INTRANET_SLB_RT: The average response time of private network SLB within 15 seconds. NOTE: From version 1.206.0, metric_type can be set to QPS, RT, INTRANET_SLB_QPS, INTRANET_SLB_RT.
    SlbId string
    SLB ID.
    SlbLogStore string
    The log store of the Log Service.
    SlbProject string
    The project of the Log Service.
    Vport string
    SLB listening port.
    metricTargetAverageUtilization Integer
    According to different metric_type, set the target value of the corresponding monitoring index.
    metricType String
    Monitoring indicator trigger condition. Valid values: CPU, MEMORY, tcpActiveConn, QPS, RT, SLB_QPS, SLB_RT, INTRANET_SLB_QPS and INTRANET_SLB_RT. The values are described as follows:

    • CPU: CPU usage.
    • MEMORY: MEMORY usage.
    • tcpActiveConn: The average number of TCP active connections for a single instance in 30 seconds.
    • QPS: The average QPS of a single instance within 1 minute of JAVA application.
    • RT: The average response time of all service interfaces within 1 minute of JAVA application.
    • SLB_QPS: The average public network SLB QPS of a single instance within 15 seconds.
    • SLB_RT: The average response time of public network SLB within 15 seconds.
    • INTRANET_SLB_QPS: The average private network SLB QPS of a single instance within 15 seconds.
    • INTRANET_SLB_RT: The average response time of private network SLB within 15 seconds. NOTE: From version 1.206.0, metric_type can be set to QPS, RT, INTRANET_SLB_QPS, INTRANET_SLB_RT.
    slbId String
    SLB ID.
    slbLogStore String
    The log store of the Log Service.
    slbProject String
    The project of the Log Service.
    vport String
    SLB listening port.
    metricTargetAverageUtilization number
    According to different metric_type, set the target value of the corresponding monitoring index.
    metricType string
    Monitoring indicator trigger condition. Valid values: CPU, MEMORY, tcpActiveConn, QPS, RT, SLB_QPS, SLB_RT, INTRANET_SLB_QPS and INTRANET_SLB_RT. The values are described as follows:

    • CPU: CPU usage.
    • MEMORY: MEMORY usage.
    • tcpActiveConn: The average number of TCP active connections for a single instance in 30 seconds.
    • QPS: The average QPS of a single instance within 1 minute of JAVA application.
    • RT: The average response time of all service interfaces within 1 minute of JAVA application.
    • SLB_QPS: The average public network SLB QPS of a single instance within 15 seconds.
    • SLB_RT: The average response time of public network SLB within 15 seconds.
    • INTRANET_SLB_QPS: The average private network SLB QPS of a single instance within 15 seconds.
    • INTRANET_SLB_RT: The average response time of private network SLB within 15 seconds. NOTE: From version 1.206.0, metric_type can be set to QPS, RT, INTRANET_SLB_QPS, INTRANET_SLB_RT.
    slbId string
    SLB ID.
    slbLogStore string
    The log store of the Log Service.
    slbProject string
    The project of the Log Service.
    vport string
    SLB listening port.
    metric_target_average_utilization int
    According to different metric_type, set the target value of the corresponding monitoring index.
    metric_type str
    Monitoring indicator trigger condition. Valid values: CPU, MEMORY, tcpActiveConn, QPS, RT, SLB_QPS, SLB_RT, INTRANET_SLB_QPS and INTRANET_SLB_RT. The values are described as follows:

    • CPU: CPU usage.
    • MEMORY: MEMORY usage.
    • tcpActiveConn: The average number of TCP active connections for a single instance in 30 seconds.
    • QPS: The average QPS of a single instance within 1 minute of JAVA application.
    • RT: The average response time of all service interfaces within 1 minute of JAVA application.
    • SLB_QPS: The average public network SLB QPS of a single instance within 15 seconds.
    • SLB_RT: The average response time of public network SLB within 15 seconds.
    • INTRANET_SLB_QPS: The average private network SLB QPS of a single instance within 15 seconds.
    • INTRANET_SLB_RT: The average response time of private network SLB within 15 seconds. NOTE: From version 1.206.0, metric_type can be set to QPS, RT, INTRANET_SLB_QPS, INTRANET_SLB_RT.
    slb_id str
    SLB ID.
    slb_log_store str
    The log store of the Log Service.
    slb_project str
    The project of the Log Service.
    vport str
    SLB listening port.
    metricTargetAverageUtilization Number
    According to different metric_type, set the target value of the corresponding monitoring index.
    metricType String
    Monitoring indicator trigger condition. Valid values: CPU, MEMORY, tcpActiveConn, QPS, RT, SLB_QPS, SLB_RT, INTRANET_SLB_QPS and INTRANET_SLB_RT. The values are described as follows:

    • CPU: CPU usage.
    • MEMORY: MEMORY usage.
    • tcpActiveConn: The average number of TCP active connections for a single instance in 30 seconds.
    • QPS: The average QPS of a single instance within 1 minute of JAVA application.
    • RT: The average response time of all service interfaces within 1 minute of JAVA application.
    • SLB_QPS: The average public network SLB QPS of a single instance within 15 seconds.
    • SLB_RT: The average response time of public network SLB within 15 seconds.
    • INTRANET_SLB_QPS: The average private network SLB QPS of a single instance within 15 seconds.
    • INTRANET_SLB_RT: The average response time of private network SLB within 15 seconds. NOTE: From version 1.206.0, metric_type can be set to QPS, RT, INTRANET_SLB_QPS, INTRANET_SLB_RT.
    slbId String
    SLB ID.
    slbLogStore String
    The log store of the Log Service.
    slbProject String
    The project of the Log Service.
    vport String
    SLB listening port.

    ApplicationScalingRuleScalingRuleMetricScaleDownRules, ApplicationScalingRuleScalingRuleMetricScaleDownRulesArgs

    Disabled bool
    Whether shrinkage is prohibited.
    StabilizationWindowSeconds int
    Cooling time for expansion or contraction. Valid values: 0 to 3600. Unit: seconds. The default is 0 seconds.
    Step int
    Elastic expansion or contraction step size. the maximum number of instances to be scaled in per unit time.
    Disabled bool
    Whether shrinkage is prohibited.
    StabilizationWindowSeconds int
    Cooling time for expansion or contraction. Valid values: 0 to 3600. Unit: seconds. The default is 0 seconds.
    Step int
    Elastic expansion or contraction step size. the maximum number of instances to be scaled in per unit time.
    disabled Boolean
    Whether shrinkage is prohibited.
    stabilizationWindowSeconds Integer
    Cooling time for expansion or contraction. Valid values: 0 to 3600. Unit: seconds. The default is 0 seconds.
    step Integer
    Elastic expansion or contraction step size. the maximum number of instances to be scaled in per unit time.
    disabled boolean
    Whether shrinkage is prohibited.
    stabilizationWindowSeconds number
    Cooling time for expansion or contraction. Valid values: 0 to 3600. Unit: seconds. The default is 0 seconds.
    step number
    Elastic expansion or contraction step size. the maximum number of instances to be scaled in per unit time.
    disabled bool
    Whether shrinkage is prohibited.
    stabilization_window_seconds int
    Cooling time for expansion or contraction. Valid values: 0 to 3600. Unit: seconds. The default is 0 seconds.
    step int
    Elastic expansion or contraction step size. the maximum number of instances to be scaled in per unit time.
    disabled Boolean
    Whether shrinkage is prohibited.
    stabilizationWindowSeconds Number
    Cooling time for expansion or contraction. Valid values: 0 to 3600. Unit: seconds. The default is 0 seconds.
    step Number
    Elastic expansion or contraction step size. the maximum number of instances to be scaled in per unit time.

    ApplicationScalingRuleScalingRuleMetricScaleUpRules, ApplicationScalingRuleScalingRuleMetricScaleUpRulesArgs

    Disabled bool
    Whether shrinkage is prohibited.
    StabilizationWindowSeconds int
    Cooling time for expansion or contraction. Valid values: 0 to 3600. Unit: seconds. The default is 0 seconds.
    Step int
    Elastic expansion or contraction step size. the maximum number of instances to be scaled in per unit time.
    Disabled bool
    Whether shrinkage is prohibited.
    StabilizationWindowSeconds int
    Cooling time for expansion or contraction. Valid values: 0 to 3600. Unit: seconds. The default is 0 seconds.
    Step int
    Elastic expansion or contraction step size. the maximum number of instances to be scaled in per unit time.
    disabled Boolean
    Whether shrinkage is prohibited.
    stabilizationWindowSeconds Integer
    Cooling time for expansion or contraction. Valid values: 0 to 3600. Unit: seconds. The default is 0 seconds.
    step Integer
    Elastic expansion or contraction step size. the maximum number of instances to be scaled in per unit time.
    disabled boolean
    Whether shrinkage is prohibited.
    stabilizationWindowSeconds number
    Cooling time for expansion or contraction. Valid values: 0 to 3600. Unit: seconds. The default is 0 seconds.
    step number
    Elastic expansion or contraction step size. the maximum number of instances to be scaled in per unit time.
    disabled bool
    Whether shrinkage is prohibited.
    stabilization_window_seconds int
    Cooling time for expansion or contraction. Valid values: 0 to 3600. Unit: seconds. The default is 0 seconds.
    step int
    Elastic expansion or contraction step size. the maximum number of instances to be scaled in per unit time.
    disabled Boolean
    Whether shrinkage is prohibited.
    stabilizationWindowSeconds Number
    Cooling time for expansion or contraction. Valid values: 0 to 3600. Unit: seconds. The default is 0 seconds.
    step Number
    Elastic expansion or contraction step size. the maximum number of instances to be scaled in per unit time.

    ApplicationScalingRuleScalingRuleTimer, ApplicationScalingRuleScalingRuleTimerArgs

    BeginDate string
    The Start date. When the begin_date and end_date values are empty. it indicates long-term execution and is the default value.
    EndDate string
    The End Date. When the begin_date and end_date values are empty. it indicates long-term execution and is the default value.
    Period string
    The period in which a timed elastic scaling strategy is executed.
    Schedules List<Pulumi.AliCloud.Sae.Inputs.ApplicationScalingRuleScalingRuleTimerSchedule>
    Resilient Scaling Strategy Trigger Timing. See schedules below.
    BeginDate string
    The Start date. When the begin_date and end_date values are empty. it indicates long-term execution and is the default value.
    EndDate string
    The End Date. When the begin_date and end_date values are empty. it indicates long-term execution and is the default value.
    Period string
    The period in which a timed elastic scaling strategy is executed.
    Schedules []ApplicationScalingRuleScalingRuleTimerSchedule
    Resilient Scaling Strategy Trigger Timing. See schedules below.
    beginDate String
    The Start date. When the begin_date and end_date values are empty. it indicates long-term execution and is the default value.
    endDate String
    The End Date. When the begin_date and end_date values are empty. it indicates long-term execution and is the default value.
    period String
    The period in which a timed elastic scaling strategy is executed.
    schedules List<ApplicationScalingRuleScalingRuleTimerSchedule>
    Resilient Scaling Strategy Trigger Timing. See schedules below.
    beginDate string
    The Start date. When the begin_date and end_date values are empty. it indicates long-term execution and is the default value.
    endDate string
    The End Date. When the begin_date and end_date values are empty. it indicates long-term execution and is the default value.
    period string
    The period in which a timed elastic scaling strategy is executed.
    schedules ApplicationScalingRuleScalingRuleTimerSchedule[]
    Resilient Scaling Strategy Trigger Timing. See schedules below.
    begin_date str
    The Start date. When the begin_date and end_date values are empty. it indicates long-term execution and is the default value.
    end_date str
    The End Date. When the begin_date and end_date values are empty. it indicates long-term execution and is the default value.
    period str
    The period in which a timed elastic scaling strategy is executed.
    schedules Sequence[ApplicationScalingRuleScalingRuleTimerSchedule]
    Resilient Scaling Strategy Trigger Timing. See schedules below.
    beginDate String
    The Start date. When the begin_date and end_date values are empty. it indicates long-term execution and is the default value.
    endDate String
    The End Date. When the begin_date and end_date values are empty. it indicates long-term execution and is the default value.
    period String
    The period in which a timed elastic scaling strategy is executed.
    schedules List<Property Map>
    Resilient Scaling Strategy Trigger Timing. See schedules below.

    ApplicationScalingRuleScalingRuleTimerSchedule, ApplicationScalingRuleScalingRuleTimerScheduleArgs

    AtTime string
    Trigger point in time. When supporting format: minutes, for example: 08:00.
    MaxReplicas int
    MinReplicas int
    TargetReplicas int
    This parameter can specify the number of instances to be applied or the minimum number of surviving instances per deployment. value range [1,50]. > NOTE: The attribute is valid when the attribute scaling_rule_type is timing.
    AtTime string
    Trigger point in time. When supporting format: minutes, for example: 08:00.
    MaxReplicas int
    MinReplicas int
    TargetReplicas int
    This parameter can specify the number of instances to be applied or the minimum number of surviving instances per deployment. value range [1,50]. > NOTE: The attribute is valid when the attribute scaling_rule_type is timing.
    atTime String
    Trigger point in time. When supporting format: minutes, for example: 08:00.
    maxReplicas Integer
    minReplicas Integer
    targetReplicas Integer
    This parameter can specify the number of instances to be applied or the minimum number of surviving instances per deployment. value range [1,50]. > NOTE: The attribute is valid when the attribute scaling_rule_type is timing.
    atTime string
    Trigger point in time. When supporting format: minutes, for example: 08:00.
    maxReplicas number
    minReplicas number
    targetReplicas number
    This parameter can specify the number of instances to be applied or the minimum number of surviving instances per deployment. value range [1,50]. > NOTE: The attribute is valid when the attribute scaling_rule_type is timing.
    at_time str
    Trigger point in time. When supporting format: minutes, for example: 08:00.
    max_replicas int
    min_replicas int
    target_replicas int
    This parameter can specify the number of instances to be applied or the minimum number of surviving instances per deployment. value range [1,50]. > NOTE: The attribute is valid when the attribute scaling_rule_type is timing.
    atTime String
    Trigger point in time. When supporting format: minutes, for example: 08:00.
    maxReplicas Number
    minReplicas Number
    targetReplicas Number
    This parameter can specify the number of instances to be applied or the minimum number of surviving instances per deployment. value range [1,50]. > NOTE: The attribute is valid when the attribute scaling_rule_type is timing.

    Import

    Serverless App Engine (SAE) Application Scaling Rule can be imported using the id, e.g.

    $ pulumi import alicloud:sae/applicationScalingRule:ApplicationScalingRule example <app_id>:<scaling_rule_name>
    

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

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi