aws-native logo
AWS Native v0.54.0, Mar 21 23

aws-native.autoscaling.ScalingPolicy

The AWS::AutoScaling::ScalingPolicy resource specifies an Amazon EC2 Auto Scaling scaling policy so that the Auto Scaling group can scale the number of instances available for your application.

Create ScalingPolicy Resource

new ScalingPolicy(name: string, args: ScalingPolicyArgs, opts?: CustomResourceOptions);
@overload
def ScalingPolicy(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  adjustment_type: Optional[str] = None,
                  auto_scaling_group_name: Optional[str] = None,
                  cooldown: Optional[str] = None,
                  estimated_instance_warmup: Optional[int] = None,
                  metric_aggregation_type: Optional[str] = None,
                  min_adjustment_magnitude: Optional[int] = None,
                  policy_type: Optional[str] = None,
                  predictive_scaling_configuration: Optional[ScalingPolicyPredictiveScalingConfigurationArgs] = None,
                  scaling_adjustment: Optional[int] = None,
                  step_adjustments: Optional[Sequence[ScalingPolicyStepAdjustmentArgs]] = None,
                  target_tracking_configuration: Optional[ScalingPolicyTargetTrackingConfigurationArgs] = None)
@overload
def ScalingPolicy(resource_name: str,
                  args: ScalingPolicyArgs,
                  opts: Optional[ResourceOptions] = None)
func NewScalingPolicy(ctx *Context, name string, args ScalingPolicyArgs, opts ...ResourceOption) (*ScalingPolicy, error)
public ScalingPolicy(string name, ScalingPolicyArgs args, CustomResourceOptions? opts = null)
public ScalingPolicy(String name, ScalingPolicyArgs args)
public ScalingPolicy(String name, ScalingPolicyArgs args, CustomResourceOptions options)
type: aws-native:autoscaling:ScalingPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args ScalingPolicyArgs
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 ScalingPolicyArgs
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 ScalingPolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ScalingPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args ScalingPolicyArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

AutoScalingGroupName string

The name of the Auto Scaling group.

AdjustmentType string

Specifies how the scaling adjustment is interpreted. The valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

Cooldown string

The duration of the policy's cooldown period, in seconds. When a cooldown period is specified here, it overrides the default cooldown period defined for the Auto Scaling group.

EstimatedInstanceWarmup int

The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics. If not provided, the default is to use the value from the default cooldown period for the Auto Scaling group. Valid only if the policy type is TargetTrackingScaling or StepScaling.

MetricAggregationType string

The aggregation type for the CloudWatch metrics. The valid values are Minimum, Maximum, and Average. If the aggregation type is null, the value is treated as Average. Valid only if the policy type is StepScaling.

MinAdjustmentMagnitude int

The minimum value to scale by when the adjustment type is PercentChangeInCapacity. For example, suppose that you create a step scaling policy to scale out an Auto Scaling group by 25 percent and you specify a MinAdjustmentMagnitude of 2. If the group has 4 instances and the scaling policy is performed, 25 percent of 4 is 1. However, because you specified a MinAdjustmentMagnitude of 2, Amazon EC2 Auto Scaling scales out the group by 2 instances.

PolicyType string

One of the following policy types: TargetTrackingScaling, StepScaling, SimpleScaling (default), PredictiveScaling

PredictiveScalingConfiguration Pulumi.AwsNative.AutoScaling.Inputs.ScalingPolicyPredictiveScalingConfigurationArgs

A predictive scaling policy. Includes support for predefined metrics only.

ScalingAdjustment int

The amount by which to scale, based on the specified adjustment type. A positive value adds to the current capacity while a negative number removes from the current capacity. For exact capacity, you must specify a positive value. Required if the policy type is SimpleScaling. (Not used with any other policy type.)

StepAdjustments List<Pulumi.AwsNative.AutoScaling.Inputs.ScalingPolicyStepAdjustmentArgs>

A set of adjustments that enable you to scale based on the size of the alarm breach. Required if the policy type is StepScaling. (Not used with any other policy type.)

TargetTrackingConfiguration Pulumi.AwsNative.AutoScaling.Inputs.ScalingPolicyTargetTrackingConfigurationArgs

A target tracking scaling policy. Includes support for predefined or customized metrics.

AutoScalingGroupName string

The name of the Auto Scaling group.

AdjustmentType string

Specifies how the scaling adjustment is interpreted. The valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

Cooldown string

The duration of the policy's cooldown period, in seconds. When a cooldown period is specified here, it overrides the default cooldown period defined for the Auto Scaling group.

EstimatedInstanceWarmup int

The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics. If not provided, the default is to use the value from the default cooldown period for the Auto Scaling group. Valid only if the policy type is TargetTrackingScaling or StepScaling.

MetricAggregationType string

The aggregation type for the CloudWatch metrics. The valid values are Minimum, Maximum, and Average. If the aggregation type is null, the value is treated as Average. Valid only if the policy type is StepScaling.

MinAdjustmentMagnitude int

The minimum value to scale by when the adjustment type is PercentChangeInCapacity. For example, suppose that you create a step scaling policy to scale out an Auto Scaling group by 25 percent and you specify a MinAdjustmentMagnitude of 2. If the group has 4 instances and the scaling policy is performed, 25 percent of 4 is 1. However, because you specified a MinAdjustmentMagnitude of 2, Amazon EC2 Auto Scaling scales out the group by 2 instances.

PolicyType string

One of the following policy types: TargetTrackingScaling, StepScaling, SimpleScaling (default), PredictiveScaling

PredictiveScalingConfiguration ScalingPolicyPredictiveScalingConfigurationArgs

A predictive scaling policy. Includes support for predefined metrics only.

ScalingAdjustment int

The amount by which to scale, based on the specified adjustment type. A positive value adds to the current capacity while a negative number removes from the current capacity. For exact capacity, you must specify a positive value. Required if the policy type is SimpleScaling. (Not used with any other policy type.)

StepAdjustments []ScalingPolicyStepAdjustmentArgs

A set of adjustments that enable you to scale based on the size of the alarm breach. Required if the policy type is StepScaling. (Not used with any other policy type.)

TargetTrackingConfiguration ScalingPolicyTargetTrackingConfigurationArgs

A target tracking scaling policy. Includes support for predefined or customized metrics.

autoScalingGroupName String

The name of the Auto Scaling group.

adjustmentType String

Specifies how the scaling adjustment is interpreted. The valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

cooldown String

The duration of the policy's cooldown period, in seconds. When a cooldown period is specified here, it overrides the default cooldown period defined for the Auto Scaling group.

estimatedInstanceWarmup Integer

The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics. If not provided, the default is to use the value from the default cooldown period for the Auto Scaling group. Valid only if the policy type is TargetTrackingScaling or StepScaling.

metricAggregationType String

The aggregation type for the CloudWatch metrics. The valid values are Minimum, Maximum, and Average. If the aggregation type is null, the value is treated as Average. Valid only if the policy type is StepScaling.

minAdjustmentMagnitude Integer

The minimum value to scale by when the adjustment type is PercentChangeInCapacity. For example, suppose that you create a step scaling policy to scale out an Auto Scaling group by 25 percent and you specify a MinAdjustmentMagnitude of 2. If the group has 4 instances and the scaling policy is performed, 25 percent of 4 is 1. However, because you specified a MinAdjustmentMagnitude of 2, Amazon EC2 Auto Scaling scales out the group by 2 instances.

policyType String

One of the following policy types: TargetTrackingScaling, StepScaling, SimpleScaling (default), PredictiveScaling

predictiveScalingConfiguration ScalingPolicyPredictiveScalingConfigurationArgs

A predictive scaling policy. Includes support for predefined metrics only.

scalingAdjustment Integer

The amount by which to scale, based on the specified adjustment type. A positive value adds to the current capacity while a negative number removes from the current capacity. For exact capacity, you must specify a positive value. Required if the policy type is SimpleScaling. (Not used with any other policy type.)

stepAdjustments List<ScalingPolicyStepAdjustmentArgs>

A set of adjustments that enable you to scale based on the size of the alarm breach. Required if the policy type is StepScaling. (Not used with any other policy type.)

targetTrackingConfiguration ScalingPolicyTargetTrackingConfigurationArgs

A target tracking scaling policy. Includes support for predefined or customized metrics.

autoScalingGroupName string

The name of the Auto Scaling group.

adjustmentType string

Specifies how the scaling adjustment is interpreted. The valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

cooldown string

The duration of the policy's cooldown period, in seconds. When a cooldown period is specified here, it overrides the default cooldown period defined for the Auto Scaling group.

estimatedInstanceWarmup number

The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics. If not provided, the default is to use the value from the default cooldown period for the Auto Scaling group. Valid only if the policy type is TargetTrackingScaling or StepScaling.

metricAggregationType string

The aggregation type for the CloudWatch metrics. The valid values are Minimum, Maximum, and Average. If the aggregation type is null, the value is treated as Average. Valid only if the policy type is StepScaling.

minAdjustmentMagnitude number

The minimum value to scale by when the adjustment type is PercentChangeInCapacity. For example, suppose that you create a step scaling policy to scale out an Auto Scaling group by 25 percent and you specify a MinAdjustmentMagnitude of 2. If the group has 4 instances and the scaling policy is performed, 25 percent of 4 is 1. However, because you specified a MinAdjustmentMagnitude of 2, Amazon EC2 Auto Scaling scales out the group by 2 instances.

policyType string

One of the following policy types: TargetTrackingScaling, StepScaling, SimpleScaling (default), PredictiveScaling

predictiveScalingConfiguration ScalingPolicyPredictiveScalingConfigurationArgs

A predictive scaling policy. Includes support for predefined metrics only.

scalingAdjustment number

The amount by which to scale, based on the specified adjustment type. A positive value adds to the current capacity while a negative number removes from the current capacity. For exact capacity, you must specify a positive value. Required if the policy type is SimpleScaling. (Not used with any other policy type.)

stepAdjustments ScalingPolicyStepAdjustmentArgs[]

A set of adjustments that enable you to scale based on the size of the alarm breach. Required if the policy type is StepScaling. (Not used with any other policy type.)

targetTrackingConfiguration ScalingPolicyTargetTrackingConfigurationArgs

A target tracking scaling policy. Includes support for predefined or customized metrics.

auto_scaling_group_name str

The name of the Auto Scaling group.

adjustment_type str

Specifies how the scaling adjustment is interpreted. The valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

cooldown str

The duration of the policy's cooldown period, in seconds. When a cooldown period is specified here, it overrides the default cooldown period defined for the Auto Scaling group.

estimated_instance_warmup int

The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics. If not provided, the default is to use the value from the default cooldown period for the Auto Scaling group. Valid only if the policy type is TargetTrackingScaling or StepScaling.

metric_aggregation_type str

The aggregation type for the CloudWatch metrics. The valid values are Minimum, Maximum, and Average. If the aggregation type is null, the value is treated as Average. Valid only if the policy type is StepScaling.

min_adjustment_magnitude int

The minimum value to scale by when the adjustment type is PercentChangeInCapacity. For example, suppose that you create a step scaling policy to scale out an Auto Scaling group by 25 percent and you specify a MinAdjustmentMagnitude of 2. If the group has 4 instances and the scaling policy is performed, 25 percent of 4 is 1. However, because you specified a MinAdjustmentMagnitude of 2, Amazon EC2 Auto Scaling scales out the group by 2 instances.

policy_type str

One of the following policy types: TargetTrackingScaling, StepScaling, SimpleScaling (default), PredictiveScaling

predictive_scaling_configuration ScalingPolicyPredictiveScalingConfigurationArgs

A predictive scaling policy. Includes support for predefined metrics only.

scaling_adjustment int

The amount by which to scale, based on the specified adjustment type. A positive value adds to the current capacity while a negative number removes from the current capacity. For exact capacity, you must specify a positive value. Required if the policy type is SimpleScaling. (Not used with any other policy type.)

step_adjustments Sequence[ScalingPolicyStepAdjustmentArgs]

A set of adjustments that enable you to scale based on the size of the alarm breach. Required if the policy type is StepScaling. (Not used with any other policy type.)

target_tracking_configuration ScalingPolicyTargetTrackingConfigurationArgs

A target tracking scaling policy. Includes support for predefined or customized metrics.

autoScalingGroupName String

The name of the Auto Scaling group.

adjustmentType String

Specifies how the scaling adjustment is interpreted. The valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

cooldown String

The duration of the policy's cooldown period, in seconds. When a cooldown period is specified here, it overrides the default cooldown period defined for the Auto Scaling group.

estimatedInstanceWarmup Number

The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics. If not provided, the default is to use the value from the default cooldown period for the Auto Scaling group. Valid only if the policy type is TargetTrackingScaling or StepScaling.

metricAggregationType String

The aggregation type for the CloudWatch metrics. The valid values are Minimum, Maximum, and Average. If the aggregation type is null, the value is treated as Average. Valid only if the policy type is StepScaling.

minAdjustmentMagnitude Number

The minimum value to scale by when the adjustment type is PercentChangeInCapacity. For example, suppose that you create a step scaling policy to scale out an Auto Scaling group by 25 percent and you specify a MinAdjustmentMagnitude of 2. If the group has 4 instances and the scaling policy is performed, 25 percent of 4 is 1. However, because you specified a MinAdjustmentMagnitude of 2, Amazon EC2 Auto Scaling scales out the group by 2 instances.

policyType String

One of the following policy types: TargetTrackingScaling, StepScaling, SimpleScaling (default), PredictiveScaling

predictiveScalingConfiguration Property Map

A predictive scaling policy. Includes support for predefined metrics only.

scalingAdjustment Number

The amount by which to scale, based on the specified adjustment type. A positive value adds to the current capacity while a negative number removes from the current capacity. For exact capacity, you must specify a positive value. Required if the policy type is SimpleScaling. (Not used with any other policy type.)

stepAdjustments List<Property Map>

A set of adjustments that enable you to scale based on the size of the alarm breach. Required if the policy type is StepScaling. (Not used with any other policy type.)

targetTrackingConfiguration Property Map

A target tracking scaling policy. Includes support for predefined or customized metrics.

Outputs

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

Arn string

The ARN of the AutoScaling scaling policy

Id string

The provider-assigned unique ID for this managed resource.

PolicyName string
Arn string

The ARN of the AutoScaling scaling policy

Id string

The provider-assigned unique ID for this managed resource.

PolicyName string
arn String

The ARN of the AutoScaling scaling policy

id String

The provider-assigned unique ID for this managed resource.

policyName String
arn string

The ARN of the AutoScaling scaling policy

id string

The provider-assigned unique ID for this managed resource.

policyName string
arn str

The ARN of the AutoScaling scaling policy

id str

The provider-assigned unique ID for this managed resource.

policy_name str
arn String

The ARN of the AutoScaling scaling policy

id String

The provider-assigned unique ID for this managed resource.

policyName String

Supporting Types

ScalingPolicyCustomizedMetricSpecification

ScalingPolicyMetric

ScalingPolicyMetricDataQuery

ScalingPolicyMetricDimension

Name string
Value string
Name string
Value string
name String
value String
name string
value string
name str
value str
name String
value String

ScalingPolicyMetricStat

ScalingPolicyPredefinedMetricSpecification

ScalingPolicyPredictiveScalingConfiguration

ScalingPolicyPredictiveScalingCustomizedCapacityMetric

ScalingPolicyPredictiveScalingCustomizedLoadMetric

ScalingPolicyPredictiveScalingCustomizedScalingMetric

ScalingPolicyPredictiveScalingMetricSpecification

ScalingPolicyPredictiveScalingPredefinedLoadMetric

ScalingPolicyPredictiveScalingPredefinedMetricPair

ScalingPolicyPredictiveScalingPredefinedScalingMetric

ScalingPolicyStepAdjustment

ScalingPolicyTargetTrackingConfiguration

Package Details

Repository
AWS Native pulumi/pulumi-aws-native
License
Apache-2.0