1. Packages
  2. AWS Native
  3. API Docs
  4. autoscaling
  5. ScalingPolicy

AWS Native is in preview. AWS Classic is fully supported.

AWS Native v0.103.0 published on Monday, Apr 22, 2024 by Pulumi

aws-native.autoscaling.ScalingPolicy

Explore with Pulumi AI

aws-native logo

AWS Native is in preview. AWS Classic is fully supported.

AWS Native v0.103.0 published on Monday, Apr 22, 2024 by Pulumi

    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

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

    Constructor syntax

    new ScalingPolicy(name: string, args: ScalingPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def ScalingPolicy(resource_name: str,
                      args: ScalingPolicyArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def ScalingPolicy(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      auto_scaling_group_name: Optional[str] = None,
                      adjustment_type: 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)
    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.
    
    

    Parameters

    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.

    Example

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

    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    const aws_nativeScalingPolicyResource = new aws_native.autoscaling.ScalingPolicy("aws-nativeScalingPolicyResource", {
        autoScalingGroupName: "string",
        adjustmentType: "string",
        cooldown: "string",
        estimatedInstanceWarmup: 0,
        metricAggregationType: "string",
        minAdjustmentMagnitude: 0,
        policyType: "string",
        predictiveScalingConfiguration: {
            metricSpecifications: [{
                targetValue: 0,
                customizedCapacityMetricSpecification: {
                    metricDataQueries: [{
                        id: "string",
                        expression: "string",
                        label: "string",
                        metricStat: {
                            metric: {
                                metricName: "string",
                                namespace: "string",
                                dimensions: [{
                                    name: "string",
                                    value: "string",
                                }],
                            },
                            stat: "string",
                            unit: "string",
                        },
                        returnData: false,
                    }],
                },
                customizedLoadMetricSpecification: {
                    metricDataQueries: [{
                        id: "string",
                        expression: "string",
                        label: "string",
                        metricStat: {
                            metric: {
                                metricName: "string",
                                namespace: "string",
                                dimensions: [{
                                    name: "string",
                                    value: "string",
                                }],
                            },
                            stat: "string",
                            unit: "string",
                        },
                        returnData: false,
                    }],
                },
                customizedScalingMetricSpecification: {
                    metricDataQueries: [{
                        id: "string",
                        expression: "string",
                        label: "string",
                        metricStat: {
                            metric: {
                                metricName: "string",
                                namespace: "string",
                                dimensions: [{
                                    name: "string",
                                    value: "string",
                                }],
                            },
                            stat: "string",
                            unit: "string",
                        },
                        returnData: false,
                    }],
                },
                predefinedLoadMetricSpecification: {
                    predefinedMetricType: "string",
                    resourceLabel: "string",
                },
                predefinedMetricPairSpecification: {
                    predefinedMetricType: "string",
                    resourceLabel: "string",
                },
                predefinedScalingMetricSpecification: {
                    predefinedMetricType: "string",
                    resourceLabel: "string",
                },
            }],
            maxCapacityBreachBehavior: "string",
            maxCapacityBuffer: 0,
            mode: "string",
            schedulingBufferTime: 0,
        },
        scalingAdjustment: 0,
        stepAdjustments: [{
            scalingAdjustment: 0,
            metricIntervalLowerBound: 0,
            metricIntervalUpperBound: 0,
        }],
        targetTrackingConfiguration: {
            targetValue: 0,
            customizedMetricSpecification: {
                metricName: "string",
                namespace: "string",
                statistic: "string",
                dimensions: [{
                    name: "string",
                    value: "string",
                }],
                unit: "string",
            },
            disableScaleIn: false,
            predefinedMetricSpecification: {
                predefinedMetricType: "string",
                resourceLabel: "string",
            },
        },
    });
    
    Coming soon!
    

    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.ScalingPolicyPredictiveScalingConfiguration
    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.ScalingPolicyStepAdjustment>
    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.ScalingPolicyTargetTrackingConfiguration
    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 ScalingPolicyPredictiveScalingConfiguration
    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<ScalingPolicyStepAdjustment>
    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 ScalingPolicyTargetTrackingConfiguration
    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 ScalingPolicyPredictiveScalingConfiguration
    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 ScalingPolicyStepAdjustment[]
    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 ScalingPolicyTargetTrackingConfiguration
    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, ScalingPolicyCustomizedMetricSpecificationArgs

    ScalingPolicyMetric, ScalingPolicyMetricArgs

    ScalingPolicyMetricDataQuery, ScalingPolicyMetricDataQueryArgs

    ScalingPolicyMetricDimension, ScalingPolicyMetricDimensionArgs

    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, ScalingPolicyMetricStatArgs

    ScalingPolicyPredefinedMetricSpecification, ScalingPolicyPredefinedMetricSpecificationArgs

    ScalingPolicyPredictiveScalingConfiguration, ScalingPolicyPredictiveScalingConfigurationArgs

    ScalingPolicyPredictiveScalingCustomizedCapacityMetric, ScalingPolicyPredictiveScalingCustomizedCapacityMetricArgs

    ScalingPolicyPredictiveScalingCustomizedLoadMetric, ScalingPolicyPredictiveScalingCustomizedLoadMetricArgs

    ScalingPolicyPredictiveScalingCustomizedScalingMetric, ScalingPolicyPredictiveScalingCustomizedScalingMetricArgs

    ScalingPolicyPredictiveScalingMetricSpecification, ScalingPolicyPredictiveScalingMetricSpecificationArgs

    ScalingPolicyPredictiveScalingPredefinedLoadMetric, ScalingPolicyPredictiveScalingPredefinedLoadMetricArgs

    ScalingPolicyPredictiveScalingPredefinedMetricPair, ScalingPolicyPredictiveScalingPredefinedMetricPairArgs

    ScalingPolicyPredictiveScalingPredefinedScalingMetric, ScalingPolicyPredictiveScalingPredefinedScalingMetricArgs

    ScalingPolicyStepAdjustment, ScalingPolicyStepAdjustmentArgs

    ScalingPolicyTargetTrackingConfiguration, ScalingPolicyTargetTrackingConfigurationArgs

    Package Details

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

    AWS Native is in preview. AWS Classic is fully supported.

    AWS Native v0.103.0 published on Monday, Apr 22, 2024 by Pulumi