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

Class: Aws::AutoScalingPlans::Types::ScalingInstruction

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

Overview

Note:

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

{
  service_namespace: "autoscaling", # required, accepts autoscaling, ecs, ec2, rds, dynamodb
  resource_id: "ResourceIdMaxLen1600", # required
  scalable_dimension: "autoscaling:autoScalingGroup:DesiredCapacity", # required, accepts autoscaling:autoScalingGroup:DesiredCapacity, ecs:service:DesiredCount, ec2:spot-fleet-request:TargetCapacity, rds:cluster:ReadReplicaCount, dynamodb:table:ReadCapacityUnits, dynamodb:table:WriteCapacityUnits, dynamodb:index:ReadCapacityUnits, dynamodb:index:WriteCapacityUnits
  min_capacity: 1, # required
  max_capacity: 1, # required
  target_tracking_configurations: [ # required
    {
      predefined_scaling_metric_specification: {
        predefined_scaling_metric_type: "ASGAverageCPUUtilization", # required, accepts ASGAverageCPUUtilization, ASGAverageNetworkIn, ASGAverageNetworkOut, DynamoDBReadCapacityUtilization, DynamoDBWriteCapacityUtilization, ECSServiceAverageCPUUtilization, ECSServiceAverageMemoryUtilization, ALBRequestCountPerTarget, RDSReaderAverageCPUUtilization, RDSReaderAverageDatabaseConnections, EC2SpotFleetRequestAverageCPUUtilization, EC2SpotFleetRequestAverageNetworkIn, EC2SpotFleetRequestAverageNetworkOut
        resource_label: "ResourceLabel",
      },
      customized_scaling_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,
      scale_out_cooldown: 1,
      scale_in_cooldown: 1,
      estimated_instance_warmup: 1,
    },
  ],
}

Specifies the scaling configuration for a scalable resource.

Instance Attribute Summary collapse

Instance Attribute Details

#max_capacityInteger

The maximum value to scale to in response to a scale out event.

Returns:

  • (Integer)


483
484
485
486
487
488
489
490
491
# File 'gems/aws-sdk-autoscalingplans/lib/aws-sdk-autoscalingplans/types.rb', line 483

class ScalingInstruction < Struct.new(
  :service_namespace,
  :resource_id,
  :scalable_dimension,
  :min_capacity,
  :max_capacity,
  :target_tracking_configurations)
  include Aws::Structure
end

#min_capacityInteger

The minimum value to scale to in response to a scale in event.

Returns:

  • (Integer)


483
484
485
486
487
488
489
490
491
# File 'gems/aws-sdk-autoscalingplans/lib/aws-sdk-autoscalingplans/types.rb', line 483

class ScalingInstruction < Struct.new(
  :service_namespace,
  :resource_id,
  :scalable_dimension,
  :min_capacity,
  :max_capacity,
  :target_tracking_configurations)
  include Aws::Structure
end

#resource_idString

The ID of the resource. This string consists of the resource type and unique identifier.

  • Auto Scaling group - The resource type is autoScalingGroup and the unique identifier is the name of the Auto Scaling group. Example: autoScalingGroup/my-asg.

  • ECS service - The resource type is service and the unique identifier is the cluster name and service name. Example: service/default/sample-webapp.

  • Spot fleet request - The resource type is spot-fleet-request and the unique identifier is the Spot fleet request ID. Example: spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE.

  • DynamoDB table - The resource type is table and the unique identifier is the resource ID. Example: table/my-table.

  • DynamoDB global secondary index - The resource type is index and the unique identifier is the resource ID. Example: table/my-table/index/my-table-index.

  • Aurora DB cluster - The resource type is cluster and the unique identifier is the cluster name. Example: cluster:my-db-cluster.

Returns:

  • (String)


483
484
485
486
487
488
489
490
491
# File 'gems/aws-sdk-autoscalingplans/lib/aws-sdk-autoscalingplans/types.rb', line 483

class ScalingInstruction < Struct.new(
  :service_namespace,
  :resource_id,
  :scalable_dimension,
  :min_capacity,
  :max_capacity,
  :target_tracking_configurations)
  include Aws::Structure
end

#scalable_dimensionString

The scalable dimension associated with the resource.

  • autoscaling:autoScalingGroup:DesiredCapacity - The desired capacity of an Auto Scaling group.

  • ecs:service:DesiredCount - The desired task count of an ECS service.

  • ec2:spot-fleet-request:TargetCapacity - The target capacity of a Spot fleet request.

  • dynamodb:table:ReadCapacityUnits - The provisioned read capacity for a DynamoDB table.

  • dynamodb:table:WriteCapacityUnits - The provisioned write capacity for a DynamoDB table.

  • dynamodb:index:ReadCapacityUnits - The provisioned read capacity for a DynamoDB global secondary index.

  • dynamodb:index:WriteCapacityUnits - The provisioned write capacity for a DynamoDB global secondary index.

  • rds:cluster:ReadReplicaCount - The count of Aurora Replicas in an Aurora DB cluster. Available for Aurora MySQL-compatible edition.

Returns:

  • (String)


483
484
485
486
487
488
489
490
491
# File 'gems/aws-sdk-autoscalingplans/lib/aws-sdk-autoscalingplans/types.rb', line 483

class ScalingInstruction < Struct.new(
  :service_namespace,
  :resource_id,
  :scalable_dimension,
  :min_capacity,
  :max_capacity,
  :target_tracking_configurations)
  include Aws::Structure
end

#service_namespaceString

The namespace of the AWS service.

Returns:

  • (String)


483
484
485
486
487
488
489
490
491
# File 'gems/aws-sdk-autoscalingplans/lib/aws-sdk-autoscalingplans/types.rb', line 483

class ScalingInstruction < Struct.new(
  :service_namespace,
  :resource_id,
  :scalable_dimension,
  :min_capacity,
  :max_capacity,
  :target_tracking_configurations)
  include Aws::Structure
end

#target_tracking_configurationsArray<Types::TargetTrackingConfiguration>

The target tracking scaling policies (up to 10).



483
484
485
486
487
488
489
490
491
# File 'gems/aws-sdk-autoscalingplans/lib/aws-sdk-autoscalingplans/types.rb', line 483

class ScalingInstruction < Struct.new(
  :service_namespace,
  :resource_id,
  :scalable_dimension,
  :min_capacity,
  :max_capacity,
  :target_tracking_configurations)
  include Aws::Structure
end