Menu
AWS OpsWorks
API Reference (API Version 2013-02-18)

SetLoadBasedAutoScaling

Specify the load-based auto scaling configuration for a specified layer. For more information, see Managing Load with Time-based and Load-based Instances.

Note

To use load-based auto scaling, you must create a set of load-based auto scaling instances. Load-based auto scaling operates only on the instances from that set, so you must ensure that you have created enough instances to handle the maximum anticipated load.

Required Permissions: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see Managing User Permissions.

Request Syntax

{
   "DownScaling": { 
      "Alarms": [ "string" ],
      "CpuThreshold": number,
      "IgnoreMetricsTime": number,
      "InstanceCount": number,
      "LoadThreshold": number,
      "MemoryThreshold": number,
      "ThresholdsWaitTime": number
   },
   "Enable": boolean,
   "LayerId": "string",
   "UpScaling": { 
      "Alarms": [ "string" ],
      "CpuThreshold": number,
      "IgnoreMetricsTime": number,
      "InstanceCount": number,
      "LoadThreshold": number,
      "MemoryThreshold": number,
      "ThresholdsWaitTime": number
   }
}

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

DownScaling

An AutoScalingThresholds object with the downscaling threshold configuration. If the load falls below these thresholds for a specified amount of time, AWS OpsWorks Stacks stops a specified number of instances.

Type: AutoScalingThresholds object

Required: No

Enable

Enables load-based auto scaling for the layer.

Type: Boolean

Required: No

LayerId

The layer ID.

Type: String

Required: Yes

UpScaling

An AutoScalingThresholds object with the upscaling threshold configuration. If the load exceeds these thresholds for a specified amount of time, AWS OpsWorks Stacks starts a specified number of instances.

Type: AutoScalingThresholds object

Required: No

Response Elements

If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.

Errors

For information about the errors that are common to all actions, see Common Errors.

ResourceNotFoundException

Indicates that a resource was not found.

HTTP Status Code: 400

ValidationException

Indicates that a request was not valid.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: