You are viewing documentation for version 3 of the AWS SDK for Ruby. Version 2 documentation can be found here.

Class: Aws::AutoScaling::Types::PutScalingPolicyType

Inherits:
Struct
  • Object
show all
Defined in:
gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/types.rb

Overview

Note:

When making an API call, you may pass PutScalingPolicyType data as a hash:

{
  auto_scaling_group_name: "ResourceName", # required
  policy_name: "XmlStringMaxLen255", # required
  policy_type: "XmlStringMaxLen64",
  adjustment_type: "XmlStringMaxLen255",
  min_adjustment_step: 1,
  min_adjustment_magnitude: 1,
  scaling_adjustment: 1,
  cooldown: 1,
  metric_aggregation_type: "XmlStringMaxLen32",
  step_adjustments: [
    {
      metric_interval_lower_bound: 1.0,
      metric_interval_upper_bound: 1.0,
      scaling_adjustment: 1, # required
    },
  ],
  estimated_instance_warmup: 1,
  target_tracking_configuration: {
    predefined_metric_specification: {
      predefined_metric_type: "ASGAverageCPUUtilization", # required, accepts ASGAverageCPUUtilization, ASGAverageNetworkIn, ASGAverageNetworkOut, ALBRequestCountPerTarget
      resource_label: "XmlStringMaxLen1023",
    },
    customized_metric_specification: {
      metric_name: "MetricName", # required
      namespace: "MetricNamespace", # required
      dimensions: [
        {
          name: "MetricDimensionName", # required
          value: "MetricDimensionValue", # required
        },
      ],
      statistic: "Average", # required, accepts Average, Minimum, Maximum, SampleCount, Sum
      unit: "MetricUnit",
    },
    target_value: 1.0, # required
    disable_scale_in: false,
  },
}

Contains the parameters for PutScalingPolicy.

Instance Attribute Summary collapse

Instance Attribute Details

#adjustment_typeString

The adjustment type. The valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

This parameter is supported if the policy type is SimpleScaling or StepScaling.

For more information, see Dynamic Scaling in the Auto Scaling User Guide.

Returns:

  • (String)


3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/types.rb', line 3337

class PutScalingPolicyType < Struct.new(
  :auto_scaling_group_name,
  :policy_name,
  :policy_type,
  :adjustment_type,
  :min_adjustment_step,
  :min_adjustment_magnitude,
  :scaling_adjustment,
  :cooldown,
  :metric_aggregation_type,
  :step_adjustments,
  :estimated_instance_warmup,
  :target_tracking_configuration)
  include Aws::Structure
end

#auto_scaling_group_nameString

The name or ARN of the group.

Returns:

  • (String)


3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/types.rb', line 3337

class PutScalingPolicyType < Struct.new(
  :auto_scaling_group_name,
  :policy_name,
  :policy_type,
  :adjustment_type,
  :min_adjustment_step,
  :min_adjustment_magnitude,
  :scaling_adjustment,
  :cooldown,
  :metric_aggregation_type,
  :step_adjustments,
  :estimated_instance_warmup,
  :target_tracking_configuration)
  include Aws::Structure
end

#cooldownInteger

The amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start. If this parameter is not specified, the default cooldown period for the group applies.

This parameter is supported if the policy type is SimpleScaling.

For more information, see Auto Scaling Cooldowns in the Auto Scaling User Guide.

Returns:

  • (Integer)


3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/types.rb', line 3337

class PutScalingPolicyType < Struct.new(
  :auto_scaling_group_name,
  :policy_name,
  :policy_type,
  :adjustment_type,
  :min_adjustment_step,
  :min_adjustment_magnitude,
  :scaling_adjustment,
  :cooldown,
  :metric_aggregation_type,
  :step_adjustments,
  :estimated_instance_warmup,
  :target_tracking_configuration)
  include Aws::Structure
end

#estimated_instance_warmupInteger

The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics. The default is to use the value specified for the default cooldown period for the group.

This parameter is supported if the policy type is StepScaling or TargetTrackingScaling.

Returns:

  • (Integer)


3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/types.rb', line 3337

class PutScalingPolicyType < Struct.new(
  :auto_scaling_group_name,
  :policy_name,
  :policy_type,
  :adjustment_type,
  :min_adjustment_step,
  :min_adjustment_magnitude,
  :scaling_adjustment,
  :cooldown,
  :metric_aggregation_type,
  :step_adjustments,
  :estimated_instance_warmup,
  :target_tracking_configuration)
  include Aws::Structure
end

#metric_aggregation_typeString

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.

This parameter is supported if the policy type is StepScaling.

Returns:

  • (String)


3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/types.rb', line 3337

class PutScalingPolicyType < Struct.new(
  :auto_scaling_group_name,
  :policy_name,
  :policy_type,
  :adjustment_type,
  :min_adjustment_step,
  :min_adjustment_magnitude,
  :scaling_adjustment,
  :cooldown,
  :metric_aggregation_type,
  :step_adjustments,
  :estimated_instance_warmup,
  :target_tracking_configuration)
  include Aws::Structure
end

#min_adjustment_magnitudeInteger

The minimum number of instances to scale. If the value of AdjustmentType is PercentChangeInCapacity, the scaling policy changes the DesiredCapacity of the Auto Scaling group by at least this many instances. Otherwise, the error is ValidationError.

This parameter is supported if the policy type is SimpleScaling or StepScaling.

Returns:

  • (Integer)


3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/types.rb', line 3337

class PutScalingPolicyType < Struct.new(
  :auto_scaling_group_name,
  :policy_name,
  :policy_type,
  :adjustment_type,
  :min_adjustment_step,
  :min_adjustment_magnitude,
  :scaling_adjustment,
  :cooldown,
  :metric_aggregation_type,
  :step_adjustments,
  :estimated_instance_warmup,
  :target_tracking_configuration)
  include Aws::Structure
end

#min_adjustment_stepInteger

Available for backward compatibility. Use MinAdjustmentMagnitude instead.

Returns:

  • (Integer)


3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/types.rb', line 3337

class PutScalingPolicyType < Struct.new(
  :auto_scaling_group_name,
  :policy_name,
  :policy_type,
  :adjustment_type,
  :min_adjustment_step,
  :min_adjustment_magnitude,
  :scaling_adjustment,
  :cooldown,
  :metric_aggregation_type,
  :step_adjustments,
  :estimated_instance_warmup,
  :target_tracking_configuration)
  include Aws::Structure
end

#policy_nameString

The name of the policy.

Returns:

  • (String)


3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/types.rb', line 3337

class PutScalingPolicyType < Struct.new(
  :auto_scaling_group_name,
  :policy_name,
  :policy_type,
  :adjustment_type,
  :min_adjustment_step,
  :min_adjustment_magnitude,
  :scaling_adjustment,
  :cooldown,
  :metric_aggregation_type,
  :step_adjustments,
  :estimated_instance_warmup,
  :target_tracking_configuration)
  include Aws::Structure
end

#policy_typeString

The policy type. The valid values are SimpleScaling, StepScaling, and TargetTrackingScaling. If the policy type is null, the value is treated as SimpleScaling.

Returns:

  • (String)


3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/types.rb', line 3337

class PutScalingPolicyType < Struct.new(
  :auto_scaling_group_name,
  :policy_name,
  :policy_type,
  :adjustment_type,
  :min_adjustment_step,
  :min_adjustment_magnitude,
  :scaling_adjustment,
  :cooldown,
  :metric_aggregation_type,
  :step_adjustments,
  :estimated_instance_warmup,
  :target_tracking_configuration)
  include Aws::Structure
end

#scaling_adjustmentInteger

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.

This parameter is required if the policy type is SimpleScaling and not supported otherwise.

Returns:

  • (Integer)


3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/types.rb', line 3337

class PutScalingPolicyType < Struct.new(
  :auto_scaling_group_name,
  :policy_name,
  :policy_type,
  :adjustment_type,
  :min_adjustment_step,
  :min_adjustment_magnitude,
  :scaling_adjustment,
  :cooldown,
  :metric_aggregation_type,
  :step_adjustments,
  :estimated_instance_warmup,
  :target_tracking_configuration)
  include Aws::Structure
end

#step_adjustmentsArray<Types::StepAdjustment>

A set of adjustments that enable you to scale based on the size of the alarm breach.

This parameter is required if the policy type is StepScaling and not supported otherwise.

Returns:



3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/types.rb', line 3337

class PutScalingPolicyType < Struct.new(
  :auto_scaling_group_name,
  :policy_name,
  :policy_type,
  :adjustment_type,
  :min_adjustment_step,
  :min_adjustment_magnitude,
  :scaling_adjustment,
  :cooldown,
  :metric_aggregation_type,
  :step_adjustments,
  :estimated_instance_warmup,
  :target_tracking_configuration)
  include Aws::Structure
end

#target_tracking_configurationTypes::TargetTrackingConfiguration

The configuration of a target tracking policy.

This parameter is required if the policy type is TargetTrackingScaling and not supported otherwise.



3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/types.rb', line 3337

class PutScalingPolicyType < Struct.new(
  :auto_scaling_group_name,
  :policy_name,
  :policy_type,
  :adjustment_type,
  :min_adjustment_step,
  :min_adjustment_magnitude,
  :scaling_adjustment,
  :cooldown,
  :metric_aggregation_type,
  :step_adjustments,
  :estimated_instance_warmup,
  :target_tracking_configuration)
  include Aws::Structure
end