« blib/lib/Paws/AutoScaling/PutNotificationConfiguration.pm
↑ Summary
blib/lib/Paws/AutoScaling/PutScheduledUpdateGroupAction.pm »
| 1 | |||
| 2 | package Paws::AutoScaling::PutScalingPolicy; | ||
| 3 | use Moose; | ||
| 4 | has AdjustmentType => (is => 'ro', isa => 'Str'); | ||
| 5 | has AutoScalingGroupName => (is => 'ro', isa => 'Str', required => 1); | ||
| 6 | has Cooldown => (is => 'ro', isa => 'Int'); | ||
| 7 | has Enabled => (is => 'ro', isa => 'Bool'); | ||
| 8 | has EstimatedInstanceWarmup => (is => 'ro', isa => 'Int'); | ||
| 9 | has MetricAggregationType => (is => 'ro', isa => 'Str'); | ||
| 10 | has MinAdjustmentMagnitude => (is => 'ro', isa => 'Int'); | ||
| 11 | has MinAdjustmentStep => (is => 'ro', isa => 'Int'); | ||
| 12 | has PolicyName => (is => 'ro', isa => 'Str', required => 1); | ||
| 13 | has PolicyType => (is => 'ro', isa => 'Str'); | ||
| 14 | has PredictiveScalingConfiguration => (is => 'ro', isa => 'Paws::AutoScaling::PredictiveScalingConfiguration'); | ||
| 15 | has ScalingAdjustment => (is => 'ro', isa => 'Int'); | ||
| 16 | has StepAdjustments => (is => 'ro', isa => 'ArrayRef[Paws::AutoScaling::StepAdjustment]'); | ||
| 17 | has TargetTrackingConfiguration => (is => 'ro', isa => 'Paws::AutoScaling::TargetTrackingConfiguration'); | ||
| 18 | |||
| 19 | use MooseX::ClassAttribute; | ||
| 20 | |||
| 21 | class_has _api_call => (isa => 'Str', is => 'ro', default => 'PutScalingPolicy'); | ||
| 22 | class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::AutoScaling::PolicyARNType'); | ||
| 23 | class_has _result_key => (isa => 'Str', is => 'ro', default => 'PutScalingPolicyResult'); | ||
| 24 | 1; | ||
| 25 | |||
| 26 | ### main pod documentation begin ### | ||
| 27 | |||
| 28 | =head1 NAME | ||
| 29 | |||
| 30 | Paws::AutoScaling::PutScalingPolicy - Arguments for method PutScalingPolicy on L<Paws::AutoScaling> | ||
| 31 | |||
| 32 | =head1 DESCRIPTION | ||
| 33 | |||
| 34 | This class represents the parameters used for calling the method PutScalingPolicy on the | ||
| 35 | L<Auto Scaling|Paws::AutoScaling> service. Use the attributes of this class | ||
| 36 | as arguments to method PutScalingPolicy. | ||
| 37 | |||
| 38 | You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to PutScalingPolicy. | ||
| 39 | |||
| 40 | =head1 SYNOPSIS | ||
| 41 | |||
| 42 | my $autoscaling = Paws->service('AutoScaling'); | ||
| 43 | # To add a scaling policy to an Auto Scaling group | ||
| 44 | # This example adds the specified policy to the specified Auto Scaling group. | ||
| 45 | my $PolicyARNType = $autoscaling->PutScalingPolicy( | ||
| 46 | 'AutoScalingGroupName' => 'my-auto-scaling-group', | ||
| 47 | 'PolicyName' => 'alb1000-target-tracking-scaling-policy', | ||
| 48 | 'PolicyType' => 'TargetTrackingScaling', | ||
| 49 | 'TargetTrackingConfiguration' => { | ||
| 50 | 'PredefinedMetricSpecification' => { | ||
| 51 | 'PredefinedMetricType' => 'ALBRequestCountPerTarget', | ||
| 52 | 'ResourceLabel' => | ||
| 53 | 'app/my-alb/778d41231b141a0f/targetgroup/my-alb-target-group/943f017f100becff' | ||
| 54 | }, | ||
| 55 | 'TargetValue' => 1000 | ||
| 56 | } | ||
| 57 | ); | ||
| 58 | |||
| 59 | # Results: | ||
| 60 | my $Alarms = $PolicyARNType->Alarms; | ||
| 61 | my $PolicyARN = $PolicyARNType->PolicyARN; | ||
| 62 | |||
| 63 | # Returns a L<Paws::AutoScaling::PolicyARNType> object. | ||
| 64 | |||
| 65 | Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object. | ||
| 66 | For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/autoscaling/PutScalingPolicy> | ||
| 67 | |||
| 68 | =head1 ATTRIBUTES | ||
| 69 | |||
| 70 | |||
| 71 | =head2 AdjustmentType => Str | ||
| 72 | |||
| 73 | Specifies how the scaling adjustment is interpreted (for example, an | ||
| 74 | absolute number or a percentage). The valid values are | ||
| 75 | C<ChangeInCapacity>, C<ExactCapacity>, and C<PercentChangeInCapacity>. | ||
| 76 | |||
| 77 | Required if the policy type is C<StepScaling> or C<SimpleScaling>. For | ||
| 78 | more information, see Scaling adjustment types | ||
| 79 | (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-simple-step.html#as-scaling-adjustment) | ||
| 80 | in the I<Amazon EC2 Auto Scaling User Guide>. | ||
| 81 | |||
| 82 | |||
| 83 | |||
| 84 | =head2 B<REQUIRED> AutoScalingGroupName => Str | ||
| 85 | |||
| 86 | The name of the Auto Scaling group. | ||
| 87 | |||
| 88 | |||
| 89 | |||
| 90 | =head2 Cooldown => Int | ||
| 91 | |||
| 92 | The duration of the policy's cooldown period, in seconds. When a | ||
| 93 | cooldown period is specified here, it overrides the default cooldown | ||
| 94 | period defined for the Auto Scaling group. | ||
| 95 | |||
| 96 | Valid only if the policy type is C<SimpleScaling>. For more | ||
| 97 | information, see Scaling cooldowns for Amazon EC2 Auto Scaling | ||
| 98 | (https://docs.aws.amazon.com/autoscaling/ec2/userguide/Cooldown.html) | ||
| 99 | in the I<Amazon EC2 Auto Scaling User Guide>. | ||
| 100 | |||
| 101 | |||
| 102 | |||
| 103 | =head2 Enabled => Bool | ||
| 104 | |||
| 105 | Indicates whether the scaling policy is enabled or disabled. The | ||
| 106 | default is enabled. For more information, see Disabling a scaling | ||
| 107 | policy for an Auto Scaling group | ||
| 108 | (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-enable-disable-scaling-policy.html) | ||
| 109 | in the I<Amazon EC2 Auto Scaling User Guide>. | ||
| 110 | |||
| 111 | |||
| 112 | |||
| 113 | =head2 EstimatedInstanceWarmup => Int | ||
| 114 | |||
| 115 | The estimated time, in seconds, until a newly launched instance can | ||
| 116 | contribute to the CloudWatch metrics. If not provided, the default is | ||
| 117 | to use the value from the default cooldown period for the Auto Scaling | ||
| 118 | group. | ||
| 119 | |||
| 120 | Valid only if the policy type is C<TargetTrackingScaling> or | ||
| 121 | C<StepScaling>. | ||
| 122 | |||
| 123 | |||
| 124 | |||
| 125 | =head2 MetricAggregationType => Str | ||
| 126 | |||
| 127 | The aggregation type for the CloudWatch metrics. The valid values are | ||
| 128 | C<Minimum>, C<Maximum>, and C<Average>. If the aggregation type is | ||
| 129 | null, the value is treated as C<Average>. | ||
| 130 | |||
| 131 | Valid only if the policy type is C<StepScaling>. | ||
| 132 | |||
| 133 | |||
| 134 | |||
| 135 | =head2 MinAdjustmentMagnitude => Int | ||
| 136 | |||
| 137 | The minimum value to scale by when the adjustment type is | ||
| 138 | C<PercentChangeInCapacity>. For example, suppose that you create a step | ||
| 139 | scaling policy to scale out an Auto Scaling group by 25 percent and you | ||
| 140 | specify a C<MinAdjustmentMagnitude> of 2. If the group has 4 instances | ||
| 141 | and the scaling policy is performed, 25 percent of 4 is 1. However, | ||
| 142 | because you specified a C<MinAdjustmentMagnitude> of 2, Amazon EC2 Auto | ||
| 143 | Scaling scales out the group by 2 instances. | ||
| 144 | |||
| 145 | Valid only if the policy type is C<StepScaling> or C<SimpleScaling>. | ||
| 146 | For more information, see Scaling adjustment types | ||
| 147 | (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-simple-step.html#as-scaling-adjustment) | ||
| 148 | in the I<Amazon EC2 Auto Scaling User Guide>. | ||
| 149 | |||
| 150 | Some Auto Scaling groups use instance weights. In this case, set the | ||
| 151 | C<MinAdjustmentMagnitude> to a value that is at least as large as your | ||
| 152 | largest instance weight. | ||
| 153 | |||
| 154 | |||
| 155 | |||
| 156 | =head2 MinAdjustmentStep => Int | ||
| 157 | |||
| 158 | Available for backward compatibility. Use C<MinAdjustmentMagnitude> | ||
| 159 | instead. | ||
| 160 | |||
| 161 | |||
| 162 | |||
| 163 | =head2 B<REQUIRED> PolicyName => Str | ||
| 164 | |||
| 165 | The name of the policy. | ||
| 166 | |||
| 167 | |||
| 168 | |||
| 169 | =head2 PolicyType => Str | ||
| 170 | |||
| 171 | One of the following policy types: | ||
| 172 | |||
| 173 | =over | ||
| 174 | |||
| 175 | =item * | ||
| 176 | |||
| 177 | C<TargetTrackingScaling> | ||
| 178 | |||
| 179 | =item * | ||
| 180 | |||
| 181 | C<StepScaling> | ||
| 182 | |||
| 183 | =item * | ||
| 184 | |||
| 185 | C<SimpleScaling> (default) | ||
| 186 | |||
| 187 | =item * | ||
| 188 | |||
| 189 | C<PredictiveScaling> | ||
| 190 | |||
| 191 | =back | ||
| 192 | |||
| 193 | |||
| 194 | |||
| 195 | |||
| 196 | =head2 PredictiveScalingConfiguration => L<Paws::AutoScaling::PredictiveScalingConfiguration> | ||
| 197 | |||
| 198 | A predictive scaling policy. Provides support for only predefined | ||
| 199 | metrics. | ||
| 200 | |||
| 201 | Predictive scaling works with CPU utilization, network in/out, and the | ||
| 202 | Application Load Balancer request count. | ||
| 203 | |||
| 204 | For more information, see PredictiveScalingConfiguration | ||
| 205 | (https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_PredictiveScalingConfiguration.html) | ||
| 206 | in the I<Amazon EC2 Auto Scaling API Reference>. | ||
| 207 | |||
| 208 | Required if the policy type is C<PredictiveScaling>. | ||
| 209 | |||
| 210 | |||
| 211 | |||
| 212 | =head2 ScalingAdjustment => Int | ||
| 213 | |||
| 214 | The amount by which to scale, based on the specified adjustment type. A | ||
| 215 | positive value adds to the current capacity while a negative number | ||
| 216 | removes from the current capacity. For exact capacity, you must specify | ||
| 217 | a positive value. | ||
| 218 | |||
| 219 | Required if the policy type is C<SimpleScaling>. (Not used with any | ||
| 220 | other policy type.) | ||
| 221 | |||
| 222 | |||
| 223 | |||
| 224 | =head2 StepAdjustments => ArrayRef[L<Paws::AutoScaling::StepAdjustment>] | ||
| 225 | |||
| 226 | A set of adjustments that enable you to scale based on the size of the | ||
| 227 | alarm breach. | ||
| 228 | |||
| 229 | Required if the policy type is C<StepScaling>. (Not used with any other | ||
| 230 | policy type.) | ||
| 231 | |||
| 232 | |||
| 233 | |||
| 234 | =head2 TargetTrackingConfiguration => L<Paws::AutoScaling::TargetTrackingConfiguration> | ||
| 235 | |||
| 236 | A target tracking scaling policy. Provides support for predefined or | ||
| 237 | customized metrics. | ||
| 238 | |||
| 239 | The following predefined metrics are available: | ||
| 240 | |||
| 241 | =over | ||
| 242 | |||
| 243 | =item * | ||
| 244 | |||
| 245 | C<ASGAverageCPUUtilization> | ||
| 246 | |||
| 247 | =item * | ||
| 248 | |||
| 249 | C<ASGAverageNetworkIn> | ||
| 250 | |||
| 251 | =item * | ||
| 252 | |||
| 253 | C<ASGAverageNetworkOut> | ||
| 254 | |||
| 255 | =item * | ||
| 256 | |||
| 257 | C<ALBRequestCountPerTarget> | ||
| 258 | |||
| 259 | =back | ||
| 260 | |||
| 261 | If you specify C<ALBRequestCountPerTarget> for the metric, you must | ||
| 262 | specify the C<ResourceLabel> parameter with the | ||
| 263 | C<PredefinedMetricSpecification>. | ||
| 264 | |||
| 265 | For more information, see TargetTrackingConfiguration | ||
| 266 | (https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_TargetTrackingConfiguration.html) | ||
| 267 | in the I<Amazon EC2 Auto Scaling API Reference>. | ||
| 268 | |||
| 269 | Required if the policy type is C<TargetTrackingScaling>. | ||
| 270 | |||
| 271 | |||
| 272 | |||
| 273 | |||
| 274 | =head1 SEE ALSO | ||
| 275 | |||
| 276 | This class forms part of L<Paws>, documenting arguments for method PutScalingPolicy in L<Paws::AutoScaling> | ||
| 277 | |||
| 278 | =head1 BUGS and CONTRIBUTIONS | ||
| 279 | |||
| 280 | The source code is located here: L<https://github.com/pplu/aws-sdk-perl> | ||
| 281 | |||
| 282 | Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues> | ||
| 283 | |||
| 284 | =cut | ||
| 285 |