alicloud.sae.ApplicationScalingRule
Explore with Pulumi AI
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=alicloud.sae.ApplicationScalingRuleScalingRuleTimerArgs(
period="* * *",
schedules=[
alicloud.sae.ApplicationScalingRuleScalingRuleTimerScheduleArgs(
at_time="08:00",
max_replicas=10,
min_replicas=3,
),
alicloud.sae.ApplicationScalingRuleScalingRuleTimerScheduleArgs(
at_time="20:00",
max_replicas=50,
min_replicas=3,
),
],
),
scaling_rule_metric=alicloud.sae.ApplicationScalingRuleScalingRuleMetricArgs(
max_replicas=50,
min_replicas=3,
metrics=[
alicloud.sae.ApplicationScalingRuleScalingRuleMetricMetricArgs(
metric_type="CPU",
metric_target_average_utilization=20,
),
alicloud.sae.ApplicationScalingRuleScalingRuleMetricMetricArgs(
metric_type="MEMORY",
metric_target_average_utilization=30,
),
alicloud.sae.ApplicationScalingRuleScalingRuleMetricMetricArgs(
metric_type="tcpActiveConn",
metric_target_average_utilization=20,
),
],
scale_up_rules=alicloud.sae.ApplicationScalingRuleScalingRuleMetricScaleUpRulesArgs(
step=10,
disabled=False,
stabilization_window_seconds=0,
),
scale_down_rules=alicloud.sae.ApplicationScalingRuleScalingRuleMetricScaleDownRulesArgs(
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.String(fmt.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.String(fmt.Sprintf("%v-%v", name, defaultInteger.Result)),
NamespaceId: defaultNamespace.ID(),
ImageUrl: pulumi.String(fmt.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=alicloud.sae.ApplicationScalingRuleScalingRuleMetricArgs(
max_replicas=0,
metrics=[alicloud.sae.ApplicationScalingRuleScalingRuleMetricMetricArgs(
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=alicloud.sae.ApplicationScalingRuleScalingRuleMetricScaleDownRulesArgs(
disabled=False,
stabilization_window_seconds=0,
step=0,
),
scale_up_rules=alicloud.sae.ApplicationScalingRuleScalingRuleMetricScaleUpRulesArgs(
disabled=False,
stabilization_window_seconds=0,
step=0,
),
),
scaling_rule_timer=alicloud.sae.ApplicationScalingRuleScalingRuleTimerArgs(
begin_date="string",
end_date="string",
period="string",
schedules=[alicloud.sae.ApplicationScalingRuleScalingRuleTimerScheduleArgs(
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
The ApplicationScalingRule resource accepts the following input properties:
- App
Id string - Application ID.
- Scaling
Rule stringName - 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 stringType - Flexible strategy type. Valid values:
mix
,timing
andmetric
. - Min
Ready intInstance Ratio - The min ready instance ratio.
- Min
Ready intInstances - The min ready instances.
- Scaling
Rule boolEnable - 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 Pulumi.Metric Ali Cloud. Sae. Inputs. Application Scaling Rule Scaling Rule Metric - Monitor the configuration of the indicator elasticity strategy. See
scaling_rule_metric
below. - Scaling
Rule Pulumi.Timer Ali Cloud. Sae. Inputs. Application Scaling Rule Scaling Rule Timer - Configuration of Timing Resilient Policies. See
scaling_rule_timer
below.
- App
Id string - Application ID.
- Scaling
Rule stringName - 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 stringType - Flexible strategy type. Valid values:
mix
,timing
andmetric
. - Min
Ready intInstance Ratio - The min ready instance ratio.
- Min
Ready intInstances - The min ready instances.
- Scaling
Rule boolEnable - 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 ApplicationMetric Scaling Rule Scaling Rule Metric Args - Monitor the configuration of the indicator elasticity strategy. See
scaling_rule_metric
below. - Scaling
Rule ApplicationTimer Scaling Rule Scaling Rule Timer Args - Configuration of Timing Resilient Policies. See
scaling_rule_timer
below.
- app
Id String - Application ID.
- scaling
Rule StringName - 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 StringType - Flexible strategy type. Valid values:
mix
,timing
andmetric
. - min
Ready IntegerInstance Ratio - The min ready instance ratio.
- min
Ready IntegerInstances - The min ready instances.
- scaling
Rule BooleanEnable - 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 ApplicationMetric Scaling Rule Scaling Rule Metric - Monitor the configuration of the indicator elasticity strategy. See
scaling_rule_metric
below. - scaling
Rule ApplicationTimer Scaling Rule Scaling Rule Timer - Configuration of Timing Resilient Policies. See
scaling_rule_timer
below.
- app
Id string - Application ID.
- scaling
Rule stringName - 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 stringType - Flexible strategy type. Valid values:
mix
,timing
andmetric
. - min
Ready numberInstance Ratio - The min ready instance ratio.
- min
Ready numberInstances - The min ready instances.
- scaling
Rule booleanEnable - 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 ApplicationMetric Scaling Rule Scaling Rule Metric - Monitor the configuration of the indicator elasticity strategy. See
scaling_rule_metric
below. - scaling
Rule ApplicationTimer Scaling Rule Scaling Rule Timer - Configuration of Timing Resilient Policies. See
scaling_rule_timer
below.
- app_
id str - Application ID.
- scaling_
rule_ strname - 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_ strtype - Flexible strategy type. Valid values:
mix
,timing
andmetric
. - min_
ready_ intinstance_ ratio - The min ready instance ratio.
- min_
ready_ intinstances - The min ready instances.
- scaling_
rule_ boolenable - 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_ Applicationmetric Scaling Rule Scaling Rule Metric Args - Monitor the configuration of the indicator elasticity strategy. See
scaling_rule_metric
below. - scaling_
rule_ Applicationtimer Scaling Rule Scaling Rule Timer Args - Configuration of Timing Resilient Policies. See
scaling_rule_timer
below.
- app
Id String - Application ID.
- scaling
Rule StringName - 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 StringType - Flexible strategy type. Valid values:
mix
,timing
andmetric
. - min
Ready NumberInstance Ratio - The min ready instance ratio.
- min
Ready NumberInstances - The min ready instances.
- scaling
Rule BooleanEnable - 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 Property MapMetric - Monitor the configuration of the indicator elasticity strategy. See
scaling_rule_metric
below. - scaling
Rule Property MapTimer - 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.
- App
Id string - Application ID.
- Min
Ready intInstance Ratio - The min ready instance ratio.
- Min
Ready intInstances - The min ready instances.
- Scaling
Rule boolEnable - 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 Pulumi.Metric Ali Cloud. Sae. Inputs. Application Scaling Rule Scaling Rule Metric - Monitor the configuration of the indicator elasticity strategy. See
scaling_rule_metric
below. - Scaling
Rule stringName - 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 Pulumi.Timer Ali Cloud. Sae. Inputs. Application Scaling Rule Scaling Rule Timer - Configuration of Timing Resilient Policies. See
scaling_rule_timer
below. - Scaling
Rule stringType - Flexible strategy type. Valid values:
mix
,timing
andmetric
.
- App
Id string - Application ID.
- Min
Ready intInstance Ratio - The min ready instance ratio.
- Min
Ready intInstances - The min ready instances.
- Scaling
Rule boolEnable - 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 ApplicationMetric Scaling Rule Scaling Rule Metric Args - Monitor the configuration of the indicator elasticity strategy. See
scaling_rule_metric
below. - Scaling
Rule stringName - 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 ApplicationTimer Scaling Rule Scaling Rule Timer Args - Configuration of Timing Resilient Policies. See
scaling_rule_timer
below. - Scaling
Rule stringType - Flexible strategy type. Valid values:
mix
,timing
andmetric
.
- app
Id String - Application ID.
- min
Ready IntegerInstance Ratio - The min ready instance ratio.
- min
Ready IntegerInstances - The min ready instances.
- scaling
Rule BooleanEnable - 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 ApplicationMetric Scaling Rule Scaling Rule Metric - Monitor the configuration of the indicator elasticity strategy. See
scaling_rule_metric
below. - scaling
Rule StringName - 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 ApplicationTimer Scaling Rule Scaling Rule Timer - Configuration of Timing Resilient Policies. See
scaling_rule_timer
below. - scaling
Rule StringType - Flexible strategy type. Valid values:
mix
,timing
andmetric
.
- app
Id string - Application ID.
- min
Ready numberInstance Ratio - The min ready instance ratio.
- min
Ready numberInstances - The min ready instances.
- scaling
Rule booleanEnable - 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 ApplicationMetric Scaling Rule Scaling Rule Metric - Monitor the configuration of the indicator elasticity strategy. See
scaling_rule_metric
below. - scaling
Rule stringName - 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 ApplicationTimer Scaling Rule Scaling Rule Timer - Configuration of Timing Resilient Policies. See
scaling_rule_timer
below. - scaling
Rule stringType - Flexible strategy type. Valid values:
mix
,timing
andmetric
.
- app_
id str - Application ID.
- min_
ready_ intinstance_ ratio - The min ready instance ratio.
- min_
ready_ intinstances - The min ready instances.
- scaling_
rule_ boolenable - 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_ Applicationmetric Scaling Rule Scaling Rule Metric Args - Monitor the configuration of the indicator elasticity strategy. See
scaling_rule_metric
below. - scaling_
rule_ strname - 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_ Applicationtimer Scaling Rule Scaling Rule Timer Args - Configuration of Timing Resilient Policies. See
scaling_rule_timer
below. - scaling_
rule_ strtype - Flexible strategy type. Valid values:
mix
,timing
andmetric
.
- app
Id String - Application ID.
- min
Ready NumberInstance Ratio - The min ready instance ratio.
- min
Ready NumberInstances - The min ready instances.
- scaling
Rule BooleanEnable - 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 Property MapMetric - Monitor the configuration of the indicator elasticity strategy. See
scaling_rule_metric
below. - scaling
Rule StringName - 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 Property MapTimer - Configuration of Timing Resilient Policies. See
scaling_rule_timer
below. - scaling
Rule StringType - Flexible strategy type. Valid values:
mix
,timing
andmetric
.
Supporting Types
ApplicationScalingRuleScalingRuleMetric, ApplicationScalingRuleScalingRuleMetricArgs
- Max
Replicas int - Maximum number of instances applied.
- Metrics
List<Pulumi.
Ali Cloud. Sae. Inputs. Application Scaling Rule Scaling Rule Metric Metric> - Indicator rule configuration. See
metrics
below. - Min
Replicas int - Minimum number of instances applied.
- Scale
Down Pulumi.Rules Ali Cloud. Sae. Inputs. Application Scaling Rule Scaling Rule Metric Scale Down Rules - Apply shrink rules. See
scale_down_rules
below. - Scale
Up Pulumi.Rules Ali Cloud. Sae. Inputs. Application Scaling Rule Scaling Rule Metric Scale Up Rules - Apply expansion rules. See
scale_up_rules
below.
- Max
Replicas int - Maximum number of instances applied.
- Metrics
[]Application
Scaling Rule Scaling Rule Metric Metric - Indicator rule configuration. See
metrics
below. - Min
Replicas int - Minimum number of instances applied.
- Scale
Down ApplicationRules Scaling Rule Scaling Rule Metric Scale Down Rules - Apply shrink rules. See
scale_down_rules
below. - Scale
Up ApplicationRules Scaling Rule Scaling Rule Metric Scale Up Rules - Apply expansion rules. See
scale_up_rules
below.
- max
Replicas Integer - Maximum number of instances applied.
- metrics
List<Application
Scaling Rule Scaling Rule Metric Metric> - Indicator rule configuration. See
metrics
below. - min
Replicas Integer - Minimum number of instances applied.
- scale
Down ApplicationRules Scaling Rule Scaling Rule Metric Scale Down Rules - Apply shrink rules. See
scale_down_rules
below. - scale
Up ApplicationRules Scaling Rule Scaling Rule Metric Scale Up Rules - Apply expansion rules. See
scale_up_rules
below.
- max
Replicas number - Maximum number of instances applied.
- metrics
Application
Scaling Rule Scaling Rule Metric Metric[] - Indicator rule configuration. See
metrics
below. - min
Replicas number - Minimum number of instances applied.
- scale
Down ApplicationRules Scaling Rule Scaling Rule Metric Scale Down Rules - Apply shrink rules. See
scale_down_rules
below. - scale
Up ApplicationRules Scaling Rule Scaling Rule Metric Scale Up Rules - Apply expansion rules. See
scale_up_rules
below.
- max_
replicas int - Maximum number of instances applied.
- metrics
Sequence[Application
Scaling Rule Scaling Rule Metric Metric] - Indicator rule configuration. See
metrics
below. - min_
replicas int - Minimum number of instances applied.
- scale_
down_ Applicationrules Scaling Rule Scaling Rule Metric Scale Down Rules - Apply shrink rules. See
scale_down_rules
below. - scale_
up_ Applicationrules Scaling Rule Scaling Rule Metric Scale Up Rules - Apply expansion rules. See
scale_up_rules
below.
- max
Replicas Number - Maximum number of instances applied.
- metrics List<Property Map>
- Indicator rule configuration. See
metrics
below. - min
Replicas Number - Minimum number of instances applied.
- scale
Down Property MapRules - Apply shrink rules. See
scale_down_rules
below. - scale
Up Property MapRules - Apply expansion rules. See
scale_up_rules
below.
ApplicationScalingRuleScalingRuleMetricMetric, ApplicationScalingRuleScalingRuleMetricMetricArgs
- Metric
Target intAverage Utilization - Metric
Type string - Slb
Id string - Slb
Log stringStore - Slb
Project string - Vport string
- Metric
Target intAverage Utilization - Metric
Type string - Slb
Id string - Slb
Log stringStore - Slb
Project string - Vport string
- metric
Target IntegerAverage Utilization - metric
Type String - slb
Id String - slb
Log StringStore - slb
Project String - vport String
- metric
Target numberAverage Utilization - metric
Type string - slb
Id string - slb
Log stringStore - slb
Project string - vport string
- metric_
target_ intaverage_ utilization - metric_
type str - slb_
id str - slb_
log_ strstore - slb_
project str - vport str
- metric
Target NumberAverage Utilization - metric
Type String - slb
Id String - slb
Log StringStore - slb
Project String - vport String
ApplicationScalingRuleScalingRuleMetricScaleDownRules, ApplicationScalingRuleScalingRuleMetricScaleDownRulesArgs
- Disabled bool
- Stabilization
Window intSeconds - Step int
- Disabled bool
- Stabilization
Window intSeconds - Step int
- disabled Boolean
- stabilization
Window IntegerSeconds - step Integer
- disabled boolean
- stabilization
Window numberSeconds - step number
- disabled bool
- stabilization_
window_ intseconds - step int
- disabled Boolean
- stabilization
Window NumberSeconds - step Number
ApplicationScalingRuleScalingRuleMetricScaleUpRules, ApplicationScalingRuleScalingRuleMetricScaleUpRulesArgs
- Disabled bool
- Stabilization
Window intSeconds - Step int
- Disabled bool
- Stabilization
Window intSeconds - Step int
- disabled Boolean
- stabilization
Window IntegerSeconds - step Integer
- disabled boolean
- stabilization
Window numberSeconds - step number
- disabled bool
- stabilization_
window_ intseconds - step int
- disabled Boolean
- stabilization
Window NumberSeconds - step Number
ApplicationScalingRuleScalingRuleTimer, ApplicationScalingRuleScalingRuleTimerArgs
- Begin
Date string - The Start date. When the
begin_date
andend_date
values are empty. it indicates long-term execution and is the default value. - End
Date string - The End Date. When the
begin_date
andend_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.
Ali Cloud. Sae. Inputs. Application Scaling Rule Scaling Rule Timer Schedule> - Resilient Scaling Strategy Trigger Timing. See
schedules
below.
- Begin
Date string - The Start date. When the
begin_date
andend_date
values are empty. it indicates long-term execution and is the default value. - End
Date string - The End Date. When the
begin_date
andend_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
[]Application
Scaling Rule Scaling Rule Timer Schedule - Resilient Scaling Strategy Trigger Timing. See
schedules
below.
- begin
Date String - The Start date. When the
begin_date
andend_date
values are empty. it indicates long-term execution and is the default value. - end
Date String - The End Date. When the
begin_date
andend_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<Application
Scaling Rule Scaling Rule Timer Schedule> - Resilient Scaling Strategy Trigger Timing. See
schedules
below.
- begin
Date string - The Start date. When the
begin_date
andend_date
values are empty. it indicates long-term execution and is the default value. - end
Date string - The End Date. When the
begin_date
andend_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
Application
Scaling Rule Scaling Rule Timer Schedule[] - Resilient Scaling Strategy Trigger Timing. See
schedules
below.
- begin_
date str - The Start date. When the
begin_date
andend_date
values are empty. it indicates long-term execution and is the default value. - end_
date str - The End Date. When the
begin_date
andend_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[Application
Scaling Rule Scaling Rule Timer Schedule] - Resilient Scaling Strategy Trigger Timing. See
schedules
below.
- begin
Date String - The Start date. When the
begin_date
andend_date
values are empty. it indicates long-term execution and is the default value. - end
Date String - The End Date. When the
begin_date
andend_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
- At
Time string - Max
Replicas int - Min
Replicas int - Target
Replicas int
- At
Time string - Max
Replicas int - Min
Replicas int - Target
Replicas int
- at
Time String - max
Replicas Integer - min
Replicas Integer - target
Replicas Integer
- at
Time string - max
Replicas number - min
Replicas number - target
Replicas number
- at_
time str - max_
replicas int - min_
replicas int - target_
replicas int
- at
Time String - max
Replicas Number - min
Replicas Number - target
Replicas Number
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.