« blib/lib/Paws/ApplicationAutoScaling/PredefinedMetricSpecification.pm
↑ Summary
blib/lib/Paws/ApplicationAutoScaling/PutScalingPolicyResponse.pm »
| 1 | |||
| 2 | package Paws::ApplicationAutoScaling::PutScalingPolicy; | ||
| 3 | use Moose; | ||
| 4 | has PolicyName => (is => 'ro', isa => 'Str', required => 1); | ||
| 5 | has PolicyType => (is => 'ro', isa => 'Str'); | ||
| 6 | has ResourceId => (is => 'ro', isa => 'Str', required => 1); | ||
| 7 | has ScalableDimension => (is => 'ro', isa => 'Str', required => 1); | ||
| 8 | has ServiceNamespace => (is => 'ro', isa => 'Str', required => 1); | ||
| 9 | has StepScalingPolicyConfiguration => (is => 'ro', isa => 'Paws::ApplicationAutoScaling::StepScalingPolicyConfiguration'); | ||
| 10 | has TargetTrackingScalingPolicyConfiguration => (is => 'ro', isa => 'Paws::ApplicationAutoScaling::TargetTrackingScalingPolicyConfiguration'); | ||
| 11 | |||
| 12 | use MooseX::ClassAttribute; | ||
| 13 | |||
| 14 | class_has _api_call => (isa => 'Str', is => 'ro', default => 'PutScalingPolicy'); | ||
| 15 | class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::ApplicationAutoScaling::PutScalingPolicyResponse'); | ||
| 16 | class_has _result_key => (isa => 'Str', is => 'ro'); | ||
| 17 | 1; | ||
| 18 | |||
| 19 | ### main pod documentation begin ### | ||
| 20 | |||
| 21 | =head1 NAME | ||
| 22 | |||
| 23 | Paws::ApplicationAutoScaling::PutScalingPolicy - Arguments for method PutScalingPolicy on L<Paws::ApplicationAutoScaling> | ||
| 24 | |||
| 25 | =head1 DESCRIPTION | ||
| 26 | |||
| 27 | This class represents the parameters used for calling the method PutScalingPolicy on the | ||
| 28 | L<Application Auto Scaling|Paws::ApplicationAutoScaling> service. Use the attributes of this class | ||
| 29 | as arguments to method PutScalingPolicy. | ||
| 30 | |||
| 31 | You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to PutScalingPolicy. | ||
| 32 | |||
| 33 | =head1 SYNOPSIS | ||
| 34 | |||
| 35 | my $application-autoscaling = Paws->service('ApplicationAutoScaling'); | ||
| 36 | # To apply a scaling policy to an Amazon ECS service | ||
| 37 | # This example applies a scaling policy to an Amazon ECS service called web-app | ||
| 38 | # in the default cluster. The policy increases the desired count of the service | ||
| 39 | # by 200%, with a cool down period of 60 seconds. | ||
| 40 | my $PutScalingPolicyResponse = $application -autoscaling->PutScalingPolicy( | ||
| 41 | 'PolicyName' => 'web-app-cpu-gt-75', | ||
| 42 | 'PolicyType' => 'StepScaling', | ||
| 43 | 'ResourceId' => 'service/default/web-app', | ||
| 44 | 'ScalableDimension' => 'ecs:service:DesiredCount', | ||
| 45 | 'ServiceNamespace' => 'ecs', | ||
| 46 | 'StepScalingPolicyConfiguration' => { | ||
| 47 | 'AdjustmentType' => 'PercentChangeInCapacity', | ||
| 48 | 'Cooldown' => 60, | ||
| 49 | 'StepAdjustments' => [ | ||
| 50 | |||
| 51 | { | ||
| 52 | 'MetricIntervalLowerBound' => 0, | ||
| 53 | 'ScalingAdjustment' => 200 | ||
| 54 | } | ||
| 55 | ] | ||
| 56 | } | ||
| 57 | ); | ||
| 58 | |||
| 59 | # Results: | ||
| 60 | my $PolicyARN = $PutScalingPolicyResponse->PolicyARN; | ||
| 61 | |||
| 62 | # Returns a L<Paws::ApplicationAutoScaling::PutScalingPolicyResponse> object. | ||
| 63 | # To apply a scaling policy to an Amazon EC2 Spot fleet | ||
| 64 | # This example applies a scaling policy to an Amazon EC2 Spot fleet. The policy | ||
| 65 | # increases the target capacity of the spot fleet by 200%, with a cool down | ||
| 66 | # period of 180 seconds.", | ||
| 67 | |||
| 68 | my $PutScalingPolicyResponse = $application -autoscaling->PutScalingPolicy( | ||
| 69 | 'PolicyName' => 'fleet-cpu-gt-75', | ||
| 70 | 'PolicyType' => 'StepScaling', | ||
| 71 | 'ResourceId' => | ||
| 72 | 'spot-fleet-request/sfr-45e69d8a-be48-4539-bbf3-3464e99c50c3', | ||
| 73 | 'ScalableDimension' => 'ec2:spot-fleet-request:TargetCapacity', | ||
| 74 | 'ServiceNamespace' => 'ec2', | ||
| 75 | 'StepScalingPolicyConfiguration' => { | ||
| 76 | 'AdjustmentType' => 'PercentChangeInCapacity', | ||
| 77 | 'Cooldown' => 180, | ||
| 78 | 'StepAdjustments' => [ | ||
| 79 | |||
| 80 | { | ||
| 81 | 'MetricIntervalLowerBound' => 0, | ||
| 82 | 'ScalingAdjustment' => 200 | ||
| 83 | } | ||
| 84 | ] | ||
| 85 | } | ||
| 86 | ); | ||
| 87 | |||
| 88 | # Results: | ||
| 89 | my $PolicyARN = $PutScalingPolicyResponse->PolicyARN; | ||
| 90 | |||
| 91 | # Returns a L<Paws::ApplicationAutoScaling::PutScalingPolicyResponse> object. | ||
| 92 | |||
| 93 | 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. | ||
| 94 | For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling/PutScalingPolicy> | ||
| 95 | |||
| 96 | =head1 ATTRIBUTES | ||
| 97 | |||
| 98 | |||
| 99 | =head2 B<REQUIRED> PolicyName => Str | ||
| 100 | |||
| 101 | The name of the scaling policy. | ||
| 102 | |||
| 103 | |||
| 104 | |||
| 105 | =head2 PolicyType => Str | ||
| 106 | |||
| 107 | The policy type. This parameter is required if you are creating a | ||
| 108 | scaling policy. | ||
| 109 | |||
| 110 | The following policy types are supported: | ||
| 111 | |||
| 112 | C<TargetTrackingScaling>E<mdash>Not supported for Amazon EMR | ||
| 113 | |||
| 114 | C<StepScaling>E<mdash>Not supported for DynamoDB, Amazon Comprehend, | ||
| 115 | Lambda, Amazon Keyspaces (for Apache Cassandra), or Amazon MSK. | ||
| 116 | |||
| 117 | For more information, see Target tracking scaling policies | ||
| 118 | (https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-target-tracking.html) | ||
| 119 | and Step scaling policies | ||
| 120 | (https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-step-scaling-policies.html) | ||
| 121 | in the I<Application Auto Scaling User Guide>. | ||
| 122 | |||
| 123 | Valid values are: C<"StepScaling">, C<"TargetTrackingScaling"> | ||
| 124 | |||
| 125 | =head2 B<REQUIRED> ResourceId => Str | ||
| 126 | |||
| 127 | The identifier of the resource associated with the scaling policy. This | ||
| 128 | string consists of the resource type and unique identifier. | ||
| 129 | |||
| 130 | =over | ||
| 131 | |||
| 132 | =item * | ||
| 133 | |||
| 134 | ECS service - The resource type is C<service> and the unique identifier | ||
| 135 | is the cluster name and service name. Example: | ||
| 136 | C<service/default/sample-webapp>. | ||
| 137 | |||
| 138 | =item * | ||
| 139 | |||
| 140 | Spot Fleet request - The resource type is C<spot-fleet-request> and the | ||
| 141 | unique identifier is the Spot Fleet request ID. Example: | ||
| 142 | C<spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE>. | ||
| 143 | |||
| 144 | =item * | ||
| 145 | |||
| 146 | EMR cluster - The resource type is C<instancegroup> and the unique | ||
| 147 | identifier is the cluster ID and instance group ID. Example: | ||
| 148 | C<instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0>. | ||
| 149 | |||
| 150 | =item * | ||
| 151 | |||
| 152 | AppStream 2.0 fleet - The resource type is C<fleet> and the unique | ||
| 153 | identifier is the fleet name. Example: C<fleet/sample-fleet>. | ||
| 154 | |||
| 155 | =item * | ||
| 156 | |||
| 157 | DynamoDB table - The resource type is C<table> and the unique | ||
| 158 | identifier is the table name. Example: C<table/my-table>. | ||
| 159 | |||
| 160 | =item * | ||
| 161 | |||
| 162 | DynamoDB global secondary index - The resource type is C<index> and the | ||
| 163 | unique identifier is the index name. Example: | ||
| 164 | C<table/my-table/index/my-table-index>. | ||
| 165 | |||
| 166 | =item * | ||
| 167 | |||
| 168 | Aurora DB cluster - The resource type is C<cluster> and the unique | ||
| 169 | identifier is the cluster name. Example: C<cluster:my-db-cluster>. | ||
| 170 | |||
| 171 | =item * | ||
| 172 | |||
| 173 | Amazon SageMaker endpoint variant - The resource type is C<variant> and | ||
| 174 | the unique identifier is the resource ID. Example: | ||
| 175 | C<endpoint/my-end-point/variant/KMeansClustering>. | ||
| 176 | |||
| 177 | =item * | ||
| 178 | |||
| 179 | Custom resources are not supported with a resource type. This parameter | ||
| 180 | must specify the C<OutputValue> from the CloudFormation template stack | ||
| 181 | used to access the resources. The unique identifier is defined by the | ||
| 182 | service provider. More information is available in our GitHub | ||
| 183 | repository (https://github.com/aws/aws-auto-scaling-custom-resource). | ||
| 184 | |||
| 185 | =item * | ||
| 186 | |||
| 187 | Amazon Comprehend document classification endpoint - The resource type | ||
| 188 | and unique identifier are specified using the endpoint ARN. Example: | ||
| 189 | C<arn:aws:comprehend:us-west-2:123456789012:document-classifier-endpoint/EXAMPLE>. | ||
| 190 | |||
| 191 | =item * | ||
| 192 | |||
| 193 | Amazon Comprehend entity recognizer endpoint - The resource type and | ||
| 194 | unique identifier are specified using the endpoint ARN. Example: | ||
| 195 | C<arn:aws:comprehend:us-west-2:123456789012:entity-recognizer-endpoint/EXAMPLE>. | ||
| 196 | |||
| 197 | =item * | ||
| 198 | |||
| 199 | Lambda provisioned concurrency - The resource type is C<function> and | ||
| 200 | the unique identifier is the function name with a function version or | ||
| 201 | alias name suffix that is not C<$LATEST>. Example: | ||
| 202 | C<function:my-function:prod> or C<function:my-function:1>. | ||
| 203 | |||
| 204 | =item * | ||
| 205 | |||
| 206 | Amazon Keyspaces table - The resource type is C<table> and the unique | ||
| 207 | identifier is the table name. Example: | ||
| 208 | C<keyspace/mykeyspace/table/mytable>. | ||
| 209 | |||
| 210 | =item * | ||
| 211 | |||
| 212 | Amazon MSK cluster - The resource type and unique identifier are | ||
| 213 | specified using the cluster ARN. Example: | ||
| 214 | C<arn:aws:kafka:us-east-1:123456789012:cluster/demo-cluster-1/6357e0b2-0e6a-4b86-a0b4-70df934c2e31-5>. | ||
| 215 | |||
| 216 | =back | ||
| 217 | |||
| 218 | |||
| 219 | |||
| 220 | |||
| 221 | =head2 B<REQUIRED> ScalableDimension => Str | ||
| 222 | |||
| 223 | The scalable dimension. This string consists of the service namespace, | ||
| 224 | resource type, and scaling property. | ||
| 225 | |||
| 226 | =over | ||
| 227 | |||
| 228 | =item * | ||
| 229 | |||
| 230 | C<ecs:service:DesiredCount> - The desired task count of an ECS service. | ||
| 231 | |||
| 232 | =item * | ||
| 233 | |||
| 234 | C<ec2:spot-fleet-request:TargetCapacity> - The target capacity of a | ||
| 235 | Spot Fleet request. | ||
| 236 | |||
| 237 | =item * | ||
| 238 | |||
| 239 | C<elasticmapreduce:instancegroup:InstanceCount> - The instance count of | ||
| 240 | an EMR Instance Group. | ||
| 241 | |||
| 242 | =item * | ||
| 243 | |||
| 244 | C<appstream:fleet:DesiredCapacity> - The desired capacity of an | ||
| 245 | AppStream 2.0 fleet. | ||
| 246 | |||
| 247 | =item * | ||
| 248 | |||
| 249 | C<dynamodb:table:ReadCapacityUnits> - The provisioned read capacity for | ||
| 250 | a DynamoDB table. | ||
| 251 | |||
| 252 | =item * | ||
| 253 | |||
| 254 | C<dynamodb:table:WriteCapacityUnits> - The provisioned write capacity | ||
| 255 | for a DynamoDB table. | ||
| 256 | |||
| 257 | =item * | ||
| 258 | |||
| 259 | C<dynamodb:index:ReadCapacityUnits> - The provisioned read capacity for | ||
| 260 | a DynamoDB global secondary index. | ||
| 261 | |||
| 262 | =item * | ||
| 263 | |||
| 264 | C<dynamodb:index:WriteCapacityUnits> - The provisioned write capacity | ||
| 265 | for a DynamoDB global secondary index. | ||
| 266 | |||
| 267 | =item * | ||
| 268 | |||
| 269 | C<rds:cluster:ReadReplicaCount> - The count of Aurora Replicas in an | ||
| 270 | Aurora DB cluster. Available for Aurora MySQL-compatible edition and | ||
| 271 | Aurora PostgreSQL-compatible edition. | ||
| 272 | |||
| 273 | =item * | ||
| 274 | |||
| 275 | C<sagemaker:variant:DesiredInstanceCount> - The number of EC2 instances | ||
| 276 | for an Amazon SageMaker model endpoint variant. | ||
| 277 | |||
| 278 | =item * | ||
| 279 | |||
| 280 | C<custom-resource:ResourceType:Property> - The scalable dimension for a | ||
| 281 | custom resource provided by your own application or service. | ||
| 282 | |||
| 283 | =item * | ||
| 284 | |||
| 285 | C<comprehend:document-classifier-endpoint:DesiredInferenceUnits> - The | ||
| 286 | number of inference units for an Amazon Comprehend document | ||
| 287 | classification endpoint. | ||
| 288 | |||
| 289 | =item * | ||
| 290 | |||
| 291 | C<comprehend:entity-recognizer-endpoint:DesiredInferenceUnits> - The | ||
| 292 | number of inference units for an Amazon Comprehend entity recognizer | ||
| 293 | endpoint. | ||
| 294 | |||
| 295 | =item * | ||
| 296 | |||
| 297 | C<lambda:function:ProvisionedConcurrency> - The provisioned concurrency | ||
| 298 | for a Lambda function. | ||
| 299 | |||
| 300 | =item * | ||
| 301 | |||
| 302 | C<cassandra:table:ReadCapacityUnits> - The provisioned read capacity | ||
| 303 | for an Amazon Keyspaces table. | ||
| 304 | |||
| 305 | =item * | ||
| 306 | |||
| 307 | C<cassandra:table:WriteCapacityUnits> - The provisioned write capacity | ||
| 308 | for an Amazon Keyspaces table. | ||
| 309 | |||
| 310 | =item * | ||
| 311 | |||
| 312 | C<kafka:broker-storage:VolumeSize> - The provisioned volume size (in | ||
| 313 | GiB) for brokers in an Amazon MSK cluster. | ||
| 314 | |||
| 315 | =back | ||
| 316 | |||
| 317 | |||
| 318 | Valid values are: C<"ecs:service:DesiredCount">, C<"ec2:spot-fleet-request:TargetCapacity">, C<"elasticmapreduce:instancegroup:InstanceCount">, C<"appstream:fleet:DesiredCapacity">, C<"dynamodb:table:ReadCapacityUnits">, C<"dynamodb:table:WriteCapacityUnits">, C<"dynamodb:index:ReadCapacityUnits">, C<"dynamodb:index:WriteCapacityUnits">, C<"rds:cluster:ReadReplicaCount">, C<"sagemaker:variant:DesiredInstanceCount">, C<"custom-resource:ResourceType:Property">, C<"comprehend:document-classifier-endpoint:DesiredInferenceUnits">, C<"comprehend:entity-recognizer-endpoint:DesiredInferenceUnits">, C<"lambda:function:ProvisionedConcurrency">, C<"cassandra:table:ReadCapacityUnits">, C<"cassandra:table:WriteCapacityUnits">, C<"kafka:broker-storage:VolumeSize"> | ||
| 319 | |||
| 320 | =head2 B<REQUIRED> ServiceNamespace => Str | ||
| 321 | |||
| 322 | The namespace of the AWS service that provides the resource. For a | ||
| 323 | resource provided by your own application or service, use | ||
| 324 | C<custom-resource> instead. | ||
| 325 | |||
| 326 | Valid values are: C<"ecs">, C<"elasticmapreduce">, C<"ec2">, C<"appstream">, C<"dynamodb">, C<"rds">, C<"sagemaker">, C<"custom-resource">, C<"comprehend">, C<"lambda">, C<"cassandra">, C<"kafka"> | ||
| 327 | |||
| 328 | =head2 StepScalingPolicyConfiguration => L<Paws::ApplicationAutoScaling::StepScalingPolicyConfiguration> | ||
| 329 | |||
| 330 | A step scaling policy. | ||
| 331 | |||
| 332 | This parameter is required if you are creating a policy and the policy | ||
| 333 | type is C<StepScaling>. | ||
| 334 | |||
| 335 | |||
| 336 | |||
| 337 | =head2 TargetTrackingScalingPolicyConfiguration => L<Paws::ApplicationAutoScaling::TargetTrackingScalingPolicyConfiguration> | ||
| 338 | |||
| 339 | A target tracking scaling policy. Includes support for predefined or | ||
| 340 | customized metrics. | ||
| 341 | |||
| 342 | This parameter is required if you are creating a policy and the policy | ||
| 343 | type is C<TargetTrackingScaling>. | ||
| 344 | |||
| 345 | |||
| 346 | |||
| 347 | |||
| 348 | =head1 SEE ALSO | ||
| 349 | |||
| 350 | This class forms part of L<Paws>, documenting arguments for method PutScalingPolicy in L<Paws::ApplicationAutoScaling> | ||
| 351 | |||
| 352 | =head1 BUGS and CONTRIBUTIONS | ||
| 353 | |||
| 354 | The source code is located here: L<https://github.com/pplu/aws-sdk-perl> | ||
| 355 | |||
| 356 | Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues> | ||
| 357 | |||
| 358 | =cut | ||
| 359 |