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:
- Resource
Id string The resource type and unique identifier string for the resource associated with the scaling policy. Documentation can be found in the
ResourceIdparameter at: AWS Application Auto Scaling API Reference- Scalable
Dimension string The scalable dimension of the scalable target. Documentation can be found in the
ScalableDimensionparameter at: AWS Application Auto Scaling API Reference- Service
Namespace string The AWS service namespace of the scalable target. Documentation can be found in the
ServiceNamespaceparameter at: AWS Application Auto Scaling API Reference- Name string
The name of the policy.
- Policy
Type string The policy type. Valid values are
StepScalingandTargetTrackingScaling. Defaults toStepScaling. Certain services only support only one policy type. For more information see the Target Tracking Scaling Policies and Step Scaling Policies documentation.- Step
Scaling PolicyPolicy Configuration Step Scaling Policy Configuration Args Step scaling policy configuration, requires
policy_type = "StepScaling"(default). See supported fields below.- Target
Tracking PolicyScaling Policy Configuration Target Tracking Scaling Policy Configuration Args A target tracking policy, requires
policy_type = "TargetTrackingScaling". See supported fields below.
- Resource
Id string The resource type and unique identifier string for the resource associated with the scaling policy. Documentation can be found in the
ResourceIdparameter at: AWS Application Auto Scaling API Reference- Scalable
Dimension string The scalable dimension of the scalable target. Documentation can be found in the
ScalableDimensionparameter at: AWS Application Auto Scaling API Reference- Service
Namespace string The AWS service namespace of the scalable target. Documentation can be found in the
ServiceNamespaceparameter at: AWS Application Auto Scaling API Reference- Name string
The name of the policy.
- Policy
Type string The policy type. Valid values are
StepScalingandTargetTrackingScaling. Defaults toStepScaling. Certain services only support only one policy type. For more information see the Target Tracking Scaling Policies and Step Scaling Policies documentation.- Step
Scaling PolicyPolicy Configuration Step Scaling Policy Configuration Step scaling policy configuration, requires
policy_type = "StepScaling"(default). See supported fields below.- Target
Tracking PolicyScaling Policy Configuration Target Tracking Scaling Policy Configuration A target tracking policy, requires
policy_type = "TargetTrackingScaling". See supported fields below.
- resource
Id string The resource type and unique identifier string for the resource associated with the scaling policy. Documentation can be found in the
ResourceIdparameter at: AWS Application Auto Scaling API Reference- scalable
Dimension string The scalable dimension of the scalable target. Documentation can be found in the
ScalableDimensionparameter at: AWS Application Auto Scaling API Reference- service
Namespace string The AWS service namespace of the scalable target. Documentation can be found in the
ServiceNamespaceparameter at: AWS Application Auto Scaling API Reference- name string
The name of the policy.
- policy
Type string The policy type. Valid values are
StepScalingandTargetTrackingScaling. Defaults toStepScaling. Certain services only support only one policy type. For more information see the Target Tracking Scaling Policies and Step Scaling Policies documentation.- step
Scaling PolicyPolicy Configuration Step Scaling Policy Configuration Step scaling policy configuration, requires
policy_type = "StepScaling"(default). See supported fields below.- target
Tracking PolicyScaling Policy Configuration Target Tracking Scaling Policy Configuration 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
ResourceIdparameter at: AWS Application Auto Scaling API Reference- scalable_
dimension str The scalable dimension of the scalable target. Documentation can be found in the
ScalableDimensionparameter at: AWS Application Auto Scaling API Reference- service_
namespace str The AWS service namespace of the scalable target. Documentation can be found in the
ServiceNamespaceparameter at: AWS Application Auto Scaling API Reference- name str
The name of the policy.
- policy_
type str The policy type. Valid values are
StepScalingandTargetTrackingScaling. Defaults toStepScaling. Certain services only support only one policy type. For more information see the Target Tracking Scaling Policies and Step Scaling Policies documentation.- step_
scaling_ Dict[Policypolicy_ configuration Step Scaling Policy Configuration] Step scaling policy configuration, requires
policy_type = "StepScaling"(default). See supported fields below.- target_
tracking_ Dict[Policyscaling_ policy_ configuration Target Tracking Scaling Policy Configuration] 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:
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): Policystatic 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.
- Policy
Type string The policy type. Valid values are
StepScalingandTargetTrackingScaling. Defaults toStepScaling. Certain services only support only one policy type. For more information see the Target Tracking Scaling Policies and Step Scaling Policies documentation.- Resource
Id string The resource type and unique identifier string for the resource associated with the scaling policy. Documentation can be found in the
ResourceIdparameter at: AWS Application Auto Scaling API Reference- Scalable
Dimension string The scalable dimension of the scalable target. Documentation can be found in the
ScalableDimensionparameter at: AWS Application Auto Scaling API Reference- Service
Namespace string The AWS service namespace of the scalable target. Documentation can be found in the
ServiceNamespaceparameter at: AWS Application Auto Scaling API Reference- Step
Scaling PolicyPolicy Configuration Step Scaling Policy Configuration Args Step scaling policy configuration, requires
policy_type = "StepScaling"(default). See supported fields below.- Target
Tracking PolicyScaling Policy Configuration Target Tracking Scaling Policy Configuration Args 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.
- Policy
Type string The policy type. Valid values are
StepScalingandTargetTrackingScaling. Defaults toStepScaling. Certain services only support only one policy type. For more information see the Target Tracking Scaling Policies and Step Scaling Policies documentation.- Resource
Id string The resource type and unique identifier string for the resource associated with the scaling policy. Documentation can be found in the
ResourceIdparameter at: AWS Application Auto Scaling API Reference- Scalable
Dimension string The scalable dimension of the scalable target. Documentation can be found in the
ScalableDimensionparameter at: AWS Application Auto Scaling API Reference- Service
Namespace string The AWS service namespace of the scalable target. Documentation can be found in the
ServiceNamespaceparameter at: AWS Application Auto Scaling API Reference- Step
Scaling PolicyPolicy Configuration Step Scaling Policy Configuration Step scaling policy configuration, requires
policy_type = "StepScaling"(default). See supported fields below.- Target
Tracking PolicyScaling Policy Configuration Target Tracking Scaling Policy Configuration 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.
- policy
Type string The policy type. Valid values are
StepScalingandTargetTrackingScaling. Defaults toStepScaling. Certain services only support only one policy type. For more information see the Target Tracking Scaling Policies and Step Scaling Policies documentation.- resource
Id string The resource type and unique identifier string for the resource associated with the scaling policy. Documentation can be found in the
ResourceIdparameter at: AWS Application Auto Scaling API Reference- scalable
Dimension string The scalable dimension of the scalable target. Documentation can be found in the
ScalableDimensionparameter at: AWS Application Auto Scaling API Reference- service
Namespace string The AWS service namespace of the scalable target. Documentation can be found in the
ServiceNamespaceparameter at: AWS Application Auto Scaling API Reference- step
Scaling PolicyPolicy Configuration Step Scaling Policy Configuration Step scaling policy configuration, requires
policy_type = "StepScaling"(default). See supported fields below.- target
Tracking PolicyScaling Policy Configuration Target Tracking Scaling Policy Configuration 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
StepScalingandTargetTrackingScaling. Defaults toStepScaling. 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
ResourceIdparameter at: AWS Application Auto Scaling API Reference- scalable_
dimension str The scalable dimension of the scalable target. Documentation can be found in the
ScalableDimensionparameter at: AWS Application Auto Scaling API Reference- service_
namespace str The AWS service namespace of the scalable target. Documentation can be found in the
ServiceNamespaceparameter at: AWS Application Auto Scaling API Reference- step_
scaling_ Dict[Policypolicy_ configuration Step Scaling Policy Configuration] Step scaling policy configuration, requires
policy_type = "StepScaling"(default). See supported fields below.- target_
tracking_ Dict[Policyscaling_ policy_ configuration Target Tracking Scaling Policy Configuration] A target tracking policy, requires
policy_type = "TargetTrackingScaling". See supported fields below.
Supporting Types
PolicyStepScalingPolicyConfiguration
- Adjustment
Type string Specifies whether the adjustment is an absolute number or a percentage of the current capacity. Valid values are
ChangeInCapacity,ExactCapacity, andPercentChangeInCapacity.- Cooldown int
The amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start.
- Metric
Aggregation stringType 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 intMagnitude 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<PolicyStep Scaling Policy Configuration Step Adjustment Args> A set of adjustments that manage scaling. These have the following structure:
- Adjustment
Type string Specifies whether the adjustment is an absolute number or a percentage of the current capacity. Valid values are
ChangeInCapacity,ExactCapacity, andPercentChangeInCapacity.- Cooldown int
The amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start.
- Metric
Aggregation stringType 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 intMagnitude 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 []PolicyStep Scaling Policy Configuration Step Adjustment A set of adjustments that manage scaling. These have the following structure:
- adjustment
Type string Specifies whether the adjustment is an absolute number or a percentage of the current capacity. Valid values are
ChangeInCapacity,ExactCapacity, andPercentChangeInCapacity.- cooldown number
The amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start.
- metric
Aggregation stringType 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 numberMagnitude 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 PolicyStep Scaling Policy Configuration Step Adjustment[] 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, andPercentChangeInCapacity.- cooldown float
The amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start.
- metric_
aggregation_ strtype 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_ floatmagnitude 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[PolicyStep Scaling Policy Configuration Step Adjustment] A set of adjustments that manage scaling. These have the following structure:
PolicyStepScalingPolicyConfigurationStepAdjustment
- Scaling
Adjustment 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.
- Metric
Interval stringLower Bound 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.
- Metric
Interval stringUpper Bound 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 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.
- Metric
Interval stringLower Bound 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.
- Metric
Interval stringUpper Bound 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 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.
- metric
Interval stringLower Bound 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.
- metric
Interval stringUpper Bound 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.
- metric
Interval strLower Bound 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.
- metric
Interval strUpper Bound 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
- Target
Value double The target value for the metric.
- Customized
Metric PolicySpecification Target Tracking Scaling Policy Configuration Customized Metric Specification Args A custom CloudWatch metric. Documentation can be found at: AWS Customized Metric Specification. See supported fields below.
- Disable
Scale boolIn 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.- Predefined
Metric PolicySpecification Target Tracking Scaling Policy Configuration Predefined Metric Specification Args A predefined metric. See supported fields below.
- Scale
In intCooldown The amount of time, in seconds, after a scale in activity completes before another scale in activity can start.
- Scale
Out intCooldown The amount of time, in seconds, after a scale out activity completes before another scale out activity can start.
- Target
Value float64 The target value for the metric.
- Customized
Metric PolicySpecification Target Tracking Scaling Policy Configuration Customized Metric Specification A custom CloudWatch metric. Documentation can be found at: AWS Customized Metric Specification. See supported fields below.
- Disable
Scale boolIn 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.- Predefined
Metric PolicySpecification Target Tracking Scaling Policy Configuration Predefined Metric Specification A predefined metric. See supported fields below.
- Scale
In intCooldown The amount of time, in seconds, after a scale in activity completes before another scale in activity can start.
- Scale
Out intCooldown The amount of time, in seconds, after a scale out activity completes before another scale out activity can start.
- target
Value number The target value for the metric.
- customized
Metric PolicySpecification Target Tracking Scaling Policy Configuration Customized Metric Specification A custom CloudWatch metric. Documentation can be found at: AWS Customized Metric Specification. See supported fields below.
- disable
Scale booleanIn 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.- predefined
Metric PolicySpecification Target Tracking Scaling Policy Configuration Predefined Metric Specification A predefined metric. See supported fields below.
- scale
In numberCooldown The amount of time, in seconds, after a scale in activity completes before another scale in activity can start.
- scale
Out numberCooldown The amount of time, in seconds, after a scale out activity completes before another scale out activity can start.
- target
Value float The target value for the metric.
- customized
Metric Dict[PolicySpecification Target Tracking Scaling Policy Configuration Customized Metric Specification] A custom CloudWatch metric. Documentation can be found at: AWS Customized Metric Specification. See supported fields below.
- disable
Scale boolIn 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.- predefined
Metric Dict[PolicySpecification Target Tracking Scaling Policy Configuration Predefined Metric Specification] A predefined metric. See supported fields below.
- scale
In floatCooldown The amount of time, in seconds, after a scale in activity completes before another scale in activity can start.
- scale
Out floatCooldown The amount of time, in seconds, after a scale out activity completes before another scale out activity can start.
PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecification
- Metric
Name 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, andSum.- Dimensions
List<Policy
Target Tracking Scaling Policy Configuration Customized Metric Specification Dimension Args> 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 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, andSum.- Dimensions
[]Policy
Target Tracking Scaling Policy Configuration Customized Metric Specification Dimension 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 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, andSum.- dimensions
Policy
Target Tracking Scaling Policy Configuration Customized Metric Specification Dimension[] 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, andSum.- dimensions
List[Policy
Target Tracking Scaling Policy Configuration Customized Metric Specification Dimension] 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
PolicyTargetTrackingScalingPolicyConfigurationPredefinedMetricSpecification
- Predefined
Metric stringType The metric type.
- Resource
Label string Reserved for future use.
- Predefined
Metric stringType The metric type.
- Resource
Label string Reserved for future use.
- predefined
Metric stringType The metric type.
- resource
Label string Reserved for future use.
- predefined
Metric strType The metric type.
- resource
Label 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
awsTerraform Provider.