Policy

Provides an Application AutoScaling Policy resource.

Example Usage

DynamoDB Table Autoscaling

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var dynamodbTableReadTarget = new Aws.AppAutoScaling.Target("dynamodbTableReadTarget", new Aws.AppAutoScaling.TargetArgs
        {
            MaxCapacity = 100,
            MinCapacity = 5,
            ResourceId = "table/tableName",
            ScalableDimension = "dynamodb:table:ReadCapacityUnits",
            ServiceNamespace = "dynamodb",
        });
        var dynamodbTableReadPolicy = new Aws.AppAutoScaling.Policy("dynamodbTableReadPolicy", new Aws.AppAutoScaling.PolicyArgs
        {
            PolicyType = "TargetTrackingScaling",
            ResourceId = dynamodbTableReadTarget.ResourceId,
            ScalableDimension = dynamodbTableReadTarget.ScalableDimension,
            ServiceNamespace = dynamodbTableReadTarget.ServiceNamespace,
            TargetTrackingScalingPolicyConfiguration = new Aws.AppAutoScaling.Inputs.PolicyTargetTrackingScalingPolicyConfigurationArgs
            {
                PredefinedMetricSpecification = new Aws.AppAutoScaling.Inputs.PolicyTargetTrackingScalingPolicyConfigurationPredefinedMetricSpecificationArgs
                {
                    PredefinedMetricType = "DynamoDBReadCapacityUtilization",
                },
                TargetValue = 70,
            },
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/appautoscaling"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        dynamodbTableReadTarget, err := appautoscaling.NewTarget(ctx, "dynamodbTableReadTarget", &appautoscaling.TargetArgs{
            MaxCapacity:       pulumi.Int(100),
            MinCapacity:       pulumi.Int(5),
            ResourceId:        pulumi.String("table/tableName"),
            ScalableDimension: pulumi.String("dynamodb:table:ReadCapacityUnits"),
            ServiceNamespace:  pulumi.String("dynamodb"),
        })
        if err != nil {
            return err
        }
        _, err = appautoscaling.NewPolicy(ctx, "dynamodbTableReadPolicy", &appautoscaling.PolicyArgs{
            PolicyType:        pulumi.String("TargetTrackingScaling"),
            ResourceId:        dynamodbTableReadTarget.ResourceId,
            ScalableDimension: dynamodbTableReadTarget.ScalableDimension,
            ServiceNamespace:  dynamodbTableReadTarget.ServiceNamespace,
            TargetTrackingScalingPolicyConfiguration: &appautoscaling.PolicyTargetTrackingScalingPolicyConfigurationArgs{
                PredefinedMetricSpecification: &appautoscaling.PolicyTargetTrackingScalingPolicyConfigurationPredefinedMetricSpecificationArgs{
                    PredefinedMetricType: pulumi.String("DynamoDBReadCapacityUtilization"),
                },
                TargetValue: pulumi.Float64(70),
            },
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

dynamodb_table_read_target = aws.appautoscaling.Target("dynamodbTableReadTarget",
    max_capacity=100,
    min_capacity=5,
    resource_id="table/tableName",
    scalable_dimension="dynamodb:table:ReadCapacityUnits",
    service_namespace="dynamodb")
dynamodb_table_read_policy = aws.appautoscaling.Policy("dynamodbTableReadPolicy",
    policy_type="TargetTrackingScaling",
    resource_id=dynamodb_table_read_target.resource_id,
    scalable_dimension=dynamodb_table_read_target.scalable_dimension,
    service_namespace=dynamodb_table_read_target.service_namespace,
    target_tracking_scaling_policy_configuration={
        "predefinedMetricSpecification": {
            "predefinedMetricType": "DynamoDBReadCapacityUtilization",
        },
        "targetValue": 70,
    })
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const dynamodbTableReadTarget = new aws.appautoscaling.Target("dynamodb_table_read_target", {
    maxCapacity: 100,
    minCapacity: 5,
    resourceId: "table/tableName",
    scalableDimension: "dynamodb:table:ReadCapacityUnits",
    serviceNamespace: "dynamodb",
});
const dynamodbTableReadPolicy = new aws.appautoscaling.Policy("dynamodb_table_read_policy", {
    policyType: "TargetTrackingScaling",
    resourceId: dynamodbTableReadTarget.resourceId,
    scalableDimension: dynamodbTableReadTarget.scalableDimension,
    serviceNamespace: dynamodbTableReadTarget.serviceNamespace,
    targetTrackingScalingPolicyConfiguration: {
        predefinedMetricSpecification: {
            predefinedMetricType: "DynamoDBReadCapacityUtilization",
        },
        targetValue: 70,
    },
});

ECS Service Autoscaling

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var ecsTarget = new Aws.AppAutoScaling.Target("ecsTarget", new Aws.AppAutoScaling.TargetArgs
        {
            MaxCapacity = 4,
            MinCapacity = 1,
            ResourceId = "service/clusterName/serviceName",
            ScalableDimension = "ecs:service:DesiredCount",
            ServiceNamespace = "ecs",
        });
        var ecsPolicy = new Aws.AppAutoScaling.Policy("ecsPolicy", new Aws.AppAutoScaling.PolicyArgs
        {
            PolicyType = "StepScaling",
            ResourceId = ecsTarget.ResourceId,
            ScalableDimension = ecsTarget.ScalableDimension,
            ServiceNamespace = ecsTarget.ServiceNamespace,
            StepScalingPolicyConfiguration = new Aws.AppAutoScaling.Inputs.PolicyStepScalingPolicyConfigurationArgs
            {
                AdjustmentType = "ChangeInCapacity",
                Cooldown = 60,
                MetricAggregationType = "Maximum",
                StepAdjustments = 
                {
                    new Aws.AppAutoScaling.Inputs.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs
                    {
                        MetricIntervalUpperBound = "0",
                        ScalingAdjustment = -1,
                    },
                },
            },
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/appautoscaling"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        ecsTarget, err := appautoscaling.NewTarget(ctx, "ecsTarget", &appautoscaling.TargetArgs{
            MaxCapacity:       pulumi.Int(4),
            MinCapacity:       pulumi.Int(1),
            ResourceId:        pulumi.String("service/clusterName/serviceName"),
            ScalableDimension: pulumi.String("ecs:service:DesiredCount"),
            ServiceNamespace:  pulumi.String("ecs"),
        })
        if err != nil {
            return err
        }
        _, err = appautoscaling.NewPolicy(ctx, "ecsPolicy", &appautoscaling.PolicyArgs{
            PolicyType:        pulumi.String("StepScaling"),
            ResourceId:        ecsTarget.ResourceId,
            ScalableDimension: ecsTarget.ScalableDimension,
            ServiceNamespace:  ecsTarget.ServiceNamespace,
            StepScalingPolicyConfiguration: &appautoscaling.PolicyStepScalingPolicyConfigurationArgs{
                AdjustmentType:        pulumi.String("ChangeInCapacity"),
                Cooldown:              pulumi.Int(60),
                MetricAggregationType: pulumi.String("Maximum"),
                StepAdjustments: appautoscaling.PolicyStepScalingPolicyConfigurationStepAdjustmentArray{
                    &appautoscaling.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs{
                        MetricIntervalUpperBound: pulumi.String("0"),
                        ScalingAdjustment:        pulumi.Int(-1),
                    },
                },
            },
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

ecs_target = aws.appautoscaling.Target("ecsTarget",
    max_capacity=4,
    min_capacity=1,
    resource_id="service/clusterName/serviceName",
    scalable_dimension="ecs:service:DesiredCount",
    service_namespace="ecs")
ecs_policy = aws.appautoscaling.Policy("ecsPolicy",
    policy_type="StepScaling",
    resource_id=ecs_target.resource_id,
    scalable_dimension=ecs_target.scalable_dimension,
    service_namespace=ecs_target.service_namespace,
    step_scaling_policy_configuration={
        "adjustment_type": "ChangeInCapacity",
        "cooldown": 60,
        "metric_aggregation_type": "Maximum",
        "step_adjustments": [{
            "metricIntervalUpperBound": 0,
            "scaling_adjustment": -1,
        }],
    })
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const ecsTarget = new aws.appautoscaling.Target("ecs_target", {
    maxCapacity: 4,
    minCapacity: 1,
    resourceId: "service/clusterName/serviceName",
    scalableDimension: "ecs:service:DesiredCount",
    serviceNamespace: "ecs",
});
const ecsPolicy = new aws.appautoscaling.Policy("ecs_policy", {
    policyType: "StepScaling",
    resourceId: ecsTarget.resourceId,
    scalableDimension: ecsTarget.scalableDimension,
    serviceNamespace: ecsTarget.serviceNamespace,
    stepScalingPolicyConfiguration: {
        adjustmentType: "ChangeInCapacity",
        cooldown: 60,
        metricAggregationType: "Maximum",
        stepAdjustments: [{
            metricIntervalUpperBound: "0",
            scalingAdjustment: -1,
        }],
    },
});

Preserve desired count when updating an autoscaled ECS Service

Coming soon!

Coming soon!

import pulumi
import pulumi_aws as aws

ecs_service = aws.ecs.Service("ecsService",
    cluster="clusterName",
    desired_count=2,
    lifecycle={
        "ignoreChanges": ["desiredCount"],
    },
    task_definition="taskDefinitionFamily:1")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const ecsService = new aws.ecs.Service("ecs_service", {
    cluster: "clusterName",
    desiredCount: 2,
    taskDefinition: "taskDefinitionFamily:1",
}, { ignoreChanges: ["desiredCount"] });

Aurora Read Replica Autoscaling

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var replicasTarget = new Aws.AppAutoScaling.Target("replicasTarget", new Aws.AppAutoScaling.TargetArgs
        {
            MaxCapacity = 15,
            MinCapacity = 1,
            ResourceId = $"cluster:{aws_rds_cluster.Example.Id}",
            ScalableDimension = "rds:cluster:ReadReplicaCount",
            ServiceNamespace = "rds",
        });
        var replicasPolicy = new Aws.AppAutoScaling.Policy("replicasPolicy", new Aws.AppAutoScaling.PolicyArgs
        {
            PolicyType = "TargetTrackingScaling",
            ResourceId = replicasTarget.ResourceId,
            ScalableDimension = replicasTarget.ScalableDimension,
            ServiceNamespace = replicasTarget.ServiceNamespace,
            TargetTrackingScalingPolicyConfiguration = new Aws.AppAutoScaling.Inputs.PolicyTargetTrackingScalingPolicyConfigurationArgs
            {
                PredefinedMetricSpecification = new Aws.AppAutoScaling.Inputs.PolicyTargetTrackingScalingPolicyConfigurationPredefinedMetricSpecificationArgs
                {
                    PredefinedMetricType = "RDSReaderAverageCPUUtilization",
                },
                ScaleInCooldown = 300,
                ScaleOutCooldown = 300,
                TargetValue = 75,
            },
        });
    }

}
package main

import (
    "fmt"

    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/appautoscaling"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        replicasTarget, err := appautoscaling.NewTarget(ctx, "replicasTarget", &appautoscaling.TargetArgs{
            MaxCapacity:       pulumi.Int(15),
            MinCapacity:       pulumi.Int(1),
            ResourceId:        pulumi.String(fmt.Sprintf("%v%v", "cluster:", aws_rds_cluster.Example.Id)),
            ScalableDimension: pulumi.String("rds:cluster:ReadReplicaCount"),
            ServiceNamespace:  pulumi.String("rds"),
        })
        if err != nil {
            return err
        }
        _, err = appautoscaling.NewPolicy(ctx, "replicasPolicy", &appautoscaling.PolicyArgs{
            PolicyType:        pulumi.String("TargetTrackingScaling"),
            ResourceId:        replicasTarget.ResourceId,
            ScalableDimension: replicasTarget.ScalableDimension,
            ServiceNamespace:  replicasTarget.ServiceNamespace,
            TargetTrackingScalingPolicyConfiguration: &appautoscaling.PolicyTargetTrackingScalingPolicyConfigurationArgs{
                PredefinedMetricSpecification: &appautoscaling.PolicyTargetTrackingScalingPolicyConfigurationPredefinedMetricSpecificationArgs{
                    PredefinedMetricType: pulumi.String("RDSReaderAverageCPUUtilization"),
                },
                ScaleInCooldown:  pulumi.Int(300),
                ScaleOutCooldown: pulumi.Int(300),
                TargetValue:      pulumi.Float64(75),
            },
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

replicas_target = aws.appautoscaling.Target("replicasTarget",
    max_capacity=15,
    min_capacity=1,
    resource_id=f"cluster:{aws_rds_cluster['example']['id']}",
    scalable_dimension="rds:cluster:ReadReplicaCount",
    service_namespace="rds")
replicas_policy = aws.appautoscaling.Policy("replicasPolicy",
    policy_type="TargetTrackingScaling",
    resource_id=replicas_target.resource_id,
    scalable_dimension=replicas_target.scalable_dimension,
    service_namespace=replicas_target.service_namespace,
    target_tracking_scaling_policy_configuration={
        "predefinedMetricSpecification": {
            "predefinedMetricType": "RDSReaderAverageCPUUtilization",
        },
        "scaleInCooldown": 300,
        "scaleOutCooldown": 300,
        "targetValue": 75,
    })
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const replicasTarget = new aws.appautoscaling.Target("replicas", {
    maxCapacity: 15,
    minCapacity: 1,
    resourceId: pulumi.interpolate`cluster:${aws_rds_cluster_example.id}`,
    scalableDimension: "rds:cluster:ReadReplicaCount",
    serviceNamespace: "rds",
});
const replicasPolicy = new aws.appautoscaling.Policy("replicas", {
    policyType: "TargetTrackingScaling",
    resourceId: replicasTarget.resourceId,
    scalableDimension: replicasTarget.scalableDimension,
    serviceNamespace: replicasTarget.serviceNamespace,
    targetTrackingScalingPolicyConfiguration: {
        predefinedMetricSpecification: {
            predefinedMetricType: "RDSReaderAverageCPUUtilization",
        },
        scaleInCooldown: 300,
        scaleOutCooldown: 300,
        targetValue: 75,
    },
});

Create a Policy Resource

new Policy(name: string, args: PolicyArgs, opts?: CustomResourceOptions);
def Policy(resource_name, opts=None, name=None, policy_type=None, resource_id=None, scalable_dimension=None, service_namespace=None, step_scaling_policy_configuration=None, target_tracking_scaling_policy_configuration=None, __props__=None);
func NewPolicy(ctx *Context, name string, args PolicyArgs, opts ...ResourceOption) (*Policy, error)
public Policy(string name, PolicyArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args PolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args PolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args PolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Policy Resource Properties

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

Inputs

The Policy resource accepts the following input properties:

ResourceId string

The resource type and unique identifier string for the resource associated with the scaling policy. Documentation can be found in the ResourceId parameter at: AWS Application Auto Scaling API Reference

ScalableDimension string

The scalable dimension of the scalable target. Documentation can be found in the ScalableDimension parameter at: AWS Application Auto Scaling API Reference

ServiceNamespace string

The AWS service namespace of the scalable target. Documentation can be found in the ServiceNamespace parameter at: AWS Application Auto Scaling API Reference

Name string

The name of the policy.

PolicyType string

The policy type. Valid values are StepScaling and TargetTrackingScaling. Defaults to StepScaling. Certain services only support only one policy type. For more information see the Target Tracking Scaling Policies and Step Scaling Policies documentation.

StepScalingPolicyConfiguration PolicyStepScalingPolicyConfigurationArgs

Step scaling policy configuration, requires policy_type = "StepScaling" (default). See supported fields below.

TargetTrackingScalingPolicyConfiguration PolicyTargetTrackingScalingPolicyConfigurationArgs

A target tracking policy, requires policy_type = "TargetTrackingScaling". See supported fields below.

ResourceId string

The resource type and unique identifier string for the resource associated with the scaling policy. Documentation can be found in the ResourceId parameter at: AWS Application Auto Scaling API Reference

ScalableDimension string

The scalable dimension of the scalable target. Documentation can be found in the ScalableDimension parameter at: AWS Application Auto Scaling API Reference

ServiceNamespace string

The AWS service namespace of the scalable target. Documentation can be found in the ServiceNamespace parameter at: AWS Application Auto Scaling API Reference

Name string

The name of the policy.

PolicyType string

The policy type. Valid values are StepScaling and TargetTrackingScaling. Defaults to StepScaling. Certain services only support only one policy type. For more information see the Target Tracking Scaling Policies and Step Scaling Policies documentation.

StepScalingPolicyConfiguration PolicyStepScalingPolicyConfiguration

Step scaling policy configuration, requires policy_type = "StepScaling" (default). See supported fields below.

TargetTrackingScalingPolicyConfiguration PolicyTargetTrackingScalingPolicyConfiguration

A target tracking policy, requires policy_type = "TargetTrackingScaling". See supported fields below.

resourceId string

The resource type and unique identifier string for the resource associated with the scaling policy. Documentation can be found in the ResourceId parameter at: AWS Application Auto Scaling API Reference

scalableDimension string

The scalable dimension of the scalable target. Documentation can be found in the ScalableDimension parameter at: AWS Application Auto Scaling API Reference

serviceNamespace string

The AWS service namespace of the scalable target. Documentation can be found in the ServiceNamespace parameter at: AWS Application Auto Scaling API Reference

name string

The name of the policy.

policyType string

The policy type. Valid values are StepScaling and TargetTrackingScaling. Defaults to StepScaling. Certain services only support only one policy type. For more information see the Target Tracking Scaling Policies and Step Scaling Policies documentation.

stepScalingPolicyConfiguration PolicyStepScalingPolicyConfiguration

Step scaling policy configuration, requires policy_type = "StepScaling" (default). See supported fields below.

targetTrackingScalingPolicyConfiguration PolicyTargetTrackingScalingPolicyConfiguration

A target tracking policy, requires policy_type = "TargetTrackingScaling". See supported fields below.

resource_id str

The resource type and unique identifier string for the resource associated with the scaling policy. Documentation can be found in the ResourceId parameter at: AWS Application Auto Scaling API Reference

scalable_dimension str

The scalable dimension of the scalable target. Documentation can be found in the ScalableDimension parameter at: AWS Application Auto Scaling API Reference

service_namespace str

The AWS service namespace of the scalable target. Documentation can be found in the ServiceNamespace parameter at: AWS Application Auto Scaling API Reference

name str

The name of the policy.

policy_type str

The policy type. Valid values are StepScaling and TargetTrackingScaling. Defaults to StepScaling. Certain services only support only one policy type. For more information see the Target Tracking Scaling Policies and Step Scaling Policies documentation.

step_scaling_policy_configuration Dict[PolicyStepScalingPolicyConfiguration]

Step scaling policy configuration, requires policy_type = "StepScaling" (default). See supported fields below.

target_tracking_scaling_policy_configuration Dict[PolicyTargetTrackingScalingPolicyConfiguration]

A target tracking policy, requires policy_type = "TargetTrackingScaling". See supported fields below.

Outputs

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

Arn string

The ARN assigned by AWS to the scaling policy.

Id string
The provider-assigned unique ID for this managed resource.
Arn string

The ARN assigned by AWS to the scaling policy.

Id string
The provider-assigned unique ID for this managed resource.
arn string

The ARN assigned by AWS to the scaling policy.

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

The ARN assigned by AWS to the scaling policy.

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

Look up an Existing Policy Resource

Get an existing Policy 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?: PolicyState, opts?: CustomResourceOptions): Policy
static get(resource_name, id, opts=None, arn=None, name=None, policy_type=None, resource_id=None, scalable_dimension=None, service_namespace=None, step_scaling_policy_configuration=None, target_tracking_scaling_policy_configuration=None, __props__=None);
func GetPolicy(ctx *Context, name string, id IDInput, state *PolicyState, opts ...ResourceOption) (*Policy, error)
public static Policy Get(string name, Input<string> id, PolicyState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

Arn string

The ARN assigned by AWS to the scaling policy.

Name string

The name of the policy.

PolicyType string

The policy type. Valid values are StepScaling and TargetTrackingScaling. Defaults to StepScaling. Certain services only support only one policy type. For more information see the Target Tracking Scaling Policies and Step Scaling Policies documentation.

ResourceId string

The resource type and unique identifier string for the resource associated with the scaling policy. Documentation can be found in the ResourceId parameter at: AWS Application Auto Scaling API Reference

ScalableDimension string

The scalable dimension of the scalable target. Documentation can be found in the ScalableDimension parameter at: AWS Application Auto Scaling API Reference

ServiceNamespace string

The AWS service namespace of the scalable target. Documentation can be found in the ServiceNamespace parameter at: AWS Application Auto Scaling API Reference

StepScalingPolicyConfiguration PolicyStepScalingPolicyConfigurationArgs

Step scaling policy configuration, requires policy_type = "StepScaling" (default). See supported fields below.

TargetTrackingScalingPolicyConfiguration PolicyTargetTrackingScalingPolicyConfigurationArgs

A target tracking policy, requires policy_type = "TargetTrackingScaling". See supported fields below.

Arn string

The ARN assigned by AWS to the scaling policy.

Name string

The name of the policy.

PolicyType string

The policy type. Valid values are StepScaling and TargetTrackingScaling. Defaults to StepScaling. Certain services only support only one policy type. For more information see the Target Tracking Scaling Policies and Step Scaling Policies documentation.

ResourceId string

The resource type and unique identifier string for the resource associated with the scaling policy. Documentation can be found in the ResourceId parameter at: AWS Application Auto Scaling API Reference

ScalableDimension string

The scalable dimension of the scalable target. Documentation can be found in the ScalableDimension parameter at: AWS Application Auto Scaling API Reference

ServiceNamespace string

The AWS service namespace of the scalable target. Documentation can be found in the ServiceNamespace parameter at: AWS Application Auto Scaling API Reference

StepScalingPolicyConfiguration PolicyStepScalingPolicyConfiguration

Step scaling policy configuration, requires policy_type = "StepScaling" (default). See supported fields below.

TargetTrackingScalingPolicyConfiguration PolicyTargetTrackingScalingPolicyConfiguration

A target tracking policy, requires policy_type = "TargetTrackingScaling". See supported fields below.

arn string

The ARN assigned by AWS to the scaling policy.

name string

The name of the policy.

policyType string

The policy type. Valid values are StepScaling and TargetTrackingScaling. Defaults to StepScaling. Certain services only support only one policy type. For more information see the Target Tracking Scaling Policies and Step Scaling Policies documentation.

resourceId string

The resource type and unique identifier string for the resource associated with the scaling policy. Documentation can be found in the ResourceId parameter at: AWS Application Auto Scaling API Reference

scalableDimension string

The scalable dimension of the scalable target. Documentation can be found in the ScalableDimension parameter at: AWS Application Auto Scaling API Reference

serviceNamespace string

The AWS service namespace of the scalable target. Documentation can be found in the ServiceNamespace parameter at: AWS Application Auto Scaling API Reference

stepScalingPolicyConfiguration PolicyStepScalingPolicyConfiguration

Step scaling policy configuration, requires policy_type = "StepScaling" (default). See supported fields below.

targetTrackingScalingPolicyConfiguration PolicyTargetTrackingScalingPolicyConfiguration

A target tracking policy, requires policy_type = "TargetTrackingScaling". See supported fields below.

arn str

The ARN assigned by AWS to the scaling policy.

name str

The name of the policy.

policy_type str

The policy type. Valid values are StepScaling and TargetTrackingScaling. Defaults to StepScaling. Certain services only support only one policy type. For more information see the Target Tracking Scaling Policies and Step Scaling Policies documentation.

resource_id str

The resource type and unique identifier string for the resource associated with the scaling policy. Documentation can be found in the ResourceId parameter at: AWS Application Auto Scaling API Reference

scalable_dimension str

The scalable dimension of the scalable target. Documentation can be found in the ScalableDimension parameter at: AWS Application Auto Scaling API Reference

service_namespace str

The AWS service namespace of the scalable target. Documentation can be found in the ServiceNamespace parameter at: AWS Application Auto Scaling API Reference

step_scaling_policy_configuration Dict[PolicyStepScalingPolicyConfiguration]

Step scaling policy configuration, requires policy_type = "StepScaling" (default). See supported fields below.

target_tracking_scaling_policy_configuration Dict[PolicyTargetTrackingScalingPolicyConfiguration]

A target tracking policy, requires policy_type = "TargetTrackingScaling". See supported fields below.

Supporting Types

PolicyStepScalingPolicyConfiguration

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

AdjustmentType string

Specifies whether the adjustment is an absolute number or a percentage of the current capacity. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

Cooldown int

The amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start.

MetricAggregationType string

The aggregation type for the policy’s metrics. Valid values are “Minimum”, “Maximum”, and “Average”. Without a value, AWS will treat the aggregation type as “Average”.

MinAdjustmentMagnitude int

The minimum number to adjust your scalable dimension as a result of a scaling activity. If the adjustment type is PercentChangeInCapacity, the scaling policy changes the scalable dimension of the scalable target by this amount.

StepAdjustments List<PolicyStepScalingPolicyConfigurationStepAdjustmentArgs>

A set of adjustments that manage scaling. These have the following structure:

AdjustmentType string

Specifies whether the adjustment is an absolute number or a percentage of the current capacity. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

Cooldown int

The amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start.

MetricAggregationType string

The aggregation type for the policy’s metrics. Valid values are “Minimum”, “Maximum”, and “Average”. Without a value, AWS will treat the aggregation type as “Average”.

MinAdjustmentMagnitude int

The minimum number to adjust your scalable dimension as a result of a scaling activity. If the adjustment type is PercentChangeInCapacity, the scaling policy changes the scalable dimension of the scalable target by this amount.

StepAdjustments []PolicyStepScalingPolicyConfigurationStepAdjustment

A set of adjustments that manage scaling. These have the following structure:

adjustmentType string

Specifies whether the adjustment is an absolute number or a percentage of the current capacity. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

cooldown number

The amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start.

metricAggregationType string

The aggregation type for the policy’s metrics. Valid values are “Minimum”, “Maximum”, and “Average”. Without a value, AWS will treat the aggregation type as “Average”.

minAdjustmentMagnitude number

The minimum number to adjust your scalable dimension as a result of a scaling activity. If the adjustment type is PercentChangeInCapacity, the scaling policy changes the scalable dimension of the scalable target by this amount.

stepAdjustments PolicyStepScalingPolicyConfigurationStepAdjustment[]

A set of adjustments that manage scaling. These have the following structure:

adjustment_type str

Specifies whether the adjustment is an absolute number or a percentage of the current capacity. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

cooldown float

The amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start.

metric_aggregation_type str

The aggregation type for the policy’s metrics. Valid values are “Minimum”, “Maximum”, and “Average”. Without a value, AWS will treat the aggregation type as “Average”.

min_adjustment_magnitude float

The minimum number to adjust your scalable dimension as a result of a scaling activity. If the adjustment type is PercentChangeInCapacity, the scaling policy changes the scalable dimension of the scalable target by this amount.

step_adjustments List[PolicyStepScalingPolicyConfigurationStepAdjustment]

A set of adjustments that manage scaling. These have the following structure:

PolicyStepScalingPolicyConfigurationStepAdjustment

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

ScalingAdjustment int

The number of members by which to scale, when the adjustment bounds are breached. A positive value scales up. A negative value scales down.

MetricIntervalLowerBound string

The lower bound for the difference between the alarm threshold and the CloudWatch metric. Without a value, AWS will treat this bound as negative infinity.

MetricIntervalUpperBound string

The upper bound for the difference between the alarm threshold and the CloudWatch metric. Without a value, AWS will treat this bound as infinity. The upper bound must be greater than the lower bound.

ScalingAdjustment int

The number of members by which to scale, when the adjustment bounds are breached. A positive value scales up. A negative value scales down.

MetricIntervalLowerBound string

The lower bound for the difference between the alarm threshold and the CloudWatch metric. Without a value, AWS will treat this bound as negative infinity.

MetricIntervalUpperBound string

The upper bound for the difference between the alarm threshold and the CloudWatch metric. Without a value, AWS will treat this bound as infinity. The upper bound must be greater than the lower bound.

scalingAdjustment number

The number of members by which to scale, when the adjustment bounds are breached. A positive value scales up. A negative value scales down.

metricIntervalLowerBound string

The lower bound for the difference between the alarm threshold and the CloudWatch metric. Without a value, AWS will treat this bound as negative infinity.

metricIntervalUpperBound string

The upper bound for the difference between the alarm threshold and the CloudWatch metric. Without a value, AWS will treat this bound as infinity. The upper bound must be greater than the lower bound.

scaling_adjustment float

The number of members by which to scale, when the adjustment bounds are breached. A positive value scales up. A negative value scales down.

metricIntervalLowerBound str

The lower bound for the difference between the alarm threshold and the CloudWatch metric. Without a value, AWS will treat this bound as negative infinity.

metricIntervalUpperBound str

The upper bound for the difference between the alarm threshold and the CloudWatch metric. Without a value, AWS will treat this bound as infinity. The upper bound must be greater than the lower bound.

PolicyTargetTrackingScalingPolicyConfiguration

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

TargetValue double

The target value for the metric.

CustomizedMetricSpecification PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationArgs

A custom CloudWatch metric. Documentation can be found at: AWS Customized Metric Specification. See supported fields below.

DisableScaleIn bool

Indicates whether scale in by the target tracking policy is disabled. If the value is true, scale in is disabled and the target tracking policy won’t remove capacity from the scalable resource. Otherwise, scale in is enabled and the target tracking policy can remove capacity from the scalable resource. The default value is false.

PredefinedMetricSpecification PolicyTargetTrackingScalingPolicyConfigurationPredefinedMetricSpecificationArgs

A predefined metric. See supported fields below.

ScaleInCooldown int

The amount of time, in seconds, after a scale in activity completes before another scale in activity can start.

ScaleOutCooldown int

The amount of time, in seconds, after a scale out activity completes before another scale out activity can start.

TargetValue float64

The target value for the metric.

CustomizedMetricSpecification PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecification

A custom CloudWatch metric. Documentation can be found at: AWS Customized Metric Specification. See supported fields below.

DisableScaleIn bool

Indicates whether scale in by the target tracking policy is disabled. If the value is true, scale in is disabled and the target tracking policy won’t remove capacity from the scalable resource. Otherwise, scale in is enabled and the target tracking policy can remove capacity from the scalable resource. The default value is false.

PredefinedMetricSpecification PolicyTargetTrackingScalingPolicyConfigurationPredefinedMetricSpecification

A predefined metric. See supported fields below.

ScaleInCooldown int

The amount of time, in seconds, after a scale in activity completes before another scale in activity can start.

ScaleOutCooldown int

The amount of time, in seconds, after a scale out activity completes before another scale out activity can start.

targetValue number

The target value for the metric.

customizedMetricSpecification PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecification

A custom CloudWatch metric. Documentation can be found at: AWS Customized Metric Specification. See supported fields below.

disableScaleIn boolean

Indicates whether scale in by the target tracking policy is disabled. If the value is true, scale in is disabled and the target tracking policy won’t remove capacity from the scalable resource. Otherwise, scale in is enabled and the target tracking policy can remove capacity from the scalable resource. The default value is false.

predefinedMetricSpecification PolicyTargetTrackingScalingPolicyConfigurationPredefinedMetricSpecification

A predefined metric. See supported fields below.

scaleInCooldown number

The amount of time, in seconds, after a scale in activity completes before another scale in activity can start.

scaleOutCooldown number

The amount of time, in seconds, after a scale out activity completes before another scale out activity can start.

targetValue float

The target value for the metric.

customizedMetricSpecification Dict[PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecification]

A custom CloudWatch metric. Documentation can be found at: AWS Customized Metric Specification. See supported fields below.

disableScaleIn bool

Indicates whether scale in by the target tracking policy is disabled. If the value is true, scale in is disabled and the target tracking policy won’t remove capacity from the scalable resource. Otherwise, scale in is enabled and the target tracking policy can remove capacity from the scalable resource. The default value is false.

predefinedMetricSpecification Dict[PolicyTargetTrackingScalingPolicyConfigurationPredefinedMetricSpecification]

A predefined metric. See supported fields below.

scaleInCooldown float

The amount of time, in seconds, after a scale in activity completes before another scale in activity can start.

scaleOutCooldown float

The amount of time, in seconds, after a scale out activity completes before another scale out activity can start.

PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecification

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

MetricName string

The name of the metric.

Namespace string

The namespace of the metric.

Statistic string

The statistic of the metric. Valid values: Average, Minimum, Maximum, SampleCount, and Sum.

Dimensions List<PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationDimensionArgs>

Configuration block(s) with the dimensions of the metric if the metric was published with dimensions. Detailed below.

Unit string

The unit of the metric.

MetricName string

The name of the metric.

Namespace string

The namespace of the metric.

Statistic string

The statistic of the metric. Valid values: Average, Minimum, Maximum, SampleCount, and Sum.

Dimensions []PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationDimension

Configuration block(s) with the dimensions of the metric if the metric was published with dimensions. Detailed below.

Unit string

The unit of the metric.

metricName string

The name of the metric.

namespace string

The namespace of the metric.

statistic string

The statistic of the metric. Valid values: Average, Minimum, Maximum, SampleCount, and Sum.

dimensions PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationDimension[]

Configuration block(s) with the dimensions of the metric if the metric was published with dimensions. Detailed below.

unit string

The unit of the metric.

metric_name str

The name of the metric.

namespace str

The namespace of the metric.

statistic str

The statistic of the metric. Valid values: Average, Minimum, Maximum, SampleCount, and Sum.

dimensions List[PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationDimension]

Configuration block(s) with the dimensions of the metric if the metric was published with dimensions. Detailed below.

unit str

The unit of the metric.

PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationDimension

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Name string

The name of the policy.

Value string

Value of the dimension.

Name string

The name of the policy.

Value string

Value of the dimension.

name string

The name of the policy.

value string

Value of the dimension.

name str

The name of the policy.

value str

Value of the dimension.

PolicyTargetTrackingScalingPolicyConfigurationPredefinedMetricSpecification

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

PredefinedMetricType string

The metric type.

ResourceLabel string

Reserved for future use.

PredefinedMetricType string

The metric type.

ResourceLabel string

Reserved for future use.

predefinedMetricType string

The metric type.

resourceLabel string

Reserved for future use.

predefinedMetricType str

The metric type.

resourceLabel str

Reserved for future use.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.