Class: AWS.AutoScaling

Inherits:
AWS.Service show all
Identifier:
autoscaling
API Version:
2011-01-01
Defined in:
(unknown)

Overview

Constructs a service interface object. Each API operation is exposed as a function on service.

Sending a Request Using AutoScaling

var autoscaling = new AWS.AutoScaling();
autoscaling.attachLoadBalancerTargetGroups(params, function (err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Locking the API Version

In order to ensure that the AutoScaling object uses this specific API, you can construct the object by passing the apiVersion option to the constructor:

var autoscaling = new AWS.AutoScaling({apiVersion: '2011-01-01'});

You can also set the API version globally in AWS.config.apiVersions using the autoscaling service identifier:

AWS.config.apiVersions = {
  autoscaling: '2011-01-01',
  // other service API versions
};

var autoscaling = new AWS.AutoScaling();

Version:

  • 2011-01-01

Constructor Summary collapse

Property Summary collapse

Properties inherited from AWS.Service

apiVersions

Method Summary collapse

Methods inherited from AWS.Service

makeRequest, makeUnauthenticatedRequest, waitFor, setupRequestListeners, defineService

Constructor Details

new AWS.AutoScaling(options = {}) ⇒ Object

Constructs a service object. This object has one method for each API operation.

Examples:

Constructing a AutoScaling object

var autoscaling = new AWS.AutoScaling({apiVersion: '2011-01-01'});

Options Hash (options):

  • params (map)

    An optional map of parameters to bind to every request sent by this service object. For more information on bound parameters, see "Working with Services" in the Getting Started Guide.

  • endpoint (String)

    The endpoint URI to send requests to. The default endpoint is built from the configured region. The endpoint should be a string like 'https://{service}.{region}.amazonaws.com'.

  • accessKeyId (String)

    your AWS access key ID.

  • secretAccessKey (String)

    your AWS secret access key.

  • sessionToken (AWS.Credentials)

    the optional AWS session token to sign requests with.

  • credentials (AWS.Credentials)

    the AWS credentials to sign requests with. You can either specify this object, or specify the accessKeyId and secretAccessKey options directly.

  • credentialProvider (AWS.CredentialProviderChain)

    the provider chain used to resolve credentials if no static credentials property is set.

  • region (String)

    the region to send service requests to. See AWS.AutoScaling.region for more information.

  • maxRetries (Integer)

    the maximum amount of retries to attempt with a request. See AWS.AutoScaling.maxRetries for more information.

  • maxRedirects (Integer)

    the maximum amount of redirects to follow with a request. See AWS.AutoScaling.maxRedirects for more information.

  • sslEnabled (Boolean)

    whether to enable SSL for requests.

  • paramValidation (Boolean|map)

    whether input parameters should be validated against the operation description before sending the request. Defaults to true. Pass a map to enable any of the following specific validation features:

    • min [Boolean] — Validates that a value meets the min constraint. This is enabled by default when paramValidation is set to true.
    • max [Boolean] — Validates that a value meets the max constraint.
    • pattern [Boolean] — Validates that a string value matches a regular expression.
    • enum [Boolean] — Validates that a string value matches one of the allowable enum values.
  • computeChecksums (Boolean)

    whether to compute checksums for payload bodies when the service accepts it (currently supported in S3 only)

  • convertResponseTypes (Boolean)

    whether types are converted when parsing response data. Currently only supported for JSON based services. Turning this off may improve performance on large response payloads. Defaults to true.

  • correctClockSkew (Boolean)

    whether to apply a clock skew correction and retry requests that fail because of an skewed client clock. Defaults to false.

  • s3ForcePathStyle (Boolean)

    whether to force path style URLs for S3 objects.

  • s3BucketEndpoint (Boolean)

    whether the provided endpoint addresses an individual bucket (false if it addresses the root API endpoint). Note that setting this configuration option requires an endpoint to be provided explicitly to the service constructor.

  • s3DisableBodySigning (Boolean)

    whether S3 body signing should be disabled when using signature version v4. Body signing can only be disabled when using https. Defaults to true.

  • retryDelayOptions (map)

    A set of options to configure the retry delay on retryable errors. Currently supported options are:

    • base [Integer] — The base number of milliseconds to use in the exponential backoff for operation retries. Defaults to 100 ms for all services except DynamoDB, where it defaults to 50ms.
    • customBackoff [function] — A custom function that accepts a retry count and returns the amount of time to delay in milliseconds. The base option will be ignored if this option is supplied.
  • httpOptions (map)

    A set of options to pass to the low-level HTTP request. Currently supported options are:

    • proxy [String] — the URL to proxy requests through
    • agent [http.Agent, https.Agent] — the Agent object to perform HTTP requests with. Used for connection pooling. Defaults to the global agent (http.globalAgent) for non-SSL connections. Note that for SSL connections, a special Agent object is used in order to enable peer certificate verification. This feature is only available in the Node.js environment.
    • connectTimeout [Integer] — Sets the socket to timeout after failing to establish a connection with the server after connectTimeout milliseconds. This timeout has no effect once a socket connection has been established.
    • timeout [Integer] — Sets the socket to timeout after timeout milliseconds of inactivity on the socket. Defaults to two minutes (120000).
    • xhrAsync [Boolean] — Whether the SDK will send asynchronous HTTP requests. Used in the browser environment only. Set to false to send requests synchronously. Defaults to true (async on).
    • xhrWithCredentials [Boolean] — Sets the "withCredentials" property of an XMLHttpRequest object. Used in the browser environment only. Defaults to false.
  • apiVersion (String, Date)

    a String in YYYY-MM-DD format (or a date) that represents the latest possible API version that can be used in all services (unless overridden by apiVersions). Specify 'latest' to use the latest possible version.

  • apiVersions (map<String, String|Date>)

    a map of service identifiers (the lowercase service class name) with the API version to use when instantiating a service. Specify 'latest' for each individual that can use the latest available version.

  • logger (#write, #log)

    an object that responds to .write() (like a stream) or .log() (like the console object) in order to log information about requests

  • systemClockOffset (Number)

    an offset value in milliseconds to apply to all signing times. Use this to compensate for clock skew when your system may be out of sync with the service time. Note that this configuration option can only be applied to the global AWS.config object and cannot be overridden in service-specific configuration. Defaults to 0 milliseconds.

  • signatureVersion (String)

    the signature version to sign requests with (overriding the API configuration). Possible values are: 'v2', 'v3', 'v4'.

  • signatureCache (Boolean)

    whether the signature to sign requests with (overriding the API configuration) is cached. Only applies to the signature version 'v4'. Defaults to true.

  • dynamoDbCrc32 (Boolean)

    whether to validate the CRC32 checksum of HTTP response bodies returned by DynamoDB. Default: true.

Property Details

endpointAWS.Endpoint (readwrite)

Returns an Endpoint object representing the endpoint URL for service requests.

Returns:

  • (AWS.Endpoint)

    an Endpoint object representing the endpoint URL for service requests.

Method Details

attachInstances(params = {}, callback) ⇒ AWS.Request

Attaches one or more EC2 instances to the specified Auto Scaling group.

When you attach instances, Auto Scaling increases the desired capacity of the group by the number of instances being attached. If the number of instances being attached plus the desired capacity of the group exceeds the maximum size of the group, the operation fails.

If there is a Classic Load Balancer attached to your Auto Scaling group, the instances are also registered with the load balancer. If there are target groups attached to your Auto Scaling group, the instances are also registered with the target groups.

For more information, see Attach EC2 Instances to Your Auto Scaling Group in the Auto Scaling User Guide.

Service Reference:

Examples:

To attach an instance to an Auto Scaling group


/* This example attaches the specified instance to the specified Auto Scaling group. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group", 
  InstanceIds: [
     "i-93633f9b"
  ]
 };
 autoscaling.attachInstances(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the attachInstances operation

var params = {
  AutoScalingGroupName: 'STRING_VALUE', /* required */
  InstanceIds: [
    'STRING_VALUE',
    /* more items */
  ]
};
autoscaling.attachInstances(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • InstanceIds — (Array<String>)

      One or more instance IDs.

    • AutoScalingGroupName — (String)

      The name of the group.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

attachLoadBalancers(params = {}, callback) ⇒ AWS.Request

Attaches one or more Classic Load Balancers to the specified Auto Scaling group.

To attach an Application Load Balancer instead, see AttachLoadBalancerTargetGroups.

To describe the load balancers for an Auto Scaling group, use DescribeLoadBalancers. To detach the load balancer from the Auto Scaling group, use DetachLoadBalancers.

For more information, see Attach a Load Balancer to Your Auto Scaling Group in the Auto Scaling User Guide.

Service Reference:

Examples:

To attach a load balancer to an Auto Scaling group


/* This example attaches the specified load balancer to the specified Auto Scaling group. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group", 
  LoadBalancerNames: [
     "my-load-balancer"
  ]
 };
 autoscaling.attachLoadBalancers(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
   }
   */
 });

Calling the attachLoadBalancers operation

var params = {
  AutoScalingGroupName: 'STRING_VALUE', /* required */
  LoadBalancerNames: [ /* required */
    'STRING_VALUE',
    /* more items */
  ]
};
autoscaling.attachLoadBalancers(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AutoScalingGroupName — (String)

      The name of the group.

    • LoadBalancerNames — (Array<String>)

      One or more load balancer names.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

attachLoadBalancerTargetGroups(params = {}, callback) ⇒ AWS.Request

Attaches one or more target groups to the specified Auto Scaling group.

To describe the target groups for an Auto Scaling group, use DescribeLoadBalancerTargetGroups. To detach the target group from the Auto Scaling group, use DetachLoadBalancerTargetGroups.

For more information, see Attach a Load Balancer to Your Auto Scaling Group in the Auto Scaling User Guide.

Service Reference:

Examples:

To attach a target group to an Auto Scaling group


/* This example attaches the specified target group to the specified Auto Scaling group. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group", 
  TargetGroupARNs: [
     "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067"
  ]
 };
 autoscaling.attachLoadBalancerTargetGroups(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
   }
   */
 });

Calling the attachLoadBalancerTargetGroups operation

var params = {
  AutoScalingGroupName: 'STRING_VALUE', /* required */
  TargetGroupARNs: [ /* required */
    'STRING_VALUE',
    /* more items */
  ]
};
autoscaling.attachLoadBalancerTargetGroups(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AutoScalingGroupName — (String)

      The name of the Auto Scaling group.

    • TargetGroupARNs — (Array<String>)

      The Amazon Resource Names (ARN) of the target groups.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

completeLifecycleAction(params = {}, callback) ⇒ AWS.Request

Completes the lifecycle action for the specified token or instance with the specified result.

This step is a part of the procedure for adding a lifecycle hook to an Auto Scaling group:

  1. (Optional) Create a Lambda function and a rule that allows CloudWatch Events to invoke your Lambda function when Auto Scaling launches or terminates instances.

  2. (Optional) Create a notification target and an IAM role. The target can be either an Amazon SQS queue or an Amazon SNS topic. The role allows Auto Scaling to publish lifecycle notifications to the target.

  3. Create the lifecycle hook. Specify whether the hook is used when the instances launch or terminate.

  4. If you need more time, record the lifecycle action heartbeat to keep the instance in a pending state.

  5. If you finish before the timeout period ends, complete the lifecycle action.

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

Service Reference:

Examples:

To complete the lifecycle action


/* This example notifies Auto Scaling that the specified lifecycle action is complete so that it can finish launching or terminating the instance. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group", 
  LifecycleActionResult: "CONTINUE", 
  LifecycleActionToken: "bcd2f1b8-9a78-44d3-8a7a-4dd07d7cf635", 
  LifecycleHookName: "my-lifecycle-hook"
 };
 autoscaling.completeLifecycleAction(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
   }
   */
 });

Calling the completeLifecycleAction operation

var params = {
  AutoScalingGroupName: 'STRING_VALUE', /* required */
  LifecycleActionResult: 'STRING_VALUE', /* required */
  LifecycleHookName: 'STRING_VALUE', /* required */
  InstanceId: 'STRING_VALUE',
  LifecycleActionToken: 'STRING_VALUE'
};
autoscaling.completeLifecycleAction(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • LifecycleHookName — (String)

      The name of the lifecycle hook.

    • AutoScalingGroupName — (String)

      The name of the group for the lifecycle hook.

    • LifecycleActionToken — (String)

      A universally unique identifier (UUID) that identifies a specific lifecycle action associated with an instance. Auto Scaling sends this token to the notification target you specified when you created the lifecycle hook.

    • LifecycleActionResult — (String)

      The action for the group to take. This parameter can be either CONTINUE or ABANDON.

    • InstanceId — (String)

      The ID of the instance.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createAutoScalingGroup(params = {}, callback) ⇒ AWS.Request

Creates an Auto Scaling group with the specified name and attributes.

If you exceed your maximum limit of Auto Scaling groups, which by default is 20 per region, the call fails. For information about viewing and updating this limit, see DescribeAccountLimits.

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

Service Reference:

Examples:

To create an Auto Scaling group


/* This example creates an Auto Scaling group. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group", 
  LaunchConfigurationName: "my-launch-config", 
  MaxSize: 3, 
  MinSize: 1, 
  VPCZoneIdentifier: "subnet-4176792c"
 };
 autoscaling.createAutoScalingGroup(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

To create an Auto Scaling group with an attached load balancer


/* This example creates an Auto Scaling group and attaches the specified Classic Load Balancer. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group", 
  AvailabilityZones: [
     "us-west-2c"
  ], 
  HealthCheckGracePeriod: 120, 
  HealthCheckType: "ELB", 
  LaunchConfigurationName: "my-launch-config", 
  LoadBalancerNames: [
     "my-load-balancer"
  ], 
  MaxSize: 3, 
  MinSize: 1
 };
 autoscaling.createAutoScalingGroup(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

To create an Auto Scaling group with an attached target group


/* This example creates an Auto Scaling group and attaches the specified target group. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group", 
  HealthCheckGracePeriod: 120, 
  HealthCheckType: "ELB", 
  LaunchConfigurationName: "my-launch-config", 
  MaxSize: 3, 
  MinSize: 1, 
  TargetGroupARNs: [
     "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067"
  ], 
  VPCZoneIdentifier: "subnet-4176792c, subnet-65ea5f08"
 };
 autoscaling.createAutoScalingGroup(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the createAutoScalingGroup operation

var params = {
  AutoScalingGroupName: 'STRING_VALUE', /* required */
  MaxSize: 0, /* required */
  MinSize: 0, /* required */
  AvailabilityZones: [
    'STRING_VALUE',
    /* more items */
  ],
  DefaultCooldown: 0,
  DesiredCapacity: 0,
  HealthCheckGracePeriod: 0,
  HealthCheckType: 'STRING_VALUE',
  InstanceId: 'STRING_VALUE',
  LaunchConfigurationName: 'STRING_VALUE',
  LifecycleHookSpecificationList: [
    {
      LifecycleHookName: 'STRING_VALUE', /* required */
      DefaultResult: 'STRING_VALUE',
      HeartbeatTimeout: 0,
      LifecycleTransition: 'STRING_VALUE',
      NotificationMetadata: 'STRING_VALUE',
      NotificationTargetARN: 'STRING_VALUE',
      RoleARN: 'STRING_VALUE'
    },
    /* more items */
  ],
  LoadBalancerNames: [
    'STRING_VALUE',
    /* more items */
  ],
  NewInstancesProtectedFromScaleIn: true || false,
  PlacementGroup: 'STRING_VALUE',
  Tags: [
    {
      Key: 'STRING_VALUE', /* required */
      PropagateAtLaunch: true || false,
      ResourceId: 'STRING_VALUE',
      ResourceType: 'STRING_VALUE',
      Value: 'STRING_VALUE'
    },
    /* more items */
  ],
  TargetGroupARNs: [
    'STRING_VALUE',
    /* more items */
  ],
  TerminationPolicies: [
    'STRING_VALUE',
    /* more items */
  ],
  VPCZoneIdentifier: 'STRING_VALUE'
};
autoscaling.createAutoScalingGroup(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AutoScalingGroupName — (String)

      The name of the group. This name must be unique within the scope of your AWS account.

    • LaunchConfigurationName — (String)

      The name of the launch configuration. Alternatively, specify an EC2 instance instead of a launch configuration.

    • InstanceId — (String)

      The ID of the instance used to create a launch configuration for the group. Alternatively, specify a launch configuration instead of an EC2 instance.

      When you specify an ID of an instance, Auto Scaling creates a new launch configuration and associates it with the group. This launch configuration derives its attributes from the specified instance, with the exception of the block device mapping.

      For more information, see Create an Auto Scaling Group Using an EC2 Instance in the Auto Scaling User Guide.

    • MinSize — (Integer)

      The minimum size of the group.

    • MaxSize — (Integer)

      The maximum size of the group.

    • DesiredCapacity — (Integer)

      The number of EC2 instances that should be running in the group. This number must be greater than or equal to the minimum size of the group and less than or equal to the maximum size of the group. If you do not specify a desired capacity, the default is the minimum size of the group.

    • DefaultCooldown — (Integer)

      The amount of time, in seconds, after a scaling activity completes before another scaling activity can start. The default is 300.

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

    • AvailabilityZones — (Array<String>)

      One or more Availability Zones for the group. This parameter is optional if you specify one or more subnets.

    • LoadBalancerNames — (Array<String>)

      One or more Classic Load Balancers. To specify an Application Load Balancer, use TargetGroupARNs instead.

      For more information, see Using a Load Balancer With an Auto Scaling Group in the Auto Scaling User Guide.

    • TargetGroupARNs — (Array<String>)

      The Amazon Resource Names (ARN) of the target groups.

    • HealthCheckType — (String)

      The service to use for the health checks. The valid values are EC2 and ELB.

      By default, health checks use Amazon EC2 instance status checks to determine the health of an instance. For more information, see Health Checks in the Auto Scaling User Guide.

    • HealthCheckGracePeriod — (Integer)

      The amount of time, in seconds, that Auto Scaling waits before checking the health status of an EC2 instance that has come into service. During this time, any health check failures for the instance are ignored. The default is 0.

      This parameter is required if you are adding an ELB health check.

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

    • PlacementGroup — (String)

      The name of the placement group into which you'll launch your instances, if any. For more information, see Placement Groups in the Amazon Elastic Compute Cloud User Guide.

    • VPCZoneIdentifier — (String)

      A comma-separated list of subnet identifiers for your virtual private cloud (VPC).

      If you specify subnets and Availability Zones with this call, ensure that the subnets' Availability Zones match the Availability Zones specified.

      For more information, see Launching Auto Scaling Instances in a VPC in the Auto Scaling User Guide.

    • TerminationPolicies — (Array<String>)

      One or more termination policies used to select the instance to terminate. These policies are executed in the order that they are listed.

      For more information, see Controlling Which Instances Auto Scaling Terminates During Scale In in the Auto Scaling User Guide.

    • NewInstancesProtectedFromScaleIn — (Boolean)

      Indicates whether newly launched instances are protected from termination by Auto Scaling when scaling in.

    • LifecycleHookSpecificationList — (Array<map>)

      One or more lifecycle hooks.

      • LifecycleHookNamerequired — (String)

        The name of the lifecycle hook.

      • LifecycleTransition — (String)

        The state of the EC2 instance to which you want to attach the lifecycle hook. For a list of lifecycle hook types, see DescribeLifecycleHookTypes.

      • NotificationMetadata — (String)

        Additional information that you want to include any time Auto Scaling sends a message to the notification target.

      • HeartbeatTimeout — (Integer)

        The maximum time, in seconds, that can elapse before the lifecycle hook times out. If the lifecycle hook times out, Auto Scaling performs the default action. You can prevent the lifecycle hook from timing out by calling RecordLifecycleActionHeartbeat.

      • DefaultResult — (String)

        Defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses or if an unexpected failure occurs. The valid values are CONTINUE and ABANDON. The default value is CONTINUE.

      • NotificationTargetARN — (String)

        The ARN of the target that Auto Scaling sends notifications to when an instance is in the transition state for the lifecycle hook. The notification target can be either an SQS queue or an SNS topic.

      • RoleARN — (String)

        The ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target.

    • Tags — (Array<map>)

      One or more tags.

      For more information, see Tagging Auto Scaling Groups and Instances in the Auto Scaling User Guide.

      • ResourceId — (String)

        The name of the group.

      • ResourceType — (String)

        The type of resource. The only supported value is auto-scaling-group.

      • Keyrequired — (String)

        The tag key.

      • Value — (String)

        The tag value.

      • PropagateAtLaunch — (Boolean)

        Determines whether the tag is added to new instances as they are launched in the group.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createLaunchConfiguration(params = {}, callback) ⇒ AWS.Request

Creates a launch configuration.

If you exceed your maximum limit of launch configurations, which by default is 100 per region, the call fails. For information about viewing and updating this limit, see DescribeAccountLimits.

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

Service Reference:

Examples:

To create a launch configuration


/* This example creates a launch configuration. */

 var params = {
  IamInstanceProfile: "my-iam-role", 
  ImageId: "ami-12345678", 
  InstanceType: "m3.medium", 
  LaunchConfigurationName: "my-launch-config", 
  SecurityGroups: [
     "sg-eb2af88e"
  ]
 };
 autoscaling.createLaunchConfiguration(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the createLaunchConfiguration operation

var params = {
  LaunchConfigurationName: 'STRING_VALUE', /* required */
  AssociatePublicIpAddress: true || false,
  BlockDeviceMappings: [
    {
      DeviceName: 'STRING_VALUE', /* required */
      Ebs: {
        DeleteOnTermination: true || false,
        Encrypted: true || false,
        Iops: 0,
        SnapshotId: 'STRING_VALUE',
        VolumeSize: 0,
        VolumeType: 'STRING_VALUE'
      },
      NoDevice: true || false,
      VirtualName: 'STRING_VALUE'
    },
    /* more items */
  ],
  ClassicLinkVPCId: 'STRING_VALUE',
  ClassicLinkVPCSecurityGroups: [
    'STRING_VALUE',
    /* more items */
  ],
  EbsOptimized: true || false,
  IamInstanceProfile: 'STRING_VALUE',
  ImageId: 'STRING_VALUE',
  InstanceId: 'STRING_VALUE',
  InstanceMonitoring: {
    Enabled: true || false
  },
  InstanceType: 'STRING_VALUE',
  KernelId: 'STRING_VALUE',
  KeyName: 'STRING_VALUE',
  PlacementTenancy: 'STRING_VALUE',
  RamdiskId: 'STRING_VALUE',
  SecurityGroups: [
    'STRING_VALUE',
    /* more items */
  ],
  SpotPrice: 'STRING_VALUE',
  UserData: 'STRING_VALUE'
};
autoscaling.createLaunchConfiguration(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • LaunchConfigurationName — (String)

      The name of the launch configuration. This name must be unique within the scope of your AWS account.

    • ImageId — (String)

      The ID of the Amazon Machine Image (AMI) to use to launch your EC2 instances.

      If you do not specify InstanceId, you must specify ImageId.

      For more information, see Finding an AMI in the Amazon Elastic Compute Cloud User Guide.

    • KeyName — (String)

      The name of the key pair. For more information, see Amazon EC2 Key Pairs in the Amazon Elastic Compute Cloud User Guide.

    • SecurityGroups — (Array<String>)

      One or more security groups with which to associate the instances.

      If your instances are launched in EC2-Classic, you can either specify security group names or the security group IDs. For more information about security groups for EC2-Classic, see Amazon EC2 Security Groups in the Amazon Elastic Compute Cloud User Guide.

      If your instances are launched into a VPC, specify security group IDs. For more information, see Security Groups for Your VPC in the Amazon Virtual Private Cloud User Guide.

    • ClassicLinkVPCId — (String)

      The ID of a ClassicLink-enabled VPC to link your EC2-Classic instances to. This parameter is supported only if you are launching EC2-Classic instances. For more information, see ClassicLink in the Amazon Elastic Compute Cloud User Guide.

    • ClassicLinkVPCSecurityGroups — (Array<String>)

      The IDs of one or more security groups for the specified ClassicLink-enabled VPC. This parameter is required if you specify a ClassicLink-enabled VPC, and is not supported otherwise. For more information, see ClassicLink in the Amazon Elastic Compute Cloud User Guide.

    • UserData — (String)

      The user data to make available to the launched EC2 instances. For more information, see Instance Metadata and User Data in the Amazon Elastic Compute Cloud User Guide.

    • InstanceId — (String)

      The ID of the instance to use to create the launch configuration. The new launch configuration derives attributes from the instance, with the exception of the block device mapping.

      If you do not specify InstanceId, you must specify both ImageId and InstanceType.

      To create a launch configuration with a block device mapping or override any other instance attributes, specify them as part of the same request.

      For more information, see Create a Launch Configuration Using an EC2 Instance in the Auto Scaling User Guide.

    • InstanceType — (String)

      The instance type of the EC2 instance.

      If you do not specify InstanceId, you must specify InstanceType.

      For information about available instance types, see Available Instance Types in the Amazon Elastic Compute Cloud User Guide.

    • KernelId — (String)

      The ID of the kernel associated with the AMI.

    • RamdiskId — (String)

      The ID of the RAM disk associated with the AMI.

    • BlockDeviceMappings — (Array<map>)

      One or more mappings that specify how block devices are exposed to the instance. For more information, see Block Device Mapping in the Amazon Elastic Compute Cloud User Guide.

      • VirtualName — (String)

        The name of the virtual device (for example, ephemeral0).

      • DeviceNamerequired — (String)

        The device name exposed to the EC2 instance (for example, /dev/sdh or xvdh).

      • Ebs — (map)

        The information about the Amazon EBS volume.

        • SnapshotId — (String)

          The ID of the snapshot.

        • VolumeSize — (Integer)

          The volume size, in GiB. For standard volumes, specify a value from 1 to 1,024. For io1 volumes, specify a value from 4 to 16,384. For gp2 volumes, specify a value from 1 to 16,384. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.

          Default: If you create a volume from a snapshot and you don't specify a volume size, the default is the snapshot size.

        • VolumeType — (String)

          The volume type. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide.

          Valid values: standard | io1 | gp2

          Default: standard

        • DeleteOnTermination — (Boolean)

          Indicates whether the volume is deleted on instance termination.

          Default: true

        • Iops — (Integer)

          The number of I/O operations per second (IOPS) to provision for the volume.

          Constraint: Required when the volume type is io1.

        • Encrypted — (Boolean)

          Indicates whether the volume should be encrypted. Encrypted EBS volumes must be attached to instances that support Amazon EBS encryption. Volumes that are created from encrypted snapshots are automatically encrypted. There is no way to create an encrypted volume from an unencrypted snapshot or an unencrypted volume from an encrypted snapshot. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide.

      • NoDevice — (Boolean)

        Suppresses a device mapping.

        If this parameter is true for the root device, the instance might fail the EC2 health check. Auto Scaling launches a replacement instance if the instance fails the health check.

    • InstanceMonitoring — (map)

      Enables detailed monitoring (true) or basic monitoring (false) for the Auto Scaling instances. The default is true.

      • Enabled — (Boolean)

        If true, detailed monitoring is enabled. Otherwise, basic monitoring is enabled.

    • SpotPrice — (String)

      The maximum hourly price to be paid for any Spot Instance launched to fulfill the request. Spot Instances are launched when the price you specify exceeds the current Spot market price. For more information, see Launching Spot Instances in Your Auto Scaling Group in the Auto Scaling User Guide.

    • IamInstanceProfile — (String)

      The name or the Amazon Resource Name (ARN) of the instance profile associated with the IAM role for the instance.

      EC2 instances launched with an IAM role will automatically have AWS security credentials available. You can use IAM roles with Auto Scaling to automatically enable applications running on your EC2 instances to securely access other AWS resources. For more information, see Launch Auto Scaling Instances with an IAM Role in the Auto Scaling User Guide.

    • EbsOptimized — (Boolean)

      Indicates whether the instance is optimized for Amazon EBS I/O. By default, the instance is not optimized for EBS I/O. The optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization is not available with all instance types. Additional usage charges apply. For more information, see Amazon EBS-Optimized Instances in the Amazon Elastic Compute Cloud User Guide.

    • AssociatePublicIpAddress — (Boolean)

      Used for groups that launch instances into a virtual private cloud (VPC). Specifies whether to assign a public IP address to each instance. For more information, see Launching Auto Scaling Instances in a VPC in the Auto Scaling User Guide.

      If you specify this parameter, be sure to specify at least one subnet when you create your group.

      Default: If the instance is launched into a default subnet, the default is true. If the instance is launched into a nondefault subnet, the default is false. For more information, see Supported Platforms in the Amazon Elastic Compute Cloud User Guide.

    • PlacementTenancy — (String)

      The tenancy of the instance. An instance with a tenancy of dedicated runs on single-tenant hardware and can only be launched into a VPC.

      You must set the value of this parameter to dedicated if want to launch Dedicated Instances into a shared tenancy VPC (VPC with instance placement tenancy attribute set to default).

      If you specify this parameter, be sure to specify at least one subnet when you create your group.

      For more information, see Launching Auto Scaling Instances in a VPC in the Auto Scaling User Guide.

      Valid values: default | dedicated

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createOrUpdateTags(params = {}, callback) ⇒ AWS.Request

Creates or updates tags for the specified Auto Scaling group.

When you specify a tag with a key that already exists, the operation overwrites the previous tag definition, and you do not get an error message.

For more information, see Tagging Auto Scaling Groups and Instances in the Auto Scaling User Guide.

Service Reference:

Examples:

To create or update tags for an Auto Scaling group


/* This example adds two tags to the specified Auto Scaling group. */

 var params = {
  Tags: [
     {
    Key: "Role", 
    PropagateAtLaunch: true, 
    ResourceId: "my-auto-scaling-group", 
    ResourceType: "auto-scaling-group", 
    Value: "WebServer"
   }, 
     {
    Key: "Dept", 
    PropagateAtLaunch: true, 
    ResourceId: "my-auto-scaling-group", 
    ResourceType: "auto-scaling-group", 
    Value: "Research"
   }
  ]
 };
 autoscaling.createOrUpdateTags(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the createOrUpdateTags operation

var params = {
  Tags: [ /* required */
    {
      Key: 'STRING_VALUE', /* required */
      PropagateAtLaunch: true || false,
      ResourceId: 'STRING_VALUE',
      ResourceType: 'STRING_VALUE',
      Value: 'STRING_VALUE'
    },
    /* more items */
  ]
};
autoscaling.createOrUpdateTags(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Tags — (Array<map>)

      One or more tags.

      • ResourceId — (String)

        The name of the group.

      • ResourceType — (String)

        The type of resource. The only supported value is auto-scaling-group.

      • Keyrequired — (String)

        The tag key.

      • Value — (String)

        The tag value.

      • PropagateAtLaunch — (Boolean)

        Determines whether the tag is added to new instances as they are launched in the group.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteAutoScalingGroup(params = {}, callback) ⇒ AWS.Request

Deletes the specified Auto Scaling group.

If the group has instances or scaling activities in progress, you must specify the option to force the deletion in order for it to succeed.

If the group has policies, deleting the group deletes the policies, the underlying alarm actions, and any alarm that no longer has an associated action.

To remove instances from the Auto Scaling group before deleting it, call DetachInstances with the list of instances and the option to decrement the desired capacity so that Auto Scaling does not launch replacement instances.

To terminate all instances before deleting the Auto Scaling group, call UpdateAutoScalingGroup and set the minimum size and desired capacity of the Auto Scaling group to zero.

Service Reference:

Examples:

To delete an Auto Scaling group


/* This example deletes the specified Auto Scaling group. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group"
 };
 autoscaling.deleteAutoScalingGroup(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

To delete an Auto Scaling group and all its instances


/* This example deletes the specified Auto Scaling group and all its instances. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group", 
  ForceDelete: true
 };
 autoscaling.deleteAutoScalingGroup(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the deleteAutoScalingGroup operation

var params = {
  AutoScalingGroupName: 'STRING_VALUE', /* required */
  ForceDelete: true || false
};
autoscaling.deleteAutoScalingGroup(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AutoScalingGroupName — (String)

      The name of the group to delete.

    • ForceDelete — (Boolean)

      Specifies that the group will be deleted along with all instances associated with the group, without waiting for all instances to be terminated. This parameter also deletes any lifecycle actions associated with the group.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteLaunchConfiguration(params = {}, callback) ⇒ AWS.Request

Deletes the specified launch configuration.

The launch configuration must not be attached to an Auto Scaling group. When this call completes, the launch configuration is no longer available for use.

Service Reference:

Examples:

To delete a launch configuration


/* This example deletes the specified launch configuration. */

 var params = {
  LaunchConfigurationName: "my-launch-config"
 };
 autoscaling.deleteLaunchConfiguration(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the deleteLaunchConfiguration operation

var params = {
  LaunchConfigurationName: 'STRING_VALUE' /* required */
};
autoscaling.deleteLaunchConfiguration(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • LaunchConfigurationName — (String)

      The name of the launch configuration.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteLifecycleHook(params = {}, callback) ⇒ AWS.Request

Deletes the specified lifecycle hook.

If there are any outstanding lifecycle actions, they are completed first (ABANDON for launching instances, CONTINUE for terminating instances).

Service Reference:

Examples:

To delete a lifecycle hook


/* This example deletes the specified lifecycle hook. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group", 
  LifecycleHookName: "my-lifecycle-hook"
 };
 autoscaling.deleteLifecycleHook(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
   }
   */
 });

Calling the deleteLifecycleHook operation

var params = {
  AutoScalingGroupName: 'STRING_VALUE', /* required */
  LifecycleHookName: 'STRING_VALUE' /* required */
};
autoscaling.deleteLifecycleHook(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • LifecycleHookName — (String)

      The name of the lifecycle hook.

    • AutoScalingGroupName — (String)

      The name of the Auto Scaling group for the lifecycle hook.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteNotificationConfiguration(params = {}, callback) ⇒ AWS.Request

Deletes the specified notification.

Service Reference:

Examples:

To delete an Auto Scaling notification


/* This example deletes the specified notification from the specified Auto Scaling group. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group", 
  TopicARN: "arn:aws:sns:us-west-2:123456789012:my-sns-topic"
 };
 autoscaling.deleteNotificationConfiguration(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the deleteNotificationConfiguration operation

var params = {
  AutoScalingGroupName: 'STRING_VALUE', /* required */
  TopicARN: 'STRING_VALUE' /* required */
};
autoscaling.deleteNotificationConfiguration(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AutoScalingGroupName — (String)

      The name of the Auto Scaling group.

    • TopicARN — (String)

      The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) topic.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deletePolicy(params = {}, callback) ⇒ AWS.Request

Deletes the specified Auto Scaling policy.

Deleting a policy deletes the underlying alarm action, but does not delete the alarm, even if it no longer has an associated action.

Service Reference:

Examples:

To delete an Auto Scaling policy


/* This example deletes the specified Auto Scaling policy. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group", 
  PolicyName: "ScaleIn"
 };
 autoscaling.deletePolicy(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the deletePolicy operation

var params = {
  PolicyName: 'STRING_VALUE', /* required */
  AutoScalingGroupName: 'STRING_VALUE'
};
autoscaling.deletePolicy(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AutoScalingGroupName — (String)

      The name of the Auto Scaling group.

    • PolicyName — (String)

      The name or Amazon Resource Name (ARN) of the policy.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteScheduledAction(params = {}, callback) ⇒ AWS.Request

Deletes the specified scheduled action.

Service Reference:

Examples:

To delete a scheduled action from an Auto Scaling group


/* This example deletes the specified scheduled action from the specified Auto Scaling group. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group", 
  ScheduledActionName: "my-scheduled-action"
 };
 autoscaling.deleteScheduledAction(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the deleteScheduledAction operation

var params = {
  AutoScalingGroupName: 'STRING_VALUE', /* required */
  ScheduledActionName: 'STRING_VALUE' /* required */
};
autoscaling.deleteScheduledAction(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AutoScalingGroupName — (String)

      The name of the Auto Scaling group.

    • ScheduledActionName — (String)

      The name of the action to delete.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteTags(params = {}, callback) ⇒ AWS.Request

Deletes the specified tags.

Service Reference:

Examples:

To delete a tag from an Auto Scaling group


/* This example deletes the specified tag from the specified Auto Scaling group. */

 var params = {
  Tags: [
     {
    Key: "Dept", 
    ResourceId: "my-auto-scaling-group", 
    ResourceType: "auto-scaling-group", 
    Value: "Research"
   }
  ]
 };
 autoscaling.deleteTags(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the deleteTags operation

var params = {
  Tags: [ /* required */
    {
      Key: 'STRING_VALUE', /* required */
      PropagateAtLaunch: true || false,
      ResourceId: 'STRING_VALUE',
      ResourceType: 'STRING_VALUE',
      Value: 'STRING_VALUE'
    },
    /* more items */
  ]
};
autoscaling.deleteTags(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Tags — (Array<map>)

      One or more tags.

      • ResourceId — (String)

        The name of the group.

      • ResourceType — (String)

        The type of resource. The only supported value is auto-scaling-group.

      • Keyrequired — (String)

        The tag key.

      • Value — (String)

        The tag value.

      • PropagateAtLaunch — (Boolean)

        Determines whether the tag is added to new instances as they are launched in the group.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeAccountLimits(params = {}, callback) ⇒ AWS.Request

Describes the current Auto Scaling resource limits for your AWS account.

For information about requesting an increase in these limits, see AWS Service Limits in the Amazon Web Services General Reference.

Service Reference:

Examples:

To describe your Auto Scaling account limits


/* This example describes the Auto Scaling limits for your AWS account. */

 var params = {};
 autoscaling.describeAccountLimits(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    MaxNumberOfAutoScalingGroups: 20, 
    MaxNumberOfLaunchConfigurations: 100, 
    NumberOfAutoScalingGroups: 3, 
    NumberOfLaunchConfigurations: 5
   }
   */
 });

Calling the describeAccountLimits operation

autoscaling.describeAccountLimits(function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • MaxNumberOfAutoScalingGroups — (Integer)

        The maximum number of groups allowed for your AWS account. The default limit is 20 per region.

      • MaxNumberOfLaunchConfigurations — (Integer)

        The maximum number of launch configurations allowed for your AWS account. The default limit is 100 per region.

      • NumberOfAutoScalingGroups — (Integer)

        The current number of groups for your AWS account.

      • NumberOfLaunchConfigurations — (Integer)

        The current number of launch configurations for your AWS account.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeAdjustmentTypes(params = {}, callback) ⇒ AWS.Request

Describes the policy adjustment types for use with PutScalingPolicy.

Service Reference:

Examples:

To describe the Auto Scaling adjustment types


/* This example describes the available adjustment types. */

 var params = {};
 autoscaling.describeAdjustmentTypes(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    AdjustmentTypes: [
       {
      AdjustmentType: "ChangeInCapacity"
     }, 
       {
      AdjustmentType: "ExactCapcity"
     }, 
       {
      AdjustmentType: "PercentChangeInCapacity"
     }
    ]
   }
   */
 });

Calling the describeAdjustmentTypes operation

autoscaling.describeAdjustmentTypes(function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • AdjustmentTypes — (Array<map>)

        The policy adjustment types.

        • AdjustmentType — (String)

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

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeAutoScalingGroups(params = {}, callback) ⇒ AWS.Request

Describes one or more Auto Scaling groups.

Service Reference:

Examples:

To describe an Auto Scaling group


/* This example describes the specified Auto Scaling group. */

 var params = {
  AutoScalingGroupNames: [
     "my-auto-scaling-group"
  ]
 };
 autoscaling.describeAutoScalingGroups(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    AutoScalingGroups: [
       {
      AutoScalingGroupARN: "arn:aws:autoscaling:us-west-2:123456789012:autoScalingGroup:930d940e-891e-4781-a11a-7b0acd480f03:autoScalingGroupName/my-auto-scaling-group", 
      AutoScalingGroupName: "my-auto-scaling-group", 
      AvailabilityZones: [
         "us-west-2c"
      ], 
      CreatedTime: <Date Representation>, 
      DefaultCooldown: 300, 
      DesiredCapacity: 1, 
      EnabledMetrics: [
      ], 
      HealthCheckGracePeriod: 300, 
      HealthCheckType: "EC2", 
      Instances: [
         {
        AvailabilityZone: "us-west-2c", 
        HealthStatus: "Healthy", 
        InstanceId: "i-4ba0837f", 
        LaunchConfigurationName: "my-launch-config", 
        LifecycleState: "InService", 
        ProtectedFromScaleIn: false
       }
      ], 
      LaunchConfigurationName: "my-launch-config", 
      LoadBalancerNames: [
      ], 
      MaxSize: 1, 
      MinSize: 0, 
      NewInstancesProtectedFromScaleIn: false, 
      SuspendedProcesses: [
      ], 
      Tags: [
      ], 
      TerminationPolicies: [
         "Default"
      ], 
      VPCZoneIdentifier: "subnet-12345678"
     }
    ]
   }
   */
 });

Calling the describeAutoScalingGroups operation

var params = {
  AutoScalingGroupNames: [
    'STRING_VALUE',
    /* more items */
  ],
  MaxRecords: 0,
  NextToken: 'STRING_VALUE'
};
autoscaling.describeAutoScalingGroups(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AutoScalingGroupNames — (Array<String>)

      The group names. If you omit this parameter, all Auto Scaling groups are described.

    • NextToken — (String)

      The token for the next set of items to return. (You received this token from a previous call.)

    • MaxRecords — (Integer)

      The maximum number of items to return with this call. The default value is 50 and the maximum value is 100.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • AutoScalingGroups — (Array<map>)

        The groups.

        • AutoScalingGroupNamerequired — (String)

          The name of the group.

        • AutoScalingGroupARN — (String)

          The Amazon Resource Name (ARN) of the group.

        • LaunchConfigurationName — (String)

          The name of the associated launch configuration.

        • MinSizerequired — (Integer)

          The minimum size of the group.

        • MaxSizerequired — (Integer)

          The maximum size of the group.

        • DesiredCapacityrequired — (Integer)

          The desired size of the group.

        • DefaultCooldownrequired — (Integer)

          The amount of time, in seconds, after a scaling activity completes before another scaling activity can start.

        • AvailabilityZonesrequired — (Array<String>)

          One or more Availability Zones for the group.

        • LoadBalancerNames — (Array<String>)

          One or more load balancers associated with the group.

        • TargetGroupARNs — (Array<String>)

          The Amazon Resource Names (ARN) of the target groups for your load balancer.

        • HealthCheckTyperequired — (String)

          The service to use for the health checks. The valid values are EC2 and ELB.

        • HealthCheckGracePeriod — (Integer)

          The amount of time, in seconds, that Auto Scaling waits before checking the health status of an EC2 instance that has come into service.

        • Instances — (Array<map>)

          The EC2 instances associated with the group.

          • InstanceIdrequired — (String)

            The ID of the instance.

          • AvailabilityZonerequired — (String)

            The Availability Zone in which the instance is running.

          • LifecycleStaterequired — (String)

            A description of the current lifecycle state. Note that the Quarantined state is not used.

            Possible values include:
            • "Pending"
            • "Pending:Wait"
            • "Pending:Proceed"
            • "Quarantined"
            • "InService"
            • "Terminating"
            • "Terminating:Wait"
            • "Terminating:Proceed"
            • "Terminated"
            • "Detaching"
            • "Detached"
            • "EnteringStandby"
            • "Standby"
          • HealthStatusrequired — (String)

            The last reported health status of the instance. "Healthy" means that the instance is healthy and should remain in service. "Unhealthy" means that the instance is unhealthy and Auto Scaling should terminate and replace it.

          • LaunchConfigurationNamerequired — (String)

            The launch configuration associated with the instance.

          • ProtectedFromScaleInrequired — (Boolean)

            Indicates whether the instance is protected from termination by Auto Scaling when scaling in.

        • CreatedTimerequired — (Date)

          The date and time the group was created.

        • SuspendedProcesses — (Array<map>)

          The suspended processes associated with the group.

          • ProcessName — (String)

            The name of the suspended process.

          • SuspensionReason — (String)

            The reason that the process was suspended.

        • PlacementGroup — (String)

          The name of the placement group into which you'll launch your instances, if any. For more information, see Placement Groups in the Amazon Elastic Compute Cloud User Guide.

        • VPCZoneIdentifier — (String)

          One or more subnet IDs, if applicable, separated by commas.

          If you specify VPCZoneIdentifier and AvailabilityZones, ensure that the Availability Zones of the subnets match the values for AvailabilityZones.

        • EnabledMetrics — (Array<map>)

          The metrics enabled for the group.

          • Metric — (String)

            One of the following metrics:

            • GroupMinSize

            • GroupMaxSize

            • GroupDesiredCapacity

            • GroupInServiceInstances

            • GroupPendingInstances

            • GroupStandbyInstances

            • GroupTerminatingInstances

            • GroupTotalInstances

          • Granularity — (String)

            The granularity of the metric. The only valid value is 1Minute.

        • Status — (String)

          The current state of the group when DeleteAutoScalingGroup is in progress.

        • Tags — (Array<map>)

          The tags for the group.

          • ResourceId — (String)

            The name of the group.

          • ResourceType — (String)

            The type of resource. The only supported value is auto-scaling-group.

          • Key — (String)

            The tag key.

          • Value — (String)

            The tag value.

          • PropagateAtLaunch — (Boolean)

            Determines whether the tag is added to new instances as they are launched in the group.

        • TerminationPolicies — (Array<String>)

          The termination policies for the group.

        • NewInstancesProtectedFromScaleIn — (Boolean)

          Indicates whether newly launched instances are protected from termination by Auto Scaling when scaling in.

      • NextToken — (String)

        The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeAutoScalingInstances(params = {}, callback) ⇒ AWS.Request

Describes one or more Auto Scaling instances.

Service Reference:

Examples:

To describe one or more Auto Scaling instances


/* This example describes the specified Auto Scaling instance. */

 var params = {
  InstanceIds: [
     "i-4ba0837f"
  ]
 };
 autoscaling.describeAutoScalingInstances(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    AutoScalingInstances: [
       {
      AutoScalingGroupName: "my-auto-scaling-group", 
      AvailabilityZone: "us-west-2c", 
      HealthStatus: "HEALTHY", 
      InstanceId: "i-4ba0837f", 
      LaunchConfigurationName: "my-launch-config", 
      LifecycleState: "InService", 
      ProtectedFromScaleIn: false
     }
    ]
   }
   */
 });

Calling the describeAutoScalingInstances operation

var params = {
  InstanceIds: [
    'STRING_VALUE',
    /* more items */
  ],
  MaxRecords: 0,
  NextToken: 'STRING_VALUE'
};
autoscaling.describeAutoScalingInstances(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • InstanceIds — (Array<String>)

      The instances to describe; up to 50 instance IDs. If you omit this parameter, all Auto Scaling instances are described. If you specify an ID that does not exist, it is ignored with no error.

    • MaxRecords — (Integer)

      The maximum number of items to return with this call. The default value is 50 and the maximum value is 100.

    • NextToken — (String)

      The token for the next set of items to return. (You received this token from a previous call.)

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • AutoScalingInstances — (Array<map>)

        The instances.

        • InstanceIdrequired — (String)

          The ID of the instance.

        • AutoScalingGroupNamerequired — (String)

          The name of the Auto Scaling group associated with the instance.

        • AvailabilityZonerequired — (String)

          The Availability Zone for the instance.

        • LifecycleStaterequired — (String)

          The lifecycle state for the instance. For more information, see Auto Scaling Lifecycle in the Auto Scaling User Guide.

        • HealthStatusrequired — (String)

          The last reported health status of this instance. "Healthy" means that the instance is healthy and should remain in service. "Unhealthy" means that the instance is unhealthy and Auto Scaling should terminate and replace it.

        • LaunchConfigurationNamerequired — (String)

          The launch configuration used to launch the instance. This value is not available if you attached the instance to the Auto Scaling group.

        • ProtectedFromScaleInrequired — (Boolean)

          Indicates whether the instance is protected from termination by Auto Scaling when scaling in.

      • NextToken — (String)

        The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeAutoScalingNotificationTypes(params = {}, callback) ⇒ AWS.Request

Describes the notification types that are supported by Auto Scaling.

Examples:

To describe the Auto Scaling notification types


/* This example describes the available notification types. */

 var params = {};
 autoscaling.describeAutoScalingNotificationTypes(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    AutoScalingNotificationTypes: [
       "autoscaling:EC2_INSTANCE_LAUNCH", 
       "autoscaling:EC2_INSTANCE_LAUNCH_ERROR", 
       "autoscaling:EC2_INSTANCE_TERMINATE", 
       "autoscaling:EC2_INSTANCE_TERMINATE_ERROR", 
       "autoscaling:TEST_NOTIFICATION"
    ]
   }
   */
 });

Calling the describeAutoScalingNotificationTypes operation

autoscaling.describeAutoScalingNotificationTypes(function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • AutoScalingNotificationTypes — (Array<String>)

        The notification types.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeLaunchConfigurations(params = {}, callback) ⇒ AWS.Request

Describes one or more launch configurations.

Service Reference:

Examples:

To describe Auto Scaling launch configurations


/* This example describes the specified launch configuration. */

 var params = {
  LaunchConfigurationNames: [
     "my-launch-config"
  ]
 };
 autoscaling.describeLaunchConfigurations(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    LaunchConfigurations: [
       {
      AssociatePublicIpAddress: true, 
      BlockDeviceMappings: [
      ], 
      CreatedTime: <Date Representation>, 
      EbsOptimized: false, 
      ImageId: "ami-043a5034", 
      InstanceMonitoring: {
       Enabled: true
      }, 
      InstanceType: "t1.micro", 
      LaunchConfigurationARN: "arn:aws:autoscaling:us-west-2:123456789012:launchConfiguration:98d3b196-4cf9-4e88-8ca1-8547c24ced8b:launchConfigurationName/my-launch-config", 
      LaunchConfigurationName: "my-launch-config", 
      SecurityGroups: [
         "sg-67ef0308"
      ]
     }
    ]
   }
   */
 });

Calling the describeLaunchConfigurations operation

var params = {
  LaunchConfigurationNames: [
    'STRING_VALUE',
    /* more items */
  ],
  MaxRecords: 0,
  NextToken: 'STRING_VALUE'
};
autoscaling.describeLaunchConfigurations(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • LaunchConfigurationNames — (Array<String>)

      The launch configuration names. If you omit this parameter, all launch configurations are described.

    • NextToken — (String)

      The token for the next set of items to return. (You received this token from a previous call.)

    • MaxRecords — (Integer)

      The maximum number of items to return with this call. The default value is 50 and the maximum value is 100.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • LaunchConfigurations — (Array<map>)

        The launch configurations.

        • LaunchConfigurationNamerequired — (String)

          The name of the launch configuration.

        • LaunchConfigurationARN — (String)

          The Amazon Resource Name (ARN) of the launch configuration.

        • ImageIdrequired — (String)

          The ID of the Amazon Machine Image (AMI).

        • KeyName — (String)

          The name of the key pair.

        • SecurityGroups — (Array<String>)

          The security groups to associate with the instances.

        • ClassicLinkVPCId — (String)

          The ID of a ClassicLink-enabled VPC to link your EC2-Classic instances to. This parameter can only be used if you are launching EC2-Classic instances. For more information, see ClassicLink in the Amazon Elastic Compute Cloud User Guide.

        • ClassicLinkVPCSecurityGroups — (Array<String>)

          The IDs of one or more security groups for the VPC specified in ClassicLinkVPCId. This parameter is required if you specify a ClassicLink-enabled VPC, and cannot be used otherwise. For more information, see ClassicLink in the Amazon Elastic Compute Cloud User Guide.

        • UserData — (String)

          The user data available to the instances.

        • InstanceTyperequired — (String)

          The instance type for the instances.

        • KernelId — (String)

          The ID of the kernel associated with the AMI.

        • RamdiskId — (String)

          The ID of the RAM disk associated with the AMI.

        • BlockDeviceMappings — (Array<map>)

          A block device mapping, which specifies the block devices for the instance.

          • VirtualName — (String)

            The name of the virtual device (for example, ephemeral0).

          • DeviceNamerequired — (String)

            The device name exposed to the EC2 instance (for example, /dev/sdh or xvdh).

          • Ebs — (map)

            The information about the Amazon EBS volume.

            • SnapshotId — (String)

              The ID of the snapshot.

            • VolumeSize — (Integer)

              The volume size, in GiB. For standard volumes, specify a value from 1 to 1,024. For io1 volumes, specify a value from 4 to 16,384. For gp2 volumes, specify a value from 1 to 16,384. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.

              Default: If you create a volume from a snapshot and you don't specify a volume size, the default is the snapshot size.

            • VolumeType — (String)

              The volume type. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide.

              Valid values: standard | io1 | gp2

              Default: standard

            • DeleteOnTermination — (Boolean)

              Indicates whether the volume is deleted on instance termination.

              Default: true

            • Iops — (Integer)

              The number of I/O operations per second (IOPS) to provision for the volume.

              Constraint: Required when the volume type is io1.

            • Encrypted — (Boolean)

              Indicates whether the volume should be encrypted. Encrypted EBS volumes must be attached to instances that support Amazon EBS encryption. Volumes that are created from encrypted snapshots are automatically encrypted. There is no way to create an encrypted volume from an unencrypted snapshot or an unencrypted volume from an encrypted snapshot. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide.

          • NoDevice — (Boolean)

            Suppresses a device mapping.

            If this parameter is true for the root device, the instance might fail the EC2 health check. Auto Scaling launches a replacement instance if the instance fails the health check.

        • InstanceMonitoring — (map)

          Controls whether instances in this group are launched with detailed (true) or basic (false) monitoring.

          • Enabled — (Boolean)

            If true, detailed monitoring is enabled. Otherwise, basic monitoring is enabled.

        • SpotPrice — (String)

          The price to bid when launching Spot Instances.

        • IamInstanceProfile — (String)

          The name or Amazon Resource Name (ARN) of the instance profile associated with the IAM role for the instance.

        • CreatedTimerequired — (Date)

          The creation date and time for the launch configuration.

        • EbsOptimized — (Boolean)

          Controls whether the instance is optimized for EBS I/O (true) or not (false).

        • AssociatePublicIpAddress — (Boolean)

          [EC2-VPC] Indicates whether to assign a public IP address to each instance.

        • PlacementTenancy — (String)

          The tenancy of the instance, either default or dedicated. An instance with dedicated tenancy runs in an isolated, single-tenant hardware and can only be launched into a VPC.

      • NextToken — (String)

        The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeLifecycleHooks(params = {}, callback) ⇒ AWS.Request

Describes the lifecycle hooks for the specified Auto Scaling group.

Service Reference:

Examples:

To describe your lifecycle hooks


/* This example describes the lifecycle hooks for the specified Auto Scaling group. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group"
 };
 autoscaling.describeLifecycleHooks(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    LifecycleHooks: [
       {
      AutoScalingGroupName: "my-auto-scaling-group", 
      DefaultResult: "ABANDON", 
      GlobalTimeout: 172800, 
      HeartbeatTimeout: 3600, 
      LifecycleHookName: "my-lifecycle-hook", 
      LifecycleTransition: "autoscaling:EC2_INSTANCE_LAUNCHING", 
      NotificationTargetARN: "arn:aws:sns:us-west-2:123456789012:my-sns-topic", 
      RoleARN: "arn:aws:iam::123456789012:role/my-auto-scaling-role"
     }
    ]
   }
   */
 });

Calling the describeLifecycleHooks operation

var params = {
  AutoScalingGroupName: 'STRING_VALUE', /* required */
  LifecycleHookNames: [
    'STRING_VALUE',
    /* more items */
  ]
};
autoscaling.describeLifecycleHooks(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AutoScalingGroupName — (String)

      The name of the group.

    • LifecycleHookNames — (Array<String>)

      The names of one or more lifecycle hooks. If you omit this parameter, all lifecycle hooks are described.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • LifecycleHooks — (Array<map>)

        The lifecycle hooks for the specified group.

        • LifecycleHookName — (String)

          The name of the lifecycle hook.

        • AutoScalingGroupName — (String)

          The name of the Auto Scaling group for the lifecycle hook.

        • LifecycleTransition — (String)

          The state of the EC2 instance to which you want to attach the lifecycle hook. For a list of lifecycle hook types, see DescribeLifecycleHookTypes.

        • NotificationTargetARN — (String)

          The ARN of the target that Auto Scaling sends notifications to when an instance is in the transition state for the lifecycle hook. The notification target can be either an SQS queue or an SNS topic.

        • RoleARN — (String)

          The ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target.

        • NotificationMetadata — (String)

          Additional information that you want to include any time Auto Scaling sends a message to the notification target.

        • HeartbeatTimeout — (Integer)

          The maximum time, in seconds, that can elapse before the lifecycle hook times out. If the lifecycle hook times out, Auto Scaling performs the default action. You can prevent the lifecycle hook from timing out by calling RecordLifecycleActionHeartbeat.

        • GlobalTimeout — (Integer)

          The maximum time, in seconds, that an instance can remain in a Pending:Wait or Terminating:Wait state. The maximum is 172800 seconds (48 hours) or 100 times HeartbeatTimeout, whichever is smaller.

        • DefaultResult — (String)

          Defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses or if an unexpected failure occurs. The valid values are CONTINUE and ABANDON. The default value is CONTINUE.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeLifecycleHookTypes(params = {}, callback) ⇒ AWS.Request

Describes the available types of lifecycle hooks.

Service Reference:

Examples:

To describe the available types of lifecycle hooks


/* This example describes the available lifecycle hook types. */

 var params = {};
 autoscaling.describeLifecycleHookTypes(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    LifecycleHookTypes: [
       "autoscaling:EC2_INSTANCE_LAUNCHING", 
       "autoscaling:EC2_INSTANCE_TERMINATING"
    ]
   }
   */
 });

Calling the describeLifecycleHookTypes operation

autoscaling.describeLifecycleHookTypes(function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • LifecycleHookTypes — (Array<String>)

        The lifecycle hook types.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeLoadBalancers(params = {}, callback) ⇒ AWS.Request

Describes the load balancers for the specified Auto Scaling group.

Note that this operation describes only Classic Load Balancers. If you have Application Load Balancers, use DescribeLoadBalancerTargetGroups instead.

Service Reference:

Examples:

To describe the load balancers for an Auto Scaling group


/* This example describes the load balancers attached to the specified Auto Scaling group. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group"
 };
 autoscaling.describeLoadBalancers(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    LoadBalancers: [
       {
      LoadBalancerName: "my-load-balancer", 
      State: "Added"
     }
    ]
   }
   */
 });

Calling the describeLoadBalancers operation

var params = {
  AutoScalingGroupName: 'STRING_VALUE', /* required */
  MaxRecords: 0,
  NextToken: 'STRING_VALUE'
};
autoscaling.describeLoadBalancers(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AutoScalingGroupName — (String)

      The name of the group.

    • NextToken — (String)

      The token for the next set of items to return. (You received this token from a previous call.)

    • MaxRecords — (Integer)

      The maximum number of items to return with this call. The default value is 50 and the maximum value is 100.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • LoadBalancers — (Array<map>)

        The load balancers.

        • LoadBalancerName — (String)

          The name of the load balancer.

        • State — (String)

          One of the following load balancer states:

          • Adding - The instances in the group are being registered with the load balancer.

          • Added - All instances in the group are registered with the load balancer.

          • InService - At least one instance in the group passed an ELB health check.

          • Removing - The instances in the group are being deregistered from the load balancer. If connection draining is enabled, Elastic Load Balancing waits for in-flight requests to complete before deregistering the instances.

          • Removed - All instances in the group are deregistered from the load balancer.

      • NextToken — (String)

        The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeLoadBalancerTargetGroups(params = {}, callback) ⇒ AWS.Request

Describes the target groups for the specified Auto Scaling group.

Examples:

To describe the target groups for an Auto Scaling group


/* This example describes the target groups attached to the specified Auto Scaling group. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group"
 };
 autoscaling.describeLoadBalancerTargetGroups(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    LoadBalancerTargetGroups: [
       {
      LoadBalancerTargetGroupARN: "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067", 
      State: "Added"
     }
    ]
   }
   */
 });

Calling the describeLoadBalancerTargetGroups operation

var params = {
  AutoScalingGroupName: 'STRING_VALUE', /* required */
  MaxRecords: 0,
  NextToken: 'STRING_VALUE'
};
autoscaling.describeLoadBalancerTargetGroups(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AutoScalingGroupName — (String)

      The name of the Auto Scaling group.

    • NextToken — (String)

      The token for the next set of items to return. (You received this token from a previous call.)

    • MaxRecords — (Integer)

      The maximum number of items to return with this call. The default value is 50 and the maximum value is 100.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • LoadBalancerTargetGroups — (Array<map>)

        Information about the target groups.

        • LoadBalancerTargetGroupARN — (String)

          The Amazon Resource Name (ARN) of the target group.

        • State — (String)

          The state of the target group.

          • Adding - The Auto Scaling instances are being registered with the target group.

          • Added - All Auto Scaling instances are registered with the target group.

          • InService - At least one Auto Scaling instance passed an ELB health check.

          • Removing - The Auto Scaling instances are being deregistered from the target group. If connection draining is enabled, Elastic Load Balancing waits for in-flight requests to complete before deregistering the instances.

          • Removed - All Auto Scaling instances are deregistered from the target group.

      • NextToken — (String)

        The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeMetricCollectionTypes(params = {}, callback) ⇒ AWS.Request

Describes the available CloudWatch metrics for Auto Scaling.

Note that the GroupStandbyInstances metric is not returned by default. You must explicitly request this metric when calling EnableMetricsCollection.

Service Reference:

Examples:

To describe the Auto Scaling metric collection types


/* This example describes the available metric collection types. */

 var params = {};
 autoscaling.describeMetricCollectionTypes(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Granularities: [
       {
      Granularity: "1Minute"
     }
    ], 
    Metrics: [
       {
      Metric: "GroupMinSize"
     }, 
       {
      Metric: "GroupMaxSize"
     }, 
       {
      Metric: "GroupDesiredCapacity"
     }, 
       {
      Metric: "GroupInServiceInstances"
     }, 
       {
      Metric: "GroupPendingInstances"
     }, 
       {
      Metric: "GroupTerminatingInstances"
     }, 
       {
      Metric: "GroupStandbyInstances"
     }, 
       {
      Metric: "GroupTotalInstances"
     }
    ]
   }
   */
 });

Calling the describeMetricCollectionTypes operation

autoscaling.describeMetricCollectionTypes(function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Metrics — (Array<map>)

        One or more metrics.

        • Metric — (String)

          One of the following metrics:

          • GroupMinSize

          • GroupMaxSize

          • GroupDesiredCapacity

          • GroupInServiceInstances

          • GroupPendingInstances

          • GroupStandbyInstances

          • GroupTerminatingInstances

          • GroupTotalInstances

      • Granularities — (Array<map>)

        The granularities for the metrics.

        • Granularity — (String)

          The granularity. The only valid value is 1Minute.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeNotificationConfigurations(params = {}, callback) ⇒ AWS.Request

Describes the notification actions associated with the specified Auto Scaling group.

Examples:

To describe Auto Scaling notification configurations


/* This example describes the notification configurations for the specified Auto Scaling group. */

 var params = {
  AutoScalingGroupNames: [
     "my-auto-scaling-group"
  ]
 };
 autoscaling.describeNotificationConfigurations(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    NotificationConfigurations: [
       {
      AutoScalingGroupName: "my-auto-scaling-group", 
      NotificationType: "autoscaling:TEST_NOTIFICATION", 
      TopicARN: "arn:aws:sns:us-west-2:123456789012:my-sns-topic-2"
     }, 
       {
      AutoScalingGroupName: "my-auto-scaling-group", 
      NotificationType: "autoscaling:TEST_NOTIFICATION", 
      TopicARN: "arn:aws:sns:us-west-2:123456789012:my-sns-topic"
     }
    ]
   }
   */
 });

Calling the describeNotificationConfigurations operation

var params = {
  AutoScalingGroupNames: [
    'STRING_VALUE',
    /* more items */
  ],
  MaxRecords: 0,
  NextToken: 'STRING_VALUE'
};
autoscaling.describeNotificationConfigurations(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AutoScalingGroupNames — (Array<String>)

      The name of the group.

    • NextToken — (String)

      The token for the next set of items to return. (You received this token from a previous call.)

    • MaxRecords — (Integer)

      The maximum number of items to return with this call. The default value is 50 and the maximum value is 100.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • NotificationConfigurations — (Array<map>)

        The notification configurations.

        • AutoScalingGroupName — (String)

          The name of the group.

        • TopicARN — (String)

          The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) topic.

        • NotificationType — (String)

          One of the following event notification types:

          • autoscaling:EC2_INSTANCE_LAUNCH

          • autoscaling:EC2_INSTANCE_LAUNCH_ERROR

          • autoscaling:EC2_INSTANCE_TERMINATE

          • autoscaling:EC2_INSTANCE_TERMINATE_ERROR

          • autoscaling:TEST_NOTIFICATION

      • NextToken — (String)

        The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describePolicies(params = {}, callback) ⇒ AWS.Request

Describes the policies for the specified Auto Scaling group.

Service Reference:

Examples:

To describe Auto Scaling policies


/* This example describes the policies for the specified Auto Scaling group. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group"
 };
 autoscaling.describePolicies(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    ScalingPolicies: [
       {
      AdjustmentType: "ChangeInCapacity", 
      Alarms: [
      ], 
      AutoScalingGroupName: "my-auto-scaling-group", 
      PolicyARN: "arn:aws:autoscaling:us-west-2:123456789012:scalingPolicy:2233f3d7-6290-403b-b632-93c553560106:autoScalingGroupName/my-auto-scaling-group:policyName/ScaleIn", 
      PolicyName: "ScaleIn", 
      ScalingAdjustment: -1
     }, 
       {
      AdjustmentType: "PercentChangeInCapacity", 
      Alarms: [
      ], 
      AutoScalingGroupName: "my-auto-scaling-group", 
      Cooldown: 60, 
      MinAdjustmentStep: 2, 
      PolicyARN: "arn:aws:autoscaling:us-west-2:123456789012:scalingPolicy:2b435159-cf77-4e89-8c0e-d63b497baad7:autoScalingGroupName/my-auto-scaling-group:policyName/ScalePercentChange", 
      PolicyName: "ScalePercentChange", 
      ScalingAdjustment: 25
     }
    ]
   }
   */
 });

Calling the describePolicies operation

var params = {
  AutoScalingGroupName: 'STRING_VALUE',
  MaxRecords: 0,
  NextToken: 'STRING_VALUE',
  PolicyNames: [
    'STRING_VALUE',
    /* more items */
  ],
  PolicyTypes: [
    'STRING_VALUE',
    /* more items */
  ]
};
autoscaling.describePolicies(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AutoScalingGroupName — (String)

      The name of the group.

    • PolicyNames — (Array<String>)

      One or more policy names or policy ARNs to be described. If you omit this parameter, all policy names are described. If an group name is provided, the results are limited to that group. This list is limited to 50 items. If you specify an unknown policy name, it is ignored with no error.

    • PolicyTypes — (Array<String>)

      One or more policy types. Valid values are SimpleScaling and StepScaling.

    • NextToken — (String)

      The token for the next set of items to return. (You received this token from a previous call.)

    • MaxRecords — (Integer)

      The maximum number of items to be returned with each call. The default value is 50 and the maximum value is 100.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • ScalingPolicies — (Array<map>)

        The scaling policies.

        • AutoScalingGroupName — (String)

          The name of the Auto Scaling group associated with this scaling policy.

        • PolicyName — (String)

          The name of the scaling policy.

        • PolicyARN — (String)

          The Amazon Resource Name (ARN) of the policy.

        • PolicyType — (String)

          The policy type. Valid values are SimpleScaling and StepScaling.

        • AdjustmentType — (String)

          The adjustment type, which specifies how ScalingAdjustment is interpreted. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

        • MinAdjustmentStep — (Integer)

          Available for backward compatibility. Use MinAdjustmentMagnitude instead.

        • MinAdjustmentMagnitude — (Integer)

          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.

        • ScalingAdjustment — (Integer)

          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.

        • Cooldown — (Integer)

          The amount of time, in seconds, after a scaling activity completes before any further dynamic scaling activities can start.

        • StepAdjustments — (Array<map>)

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

          • MetricIntervalLowerBound — (Float)

            The lower bound for the difference between the alarm threshold and the CloudWatch metric. If the metric value is above the breach threshold, the lower bound is inclusive (the metric must be greater than or equal to the threshold plus the lower bound). Otherwise, it is exclusive (the metric must be greater than the threshold plus the lower bound). A null value indicates negative infinity.

          • MetricIntervalUpperBound — (Float)

            The upper bound for the difference between the alarm threshold and the CloudWatch metric. If the metric value is above the breach threshold, the upper bound is exclusive (the metric must be less than the threshold plus the upper bound). Otherwise, it is inclusive (the metric must be less than or equal to the threshold plus the upper bound). A null value indicates positive infinity.

            The upper bound must be greater than the lower bound.

          • ScalingAdjustmentrequired — (Integer)

            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.

        • MetricAggregationType — (String)

          The aggregation type for the CloudWatch metrics. Valid values are Minimum, Maximum, and Average.

        • EstimatedInstanceWarmup — (Integer)

          The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics.

        • Alarms — (Array<map>)

          The CloudWatch alarms related to the policy.

          • AlarmName — (String)

            The name of the alarm.

          • AlarmARN — (String)

            The Amazon Resource Name (ARN) of the alarm.

        • TargetTrackingConfiguration — (map)

          A target tracking policy.

          • PredefinedMetricSpecification — (map)

            A predefined metric. You can specify either a predefined metric or a customized metric.

            • PredefinedMetricTyperequired — (String)

              The metric type.

              Possible values include:
              • "ASGAverageCPUUtilization"
              • "ASGAverageNetworkIn"
              • "ASGAverageNetworkOut"
              • "ALBRequestCountPerTarget"
            • ResourceLabel — (String)

              Identifies the resource associated with the metric type. The following predefined metrics are available:

              • ASGAverageCPUUtilization - average CPU utilization of the Auto Scaling group

              • ASGAverageNetworkIn - average number of bytes received on all network interfaces by the Auto Scaling group

              • ASGAverageNetworkOut - average number of bytes sent out on all network interfaces by the Auto Scaling group

              • ALBRequestCountPerTarget - number of requests completed per target in an Application Load Balancer target group

              For predefined metric types ASGAverageCPUUtilization, ASGAverageNetworkIn and ASGAverageNetworkOut, the parameter must not be specified as the resource associated with the metric type is the Auto Scaling group. For predefined metric type ALBRequestCountPerTarget, the parameter must be specified in the format: app/load-balancer-name/load-balancer-id/targetgroup/target-group-name/target-group-id , where app/load-balancer-name/load-balancer-id is the final portion of the load balancer ARN, and targetgroup/target-group-name/target-group-id is the final portion of the target group ARN. The target group must be attached to the Auto Scaling group.

          • CustomizedMetricSpecification — (map)

            A customized metric.

            • MetricNamerequired — (String)

              The name of the metric.

            • Namespacerequired — (String)

              The namespace of the metric.

            • Dimensions — (Array<map>)

              The dimensions of the metric.

              • Namerequired — (String)

                The name of the dimension.

              • Valuerequired — (String)

                The value of the dimension.

            • Statisticrequired — (String)

              The statistic of the metric.

              Possible values include:
              • "Average"
              • "Minimum"
              • "Maximum"
              • "SampleCount"
              • "Sum"
            • Unit — (String)

              The unit of the metric.

          • TargetValuerequired — (Float)

            The target value for the metric.

          • DisableScaleIn — (Boolean)

            Indicates whether scale in by the target tracking policy is disabled. If the value is true, scale in is disabled and the target tracking policy won't remove instances from the Auto Scaling group. Otherwise, scale in is enabled and the target tracking policy can remove instances from the Auto Scaling group. The default value is false.

      • NextToken — (String)

        The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeScalingActivities(params = {}, callback) ⇒ AWS.Request

Describes one or more scaling activities for the specified Auto Scaling group.

Service Reference:

Examples:

To describe the scaling activities for an Auto Scaling group


/* This example describes the scaling activities for the specified Auto Scaling group. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group"
 };
 autoscaling.describeScalingActivities(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Activities: [
       {
      ActivityId: "f9f2d65b-f1f2-43e7-b46d-d86756459699", 
      AutoScalingGroupName: "my-auto-scaling-group", 
      Cause: "At 2013-08-19T20:53:25Z a user request created an AutoScalingGroup changing the desired capacity from 0 to 1.  At 2013-08-19T20:53:29Z an instance was started in response to a difference between desired and actual capacity, increasing the capacity from 0 to 1.", 
      Description: "Launching a new EC2 instance: i-4ba0837f", 
      Details: "details", 
      EndTime: <Date Representation>, 
      Progress: 100, 
      StartTime: <Date Representation>, 
      StatusCode: "Successful"
     }
    ]
   }
   */
 });

Calling the describeScalingActivities operation

var params = {
  ActivityIds: [
    'STRING_VALUE',
    /* more items */
  ],
  AutoScalingGroupName: 'STRING_VALUE',
  MaxRecords: 0,
  NextToken: 'STRING_VALUE'
};
autoscaling.describeScalingActivities(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ActivityIds — (Array<String>)

      The activity IDs of the desired scaling activities. If you omit this parameter, all activities for the past six weeks are described. If you specify an Auto Scaling group, the results are limited to that group. The list of requested activities cannot contain more than 50 items. If unknown activities are requested, they are ignored with no error.

    • AutoScalingGroupName — (String)

      The name of the group.

    • MaxRecords — (Integer)

      The maximum number of items to return with this call. The default value is 100.

    • NextToken — (String)

      The token for the next set of items to return. (You received this token from a previous call.)

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Activities — (Array<map>)

        The scaling activities. Activities are sorted by start time. Activities still in progress are described first.

        • ActivityIdrequired — (String)

          The ID of the activity.

        • AutoScalingGroupNamerequired — (String)

          The name of the Auto Scaling group.

        • Description — (String)

          A friendly, more verbose description of the activity.

        • Causerequired — (String)

          The reason the activity began.

        • StartTimerequired — (Date)

          The start time of the activity.

        • EndTime — (Date)

          The end time of the activity.

        • StatusCoderequired — (String)

          The current status of the activity.

          Possible values include:
          • "PendingSpotBidPlacement"
          • "WaitingForSpotInstanceRequestId"
          • "WaitingForSpotInstanceId"
          • "WaitingForInstanceId"
          • "PreInService"
          • "InProgress"
          • "WaitingForELBConnectionDraining"
          • "MidLifecycleAction"
          • "WaitingForInstanceWarmup"
          • "Successful"
          • "Failed"
          • "Cancelled"
        • StatusMessage — (String)

          A friendly, more verbose description of the activity status.

        • Progress — (Integer)

          A value between 0 and 100 that indicates the progress of the activity.

        • Details — (String)

          The details about the activity.

      • NextToken — (String)

        The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeScalingProcessTypes(params = {}, callback) ⇒ AWS.Request

Describes the scaling process types for use with ResumeProcesses and SuspendProcesses.

Service Reference:

Examples:

To describe the Auto Scaling process types


/* This example describes the Auto Scaling process types. */

 var params = {};
 autoscaling.describeScalingProcessTypes(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Processes: [
       {
      ProcessName: "AZRebalance"
     }, 
       {
      ProcessName: "AddToLoadBalancer"
     }, 
       {
      ProcessName: "AlarmNotification"
     }, 
       {
      ProcessName: "HealthCheck"
     }, 
       {
      ProcessName: "Launch"
     }, 
       {
      ProcessName: "ReplaceUnhealthy"
     }, 
       {
      ProcessName: "ScheduledActions"
     }, 
       {
      ProcessName: "Terminate"
     }
    ]
   }
   */
 });

Calling the describeScalingProcessTypes operation

autoscaling.describeScalingProcessTypes(function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Processes — (Array<map>)

        The names of the process types.

        • ProcessNamerequired — (String)

          One of the following processes:

          • Launch

          • Terminate

          • AddToLoadBalancer

          • AlarmNotification

          • AZRebalance

          • HealthCheck

          • ReplaceUnhealthy

          • ScheduledActions

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeScheduledActions(params = {}, callback) ⇒ AWS.Request

Describes the actions scheduled for your Auto Scaling group that haven't run. To describe the actions that have already run, use DescribeScalingActivities.

Service Reference:

Examples:

To describe scheduled actions


/* This example describes the scheduled actions for the specified Auto Scaling group. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group"
 };
 autoscaling.describeScheduledActions(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    ScheduledUpdateGroupActions: [
       {
      AutoScalingGroupName: "my-auto-scaling-group", 
      DesiredCapacity: 4, 
      MaxSize: 6, 
      MinSize: 2, 
      Recurrence: "30 0 1 12 0", 
      ScheduledActionARN: "arn:aws:autoscaling:us-west-2:123456789012:scheduledUpdateGroupAction:8e86b655-b2e6-4410-8f29-b4f094d6871c:autoScalingGroupName/my-auto-scaling-group:scheduledActionName/my-scheduled-action", 
      ScheduledActionName: "my-scheduled-action", 
      StartTime: <Date Representation>, 
      Time: <Date Representation>
     }
    ]
   }
   */
 });

Calling the describeScheduledActions operation

var params = {
  AutoScalingGroupName: 'STRING_VALUE',
  EndTime: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
  MaxRecords: 0,
  NextToken: 'STRING_VALUE',
  ScheduledActionNames: [
    'STRING_VALUE',
    /* more items */
  ],
  StartTime: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789
};
autoscaling.describeScheduledActions(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AutoScalingGroupName — (String)

      The name of the group.

    • ScheduledActionNames — (Array<String>)

      Describes one or more scheduled actions. If you omit this parameter, all scheduled actions are described. If you specify an unknown scheduled action, it is ignored with no error.

      You can describe up to a maximum of 50 instances with a single call. If there are more items to return, the call returns a token. To get the next set of items, repeat the call with the returned token.

    • StartTime — (Date)

      The earliest scheduled start time to return. If scheduled action names are provided, this parameter is ignored.

    • EndTime — (Date)

      The latest scheduled start time to return. If scheduled action names are provided, this parameter is ignored.

    • NextToken — (String)

      The token for the next set of items to return. (You received this token from a previous call.)

    • MaxRecords — (Integer)

      The maximum number of items to return with this call. The default value is 50 and the maximum value is 100.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • ScheduledUpdateGroupActions — (Array<map>)

        The scheduled actions.

        • AutoScalingGroupName — (String)

          The name of the group.

        • ScheduledActionName — (String)

          The name of the scheduled action.

        • ScheduledActionARN — (String)

          The Amazon Resource Name (ARN) of the scheduled action.

        • Time — (Date)

          This parameter is deprecated.

        • StartTime — (Date)

          The date and time that the action is scheduled to begin. This date and time can be up to one month in the future.

          When StartTime and EndTime are specified with Recurrence, they form the boundaries of when the recurring action will start and stop.

        • EndTime — (Date)

          The date and time that the action is scheduled to end. This date and time can be up to one month in the future.

        • Recurrence — (String)

          The recurring schedule for the action.

        • MinSize — (Integer)

          The minimum size of the group.

        • MaxSize — (Integer)

          The maximum size of the group.

        • DesiredCapacity — (Integer)

          The number of instances you prefer to maintain in the group.

      • NextToken — (String)

        The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeTags(params = {}, callback) ⇒ AWS.Request

Describes the specified tags.

You can use filters to limit the results. For example, you can query for the tags for a specific Auto Scaling group. You can specify multiple values for a filter. A tag must match at least one of the specified values for it to be included in the results.

You can also specify multiple filters. The result includes information for a particular tag only if it matches all the filters. If there's no match, no special message is returned.

Service Reference:

Examples:

To describe tags


/* This example describes the tags for the specified Auto Scaling group. */

 var params = {
  Filters: [
     {
    Name: "auto-scaling-group", 
    Values: [
       "my-auto-scaling-group"
    ]
   }
  ]
 };
 autoscaling.describeTags(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Tags: [
       {
      Key: "Dept", 
      PropagateAtLaunch: true, 
      ResourceId: "my-auto-scaling-group", 
      ResourceType: "auto-scaling-group", 
      Value: "Research"
     }, 
       {
      Key: "Role", 
      PropagateAtLaunch: true, 
      ResourceId: "my-auto-scaling-group", 
      ResourceType: "auto-scaling-group", 
      Value: "WebServer"
     }
    ]
   }
   */
 });

Calling the describeTags operation

var params = {
  Filters: [
    {
      Name: 'STRING_VALUE',
      Values: [
        'STRING_VALUE',
        /* more items */
      ]
    },
    /* more items */
  ],
  MaxRecords: 0,
  NextToken: 'STRING_VALUE'
};
autoscaling.describeTags(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Filters — (Array<map>)

      A filter used to scope the tags to return.

      • Name — (String)

        The name of the filter. The valid values are: "auto-scaling-group", "key", "value", and "propagate-at-launch".

      • Values — (Array<String>)

        The value of the filter.

    • NextToken — (String)

      The token for the next set of items to return. (You received this token from a previous call.)

    • MaxRecords — (Integer)

      The maximum number of items to return with this call. The default value is 50 and the maximum value is 100.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Tags — (Array<map>)

        One or more tags.

        • ResourceId — (String)

          The name of the group.

        • ResourceType — (String)

          The type of resource. The only supported value is auto-scaling-group.

        • Key — (String)

          The tag key.

        • Value — (String)

          The tag value.

        • PropagateAtLaunch — (Boolean)

          Determines whether the tag is added to new instances as they are launched in the group.

      • NextToken — (String)

        The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeTerminationPolicyTypes(params = {}, callback) ⇒ AWS.Request

Describes the termination policies supported by Auto Scaling.

Service Reference:

Examples:

To describe termination policy types


/* This example describes the available termination policy types. */

 var params = {};
 autoscaling.describeTerminationPolicyTypes(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    TerminationPolicyTypes: [
       "ClosestToNextInstanceHour", 
       "Default", 
       "NewestInstance", 
       "OldestInstance", 
       "OldestLaunchConfiguration"
    ]
   }
   */
 });

Calling the describeTerminationPolicyTypes operation

autoscaling.describeTerminationPolicyTypes(function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • TerminationPolicyTypes — (Array<String>)

        The termination policies supported by Auto Scaling (OldestInstance, OldestLaunchConfiguration, NewestInstance, ClosestToNextInstanceHour, and Default).

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

detachInstances(params = {}, callback) ⇒ AWS.Request

Removes one or more instances from the specified Auto Scaling group.

After the instances are detached, you can manage them independent of the Auto Scaling group.

If you do not specify the option to decrement the desired capacity, Auto Scaling launches instances to replace the ones that are detached.

If there is a Classic Load Balancer attached to the Auto Scaling group, the instances are deregistered from the load balancer. If there are target groups attached to the Auto Scaling group, the instances are deregistered from the target groups.

For more information, see Detach EC2 Instances from Your Auto Scaling Group in the Auto Scaling User Guide.

Service Reference:

Examples:

To detach an instance from an Auto Scaling group


/* This example detaches the specified instance from the specified Auto Scaling group. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group", 
  InstanceIds: [
     "i-93633f9b"
  ], 
  ShouldDecrementDesiredCapacity: true
 };
 autoscaling.detachInstances(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Activities: [
       {
      ActivityId: "5091cb52-547a-47ce-a236-c9ccbc2cb2c9", 
      AutoScalingGroupName: "my-auto-scaling-group", 
      Cause: "At 2015-04-12T15:02:16Z instance i-93633f9b was detached in response to a user request, shrinking the capacity from 2 to 1.", 
      Description: "Detaching EC2 instance: i-93633f9b", 
      Details: "details", 
      Progress: 50, 
      StartTime: <Date Representation>, 
      StatusCode: "InProgress"
     }
    ]
   }
   */
 });

Calling the detachInstances operation

var params = {
  AutoScalingGroupName: 'STRING_VALUE', /* required */
  ShouldDecrementDesiredCapacity: true || false, /* required */
  InstanceIds: [
    'STRING_VALUE',
    /* more items */
  ]
};
autoscaling.detachInstances(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • InstanceIds — (Array<String>)

      One or more instance IDs.

    • AutoScalingGroupName — (String)

      The name of the group.

    • ShouldDecrementDesiredCapacity — (Boolean)

      If True, the Auto Scaling group decrements the desired capacity value by the number of instances detached.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Activities — (Array<map>)

        The activities related to detaching the instances from the Auto Scaling group.

        • ActivityIdrequired — (String)

          The ID of the activity.

        • AutoScalingGroupNamerequired — (String)

          The name of the Auto Scaling group.

        • Description — (String)

          A friendly, more verbose description of the activity.

        • Causerequired — (String)

          The reason the activity began.

        • StartTimerequired — (Date)

          The start time of the activity.

        • EndTime — (Date)

          The end time of the activity.

        • StatusCoderequired — (String)

          The current status of the activity.

          Possible values include:
          • "PendingSpotBidPlacement"
          • "WaitingForSpotInstanceRequestId"
          • "WaitingForSpotInstanceId"
          • "WaitingForInstanceId"
          • "PreInService"
          • "InProgress"
          • "WaitingForELBConnectionDraining"
          • "MidLifecycleAction"
          • "WaitingForInstanceWarmup"
          • "Successful"
          • "Failed"
          • "Cancelled"
        • StatusMessage — (String)

          A friendly, more verbose description of the activity status.

        • Progress — (Integer)

          A value between 0 and 100 that indicates the progress of the activity.

        • Details — (String)

          The details about the activity.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

detachLoadBalancers(params = {}, callback) ⇒ AWS.Request

Detaches one or more Classic Load Balancers from the specified Auto Scaling group.

Note that this operation detaches only Classic Load Balancers. If you have Application Load Balancers, use DetachLoadBalancerTargetGroups instead.

When you detach a load balancer, it enters the Removing state while deregistering the instances in the group. When all instances are deregistered, then you can no longer describe the load balancer using DescribeLoadBalancers. Note that the instances remain running.

Service Reference:

Examples:

To detach a load balancer from an Auto Scaling group


/* This example detaches the specified load balancer from the specified Auto Scaling group. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group", 
  LoadBalancerNames: [
     "my-load-balancer"
  ]
 };
 autoscaling.detachLoadBalancers(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
   }
   */
 });

Calling the detachLoadBalancers operation

var params = {
  AutoScalingGroupName: 'STRING_VALUE', /* required */
  LoadBalancerNames: [ /* required */
    'STRING_VALUE',
    /* more items */
  ]
};
autoscaling.detachLoadBalancers(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AutoScalingGroupName — (String)

      The name of the Auto Scaling group.

    • LoadBalancerNames — (Array<String>)

      One or more load balancer names.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

detachLoadBalancerTargetGroups(params = {}, callback) ⇒ AWS.Request

Detaches one or more target groups from the specified Auto Scaling group.

Service Reference:

Examples:

To detach a target group from an Auto Scaling group


/* This example detaches the specified target group from the specified Auto Scaling group */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group", 
  TargetGroupARNs: [
     "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067"
  ]
 };
 autoscaling.detachLoadBalancerTargetGroups(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
   }
   */
 });

Calling the detachLoadBalancerTargetGroups operation

var params = {
  AutoScalingGroupName: 'STRING_VALUE', /* required */
  TargetGroupARNs: [ /* required */
    'STRING_VALUE',
    /* more items */
  ]
};
autoscaling.detachLoadBalancerTargetGroups(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AutoScalingGroupName — (String)

      The name of the Auto Scaling group.

    • TargetGroupARNs — (Array<String>)

      The Amazon Resource Names (ARN) of the target groups.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

disableMetricsCollection(params = {}, callback) ⇒ AWS.Request

Disables group metrics for the specified Auto Scaling group.

Service Reference:

Examples:

To disable metrics collection for an Auto Scaling group


/* This example disables collecting data for the GroupDesiredCapacity metric for the specified Auto Scaling group. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group", 
  Metrics: [
     "GroupDesiredCapacity"
  ]
 };
 autoscaling.disableMetricsCollection(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the disableMetricsCollection operation

var params = {
  AutoScalingGroupName: 'STRING_VALUE', /* required */
  Metrics: [
    'STRING_VALUE',
    /* more items */
  ]
};
autoscaling.disableMetricsCollection(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AutoScalingGroupName — (String)

      The name or Amazon Resource Name (ARN) of the group.

    • Metrics — (Array<String>)

      One or more of the following metrics. If you omit this parameter, all metrics are disabled.

      • GroupMinSize

      • GroupMaxSize

      • GroupDesiredCapacity

      • GroupInServiceInstances

      • GroupPendingInstances

      • GroupStandbyInstances

      • GroupTerminatingInstances

      • GroupTotalInstances

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

enableMetricsCollection(params = {}, callback) ⇒ AWS.Request

Enables group metrics for the specified Auto Scaling group. For more information, see Monitoring Your Auto Scaling Groups and Instances in the Auto Scaling User Guide.

Service Reference:

Examples:

To enable metrics collection for an Auto Scaling group


/* This example enables data collection for the specified Auto Scaling group. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group", 
  Granularity: "1Minute"
 };
 autoscaling.enableMetricsCollection(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the enableMetricsCollection operation

var params = {
  AutoScalingGroupName: 'STRING_VALUE', /* required */
  Granularity: 'STRING_VALUE', /* required */
  Metrics: [
    'STRING_VALUE',
    /* more items */
  ]
};
autoscaling.enableMetricsCollection(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AutoScalingGroupName — (String)

      The name or ARN of the Auto Scaling group.

    • Metrics — (Array<String>)

      One or more of the following metrics. If you omit this parameter, all metrics are enabled.

      • GroupMinSize

      • GroupMaxSize

      • GroupDesiredCapacity

      • GroupInServiceInstances

      • GroupPendingInstances

      • GroupStandbyInstances

      • GroupTerminatingInstances

      • GroupTotalInstances

    • Granularity — (String)

      The granularity to associate with the metrics to collect. The only valid value is 1Minute.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

enterStandby(params = {}, callback) ⇒ AWS.Request

Moves the specified instances into the standby state.

For more information, see Temporarily Removing Instances from Your Auto Scaling Group in the Auto Scaling User Guide.

Service Reference:

Examples:

To move instances into standby mode


/* This example puts the specified instance into standby mode. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group", 
  InstanceIds: [
     "i-93633f9b"
  ], 
  ShouldDecrementDesiredCapacity: true
 };
 autoscaling.enterStandby(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Activities: [
       {
      ActivityId: "ffa056b4-6ed3-41ba-ae7c-249dfae6eba1", 
      AutoScalingGroupName: "my-auto-scaling-group", 
      Cause: "At 2015-04-12T15:10:23Z instance i-93633f9b was moved to standby in response to a user request, shrinking the capacity from 2 to 1.", 
      Description: "Moving EC2 instance to Standby: i-93633f9b", 
      Details: "details", 
      Progress: 50, 
      StartTime: <Date Representation>, 
      StatusCode: "InProgress"
     }
    ]
   }
   */
 });

Calling the enterStandby operation

var params = {
  AutoScalingGroupName: 'STRING_VALUE', /* required */
  ShouldDecrementDesiredCapacity: true || false, /* required */
  InstanceIds: [
    'STRING_VALUE',
    /* more items */
  ]
};
autoscaling.enterStandby(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • InstanceIds — (Array<String>)

      One or more instances to move into Standby mode. You must specify at least one instance ID.

    • AutoScalingGroupName — (String)

      The name of the Auto Scaling group.

    • ShouldDecrementDesiredCapacity — (Boolean)

      Specifies whether the instances moved to Standby mode count as part of the Auto Scaling group's desired capacity. If set, the desired capacity for the Auto Scaling group decrements by the number of instances moved to Standby mode.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Activities — (Array<map>)

        The activities related to moving instances into Standby mode.

        • ActivityIdrequired — (String)

          The ID of the activity.

        • AutoScalingGroupNamerequired — (String)

          The name of the Auto Scaling group.

        • Description — (String)

          A friendly, more verbose description of the activity.

        • Causerequired — (String)

          The reason the activity began.

        • StartTimerequired — (Date)

          The start time of the activity.

        • EndTime — (Date)

          The end time of the activity.

        • StatusCoderequired — (String)

          The current status of the activity.

          Possible values include:
          • "PendingSpotBidPlacement"
          • "WaitingForSpotInstanceRequestId"
          • "WaitingForSpotInstanceId"
          • "WaitingForInstanceId"
          • "PreInService"
          • "InProgress"
          • "WaitingForELBConnectionDraining"
          • "MidLifecycleAction"
          • "WaitingForInstanceWarmup"
          • "Successful"
          • "Failed"
          • "Cancelled"
        • StatusMessage — (String)

          A friendly, more verbose description of the activity status.

        • Progress — (Integer)

          A value between 0 and 100 that indicates the progress of the activity.

        • Details — (String)

          The details about the activity.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

executePolicy(params = {}, callback) ⇒ AWS.Request

Executes the specified policy.

Service Reference:

Examples:

To execute an Auto Scaling policy


/* This example executes the specified Auto Scaling policy for the specified Auto Scaling group. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group", 
  HonorCooldown: true, 
  PolicyName: "ScaleIn"
 };
 autoscaling.executePolicy(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the executePolicy operation

var params = {
  PolicyName: 'STRING_VALUE', /* required */
  AutoScalingGroupName: 'STRING_VALUE',
  BreachThreshold: 0.0,
  HonorCooldown: true || false,
  MetricValue: 0.0
};
autoscaling.executePolicy(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AutoScalingGroupName — (String)

      The name or Amazon Resource Name (ARN) of the Auto Scaling group.

    • PolicyName — (String)

      The name or ARN of the policy.

    • HonorCooldown — (Boolean)

      If this parameter is true, Auto Scaling waits for the cooldown period to complete before executing the policy. Otherwise, Auto Scaling executes the policy without waiting for the cooldown period to complete.

      This parameter is not supported if the policy type is StepScaling.

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

    • MetricValue — (Float)

      The metric value to compare to BreachThreshold. This enables you to execute a policy of type StepScaling and determine which step adjustment to use. For example, if the breach threshold is 50 and you want to use a step adjustment with a lower bound of 0 and an upper bound of 10, you can set the metric value to 59.

      If you specify a metric value that doesn't correspond to a step adjustment for the policy, the call returns an error.

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

    • BreachThreshold — (Float)

      The breach threshold for the alarm.

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

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

exitStandby(params = {}, callback) ⇒ AWS.Request

Moves the specified instances out of the standby state.

For more information, see Temporarily Removing Instances from Your Auto Scaling Group in the Auto Scaling User Guide.

Service Reference:

Examples:

To move instances out of standby mode


/* This example moves the specified instance out of standby mode. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group", 
  InstanceIds: [
     "i-93633f9b"
  ]
 };
 autoscaling.exitStandby(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Activities: [
       {
      ActivityId: "142928e1-a2dc-453a-9b24-b85ad6735928", 
      AutoScalingGroupName: "my-auto-scaling-group", 
      Cause: "At 2015-04-12T15:14:29Z instance i-93633f9b was moved out of standby in response to a user request, increasing the capacity from 1 to 2.", 
      Description: "Moving EC2 instance out of Standby: i-93633f9b", 
      Details: "details", 
      Progress: 30, 
      StartTime: <Date Representation>, 
      StatusCode: "PreInService"
     }
    ]
   }
   */
 });

Calling the exitStandby operation

var params = {
  AutoScalingGroupName: 'STRING_VALUE', /* required */
  InstanceIds: [
    'STRING_VALUE',
    /* more items */
  ]
};
autoscaling.exitStandby(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • InstanceIds — (Array<String>)

      One or more instance IDs. You must specify at least one instance ID.

    • AutoScalingGroupName — (String)

      The name of the Auto Scaling group.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Activities — (Array<map>)

        The activities related to moving instances out of Standby mode.

        • ActivityIdrequired — (String)

          The ID of the activity.

        • AutoScalingGroupNamerequired — (String)

          The name of the Auto Scaling group.

        • Description — (String)

          A friendly, more verbose description of the activity.

        • Causerequired — (String)

          The reason the activity began.

        • StartTimerequired — (Date)

          The start time of the activity.

        • EndTime — (Date)

          The end time of the activity.

        • StatusCoderequired — (String)

          The current status of the activity.

          Possible values include:
          • "PendingSpotBidPlacement"
          • "WaitingForSpotInstanceRequestId"
          • "WaitingForSpotInstanceId"
          • "WaitingForInstanceId"
          • "PreInService"
          • "InProgress"
          • "WaitingForELBConnectionDraining"
          • "MidLifecycleAction"
          • "WaitingForInstanceWarmup"
          • "Successful"
          • "Failed"
          • "Cancelled"
        • StatusMessage — (String)

          A friendly, more verbose description of the activity status.

        • Progress — (Integer)

          A value between 0 and 100 that indicates the progress of the activity.

        • Details — (String)

          The details about the activity.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

putLifecycleHook(params = {}, callback) ⇒ AWS.Request

Creates or updates a lifecycle hook for the specified Auto Scaling Group.

A lifecycle hook tells Auto Scaling that you want to perform an action on an instance that is not actively in service; for example, either when the instance launches or before the instance terminates.

This step is a part of the procedure for adding a lifecycle hook to an Auto Scaling group:

  1. (Optional) Create a Lambda function and a rule that allows CloudWatch Events to invoke your Lambda function when Auto Scaling launches or terminates instances.

  2. (Optional) Create a notification target and an IAM role. The target can be either an Amazon SQS queue or an Amazon SNS topic. The role allows Auto Scaling to publish lifecycle notifications to the target.

  3. Create the lifecycle hook. Specify whether the hook is used when the instances launch or terminate.

  4. If you need more time, record the lifecycle action heartbeat to keep the instance in a pending state.

  5. If you finish before the timeout period ends, complete the lifecycle action.

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

If you exceed your maximum limit of lifecycle hooks, which by default is 50 per Auto Scaling group, the call fails. For information about updating this limit, see AWS Service Limits in the Amazon Web Services General Reference.

Service Reference:

Examples:

To create a lifecycle hook


/* This example creates a lifecycle hook. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group", 
  LifecycleHookName: "my-lifecycle-hook", 
  LifecycleTransition: "autoscaling:EC2_INSTANCE_LAUNCHING", 
  NotificationTargetARN: "arn:aws:sns:us-west-2:123456789012:my-sns-topic --role-arn", 
  RoleARN: "arn:aws:iam::123456789012:role/my-auto-scaling-role"
 };
 autoscaling.putLifecycleHook(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
   }
   */
 });

Calling the putLifecycleHook operation

var params = {
  AutoScalingGroupName: 'STRING_VALUE', /* required */
  LifecycleHookName: 'STRING_VALUE', /* required */
  DefaultResult: 'STRING_VALUE',
  HeartbeatTimeout: 0,
  LifecycleTransition: 'STRING_VALUE',
  NotificationMetadata: 'STRING_VALUE',
  NotificationTargetARN: 'STRING_VALUE',
  RoleARN: 'STRING_VALUE'
};
autoscaling.putLifecycleHook(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • LifecycleHookName — (String)

      The name of the lifecycle hook.

    • AutoScalingGroupName — (String)

      The name of the Auto Scaling group to which you want to assign the lifecycle hook.

    • LifecycleTransition — (String)

      The instance state to which you want to attach the lifecycle hook. For a list of lifecycle hook types, see DescribeLifecycleHookTypes.

      This parameter is required for new lifecycle hooks, but optional when updating existing hooks.

    • RoleARN — (String)

      The ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target.

      This parameter is required for new lifecycle hooks, but optional when updating existing hooks.

    • NotificationTargetARN — (String)

      The ARN of the notification target that Auto Scaling will use to notify you when an instance is in the transition state for the lifecycle hook. This target can be either an SQS queue or an SNS topic. If you specify an empty string, this overrides the current ARN.

      This operation uses the JSON format when sending notifications to an Amazon SQS queue, and an email key/value pair format when sending notifications to an Amazon SNS topic.

      When you specify a notification target, Auto Scaling sends it a test message. Test messages contains the following additional key/value pair: "Event": "autoscaling:TEST_NOTIFICATION".

    • NotificationMetadata — (String)

      Contains additional information that you want to include any time Auto Scaling sends a message to the notification target.

    • HeartbeatTimeout — (Integer)

      The maximum time, in seconds, that can elapse before the lifecycle hook times out. The range is from 30 to 7200 seconds. The default is 3600 seconds (1 hour).

      If the lifecycle hook times out, Auto Scaling performs the default action. You can prevent the lifecycle hook from timing out by calling RecordLifecycleActionHeartbeat.

    • DefaultResult — (String)

      Defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses or if an unexpected failure occurs. This parameter can be either CONTINUE or ABANDON. The default value is ABANDON.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

putNotificationConfiguration(params = {}, callback) ⇒ AWS.Request

Configures an Auto Scaling group to send notifications when specified events take place. Subscribers to the specified topic can have messages delivered to an endpoint such as a web server or an email address.

This configuration overwrites any existing configuration.

For more information see Getting SNS Notifications When Your Auto Scaling Group Scales in the Auto Scaling User Guide.

Service Reference:

Examples:

To add an Auto Scaling notification


/* This example adds the specified notification to the specified Auto Scaling group. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group", 
  NotificationTypes: [
     "autoscaling:TEST_NOTIFICATION"
  ], 
  TopicARN: "arn:aws:sns:us-west-2:123456789012:my-sns-topic"
 };
 autoscaling.putNotificationConfiguration(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the putNotificationConfiguration operation

var params = {
  AutoScalingGroupName: 'STRING_VALUE', /* required */
  NotificationTypes: [ /* required */
    'STRING_VALUE',
    /* more items */
  ],
  TopicARN: 'STRING_VALUE' /* required */
};
autoscaling.putNotificationConfiguration(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AutoScalingGroupName — (String)

      The name of the Auto Scaling group.

    • TopicARN — (String)

      The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) topic.

    • NotificationTypes — (Array<String>)

      The type of event that will cause the notification to be sent. For details about notification types supported by Auto Scaling, see DescribeAutoScalingNotificationTypes.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

putScalingPolicy(params = {}, callback) ⇒ AWS.Request

Creates or updates a policy for an Auto Scaling group. To update an existing policy, use the existing policy name and set the parameters you want to change. Any existing parameter not changed in an update to an existing policy is not changed in this update request.

If you exceed your maximum limit of step adjustments, which by default is 20 per region, the call fails. For information about updating this limit, see AWS Service Limits in the Amazon Web Services General Reference.

Service Reference:

Examples:

To add a scaling policy to an Auto Scaling group


/* This example adds the specified policy to the specified Auto Scaling group. */

 var params = {
  AdjustmentType: "ChangeInCapacity", 
  AutoScalingGroupName: "my-auto-scaling-group", 
  PolicyName: "ScaleIn", 
  ScalingAdjustment: -1
 };
 autoscaling.putScalingPolicy(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    PolicyARN: "arn:aws:autoscaling:us-west-2:123456789012:scalingPolicy:2233f3d7-6290-403b-b632-93c553560106:autoScalingGroupName/my-auto-scaling-group:policyName/ScaleIn"
   }
   */
 });

Calling the putScalingPolicy operation

var params = {
  AutoScalingGroupName: 'STRING_VALUE', /* required */
  PolicyName: 'STRING_VALUE', /* required */
  AdjustmentType: 'STRING_VALUE',
  Cooldown: 0,
  EstimatedInstanceWarmup: 0,
  MetricAggregationType: 'STRING_VALUE',
  MinAdjustmentMagnitude: 0,
  MinAdjustmentStep: 0,
  PolicyType: 'STRING_VALUE',
  ScalingAdjustment: 0,
  StepAdjustments: [
    {
      ScalingAdjustment: 0, /* required */
      MetricIntervalLowerBound: 0.0,
      MetricIntervalUpperBound: 0.0
    },
    /* more items */
  ],
  TargetTrackingConfiguration: {
    TargetValue: 0.0, /* required */
    CustomizedMetricSpecification: {
      MetricName: 'STRING_VALUE', /* required */
      Namespace: 'STRING_VALUE', /* required */
      Statistic: Average | Minimum | Maximum | SampleCount | Sum, /* required */
      Dimensions: [
        {
          Name: 'STRING_VALUE', /* required */
          Value: 'STRING_VALUE' /* required */
        },
        /* more items */
      ],
      Unit: 'STRING_VALUE'
    },
    DisableScaleIn: true || false,
    PredefinedMetricSpecification: {
      PredefinedMetricType: ASGAverageCPUUtilization | ASGAverageNetworkIn | ASGAverageNetworkOut | ALBRequestCountPerTarget, /* required */
      ResourceLabel: 'STRING_VALUE'
    }
  }
};
autoscaling.putScalingPolicy(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AutoScalingGroupName — (String)

      The name or ARN of the group.

    • PolicyName — (String)

      The name of the policy.

    • PolicyType — (String)

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

    • AdjustmentType — (String)

      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.

    • MinAdjustmentStep — (Integer)

      Available for backward compatibility. Use MinAdjustmentMagnitude instead.

    • MinAdjustmentMagnitude — (Integer)

      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.

    • ScalingAdjustment — (Integer)

      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.

    • Cooldown — (Integer)

      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.

    • MetricAggregationType — (String)

      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.

    • StepAdjustments — (Array<map>)

      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.

      • MetricIntervalLowerBound — (Float)

        The lower bound for the difference between the alarm threshold and the CloudWatch metric. If the metric value is above the breach threshold, the lower bound is inclusive (the metric must be greater than or equal to the threshold plus the lower bound). Otherwise, it is exclusive (the metric must be greater than the threshold plus the lower bound). A null value indicates negative infinity.

      • MetricIntervalUpperBound — (Float)

        The upper bound for the difference between the alarm threshold and the CloudWatch metric. If the metric value is above the breach threshold, the upper bound is exclusive (the metric must be less than the threshold plus the upper bound). Otherwise, it is inclusive (the metric must be less than or equal to the threshold plus the upper bound). A null value indicates positive infinity.

        The upper bound must be greater than the lower bound.

      • ScalingAdjustmentrequired — (Integer)

        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.

    • EstimatedInstanceWarmup — (Integer)

      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.

    • TargetTrackingConfiguration — (map)

      A target tracking policy.

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

      • PredefinedMetricSpecification — (map)

        A predefined metric. You can specify either a predefined metric or a customized metric.

        • PredefinedMetricTyperequired — (String)

          The metric type.

          Possible values include:
          • "ASGAverageCPUUtilization"
          • "ASGAverageNetworkIn"
          • "ASGAverageNetworkOut"
          • "ALBRequestCountPerTarget"
        • ResourceLabel — (String)

          Identifies the resource associated with the metric type. The following predefined metrics are available:

          • ASGAverageCPUUtilization - average CPU utilization of the Auto Scaling group

          • ASGAverageNetworkIn - average number of bytes received on all network interfaces by the Auto Scaling group

          • ASGAverageNetworkOut - average number of bytes sent out on all network interfaces by the Auto Scaling group

          • ALBRequestCountPerTarget - number of requests completed per target in an Application Load Balancer target group

          For predefined metric types ASGAverageCPUUtilization, ASGAverageNetworkIn and ASGAverageNetworkOut, the parameter must not be specified as the resource associated with the metric type is the Auto Scaling group. For predefined metric type ALBRequestCountPerTarget, the parameter must be specified in the format: app/load-balancer-name/load-balancer-id/targetgroup/target-group-name/target-group-id , where app/load-balancer-name/load-balancer-id is the final portion of the load balancer ARN, and targetgroup/target-group-name/target-group-id is the final portion of the target group ARN. The target group must be attached to the Auto Scaling group.

      • CustomizedMetricSpecification — (map)

        A customized metric.

        • MetricNamerequired — (String)

          The name of the metric.

        • Namespacerequired — (String)

          The namespace of the metric.

        • Dimensions — (Array<map>)

          The dimensions of the metric.

          • Namerequired — (String)

            The name of the dimension.

          • Valuerequired — (String)

            The value of the dimension.

        • Statisticrequired — (String)

          The statistic of the metric.

          Possible values include:
          • "Average"
          • "Minimum"
          • "Maximum"
          • "SampleCount"
          • "Sum"
        • Unit — (String)

          The unit of the metric.

      • TargetValuerequired — (Float)

        The target value for the metric.

      • DisableScaleIn — (Boolean)

        Indicates whether scale in by the target tracking policy is disabled. If the value is true, scale in is disabled and the target tracking policy won't remove instances from the Auto Scaling group. Otherwise, scale in is enabled and the target tracking policy can remove instances from the Auto Scaling group. The default value is false.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • PolicyARN — (String)

        The Amazon Resource Name (ARN) of the policy.

      • Alarms — (Array<map>)

        The CloudWatch alarms created for the target tracking policy.

        • AlarmName — (String)

          The name of the alarm.

        • AlarmARN — (String)

          The Amazon Resource Name (ARN) of the alarm.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

putScheduledUpdateGroupAction(params = {}, callback) ⇒ AWS.Request

Creates or updates a scheduled scaling action for an Auto Scaling group. When updating a scheduled scaling action, if you leave a parameter unspecified, the corresponding value remains unchanged.

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

Service Reference:

Examples:

To add a scheduled action to an Auto Scaling group


/* This example adds the specified scheduled action to the specified Auto Scaling group. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group", 
  DesiredCapacity: 4, 
  EndTime: <Date Representation>, 
  MaxSize: 6, 
  MinSize: 2, 
  ScheduledActionName: "my-scheduled-action", 
  StartTime: <Date Representation>
 };
 autoscaling.putScheduledUpdateGroupAction(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the putScheduledUpdateGroupAction operation

var params = {
  AutoScalingGroupName: 'STRING_VALUE', /* required */
  ScheduledActionName: 'STRING_VALUE', /* required */
  DesiredCapacity: 0,
  EndTime: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
  MaxSize: 0,
  MinSize: 0,
  Recurrence: 'STRING_VALUE',
  StartTime: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
  Time: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789
};
autoscaling.putScheduledUpdateGroupAction(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AutoScalingGroupName — (String)

      The name or Amazon Resource Name (ARN) of the Auto Scaling group.

    • ScheduledActionName — (String)

      The name of this scaling action.

    • Time — (Date)

      This parameter is deprecated.

    • StartTime — (Date)

      The time for this action to start, in "YYYY-MM-DDThh:mm:ssZ" format in UTC/GMT only (for example, 2014-06-01T00:00:00Z).

      If you specify Recurrence and StartTime, Auto Scaling performs the action at this time, and then performs the action based on the specified recurrence.

      If you try to schedule your action in the past, Auto Scaling returns an error message.

    • EndTime — (Date)

      The time for the recurring schedule to end. Auto Scaling does not perform the action after this time.

    • Recurrence — (String)

      The recurring schedule for this action, in Unix cron syntax format. For more information, see Cron in Wikipedia.

    • MinSize — (Integer)

      The minimum size for the Auto Scaling group.

    • MaxSize — (Integer)

      The maximum size for the Auto Scaling group.

    • DesiredCapacity — (Integer)

      The number of EC2 instances that should be running in the group.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

recordLifecycleActionHeartbeat(params = {}, callback) ⇒ AWS.Request

Records a heartbeat for the lifecycle action associated with the specified token or instance. This extends the timeout by the length of time defined using PutLifecycleHook.

This step is a part of the procedure for adding a lifecycle hook to an Auto Scaling group:

  1. (Optional) Create a Lambda function and a rule that allows CloudWatch Events to invoke your Lambda function when Auto Scaling launches or terminates instances.

  2. (Optional) Create a notification target and an IAM role. The target can be either an Amazon SQS queue or an Amazon SNS topic. The role allows Auto Scaling to publish lifecycle notifications to the target.

  3. Create the lifecycle hook. Specify whether the hook is used when the instances launch or terminate.

  4. If you need more time, record the lifecycle action heartbeat to keep the instance in a pending state.

  5. If you finish before the timeout period ends, complete the lifecycle action.

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

Service Reference:

Examples:

To record a lifecycle action heartbeat


/* This example records a lifecycle action heartbeat to keep the instance in a pending state. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group", 
  LifecycleActionToken: "bcd2f1b8-9a78-44d3-8a7a-4dd07d7cf635", 
  LifecycleHookName: "my-lifecycle-hook"
 };
 autoscaling.recordLifecycleActionHeartbeat(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
   }
   */
 });

Calling the recordLifecycleActionHeartbeat operation

var params = {
  AutoScalingGroupName: 'STRING_VALUE', /* required */
  LifecycleHookName: 'STRING_VALUE', /* required */
  InstanceId: 'STRING_VALUE',
  LifecycleActionToken: 'STRING_VALUE'
};
autoscaling.recordLifecycleActionHeartbeat(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • LifecycleHookName — (String)

      The name of the lifecycle hook.

    • AutoScalingGroupName — (String)

      The name of the Auto Scaling group for the hook.

    • LifecycleActionToken — (String)

      A token that uniquely identifies a specific lifecycle action associated with an instance. Auto Scaling sends this token to the notification target you specified when you created the lifecycle hook.

    • InstanceId — (String)

      The ID of the instance.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

resumeProcesses(params = {}, callback) ⇒ AWS.Request

Resumes the specified suspended Auto Scaling processes, or all suspended process, for the specified Auto Scaling group.

For more information, see Suspending and Resuming Auto Scaling Processes in the Auto Scaling User Guide.

Service Reference:

Examples:

To resume Auto Scaling processes


/* This example resumes the specified suspended scaling process for the specified Auto Scaling group. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group", 
  ScalingProcesses: [
     "AlarmNotification"
  ]
 };
 autoscaling.resumeProcesses(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the resumeProcesses operation

var params = {
  AutoScalingGroupName: 'STRING_VALUE', /* required */
  ScalingProcesses: [
    'STRING_VALUE',
    /* more items */
  ]
};
autoscaling.resumeProcesses(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AutoScalingGroupName — (String)

      The name or Amazon Resource Name (ARN) of the Auto Scaling group.

    • ScalingProcesses — (Array<String>)

      One or more of the following processes. If you omit this parameter, all processes are specified.

      • Launch

      • Terminate

      • HealthCheck

      • ReplaceUnhealthy

      • AZRebalance

      • AlarmNotification

      • ScheduledActions

      • AddToLoadBalancer

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

setDesiredCapacity(params = {}, callback) ⇒ AWS.Request

Sets the size of the specified Auto Scaling group.

For more information about desired capacity, see What Is Auto Scaling? in the Auto Scaling User Guide.

Service Reference:

Examples:

To set the desired capacity for an Auto Scaling group


/* This example sets the desired capacity for the specified Auto Scaling group. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group", 
  DesiredCapacity: 2, 
  HonorCooldown: true
 };
 autoscaling.setDesiredCapacity(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the setDesiredCapacity operation

var params = {
  AutoScalingGroupName: 'STRING_VALUE', /* required */
  DesiredCapacity: 0, /* required */
  HonorCooldown: true || false
};
autoscaling.setDesiredCapacity(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AutoScalingGroupName — (String)

      The name of the Auto Scaling group.

    • DesiredCapacity — (Integer)

      The number of EC2 instances that should be running in the Auto Scaling group.

    • HonorCooldown — (Boolean)

      By default, SetDesiredCapacity overrides any cooldown period associated with the Auto Scaling group. Specify True to make Auto Scaling to wait for the cool-down period associated with the Auto Scaling group to complete before initiating a scaling activity to set your Auto Scaling group to its new capacity.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

setInstanceHealth(params = {}, callback) ⇒ AWS.Request

Sets the health status of the specified instance.

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

Service Reference:

Examples:

To set the health status of an instance


/* This example sets the health status of the specified instance to Unhealthy. */

 var params = {
  HealthStatus: "Unhealthy", 
  InstanceId: "i-93633f9b"
 };
 autoscaling.setInstanceHealth(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the setInstanceHealth operation

var params = {
  HealthStatus: 'STRING_VALUE', /* required */
  InstanceId: 'STRING_VALUE', /* required */
  ShouldRespectGracePeriod: true || false
};
autoscaling.setInstanceHealth(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • InstanceId — (String)

      The ID of the instance.

    • HealthStatus — (String)

      The health status of the instance. Set to Healthy if you want the instance to remain in service. Set to Unhealthy if you want the instance to be out of service. Auto Scaling will terminate and replace the unhealthy instance.

    • ShouldRespectGracePeriod — (Boolean)

      If the Auto Scaling group of the specified instance has a HealthCheckGracePeriod specified for the group, by default, this call will respect the grace period. Set this to False, if you do not want the call to respect the grace period associated with the group.

      For more information, see the description of the health check grace period for CreateAutoScalingGroup.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

setInstanceProtection(params = {}, callback) ⇒ AWS.Request

Updates the instance protection settings of the specified instances.

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

Service Reference:

Examples:

To enable instance protection for an instance


/* This example enables instance protection for the specified instance. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group", 
  InstanceIds: [
     "i-93633f9b"
  ], 
  ProtectedFromScaleIn: true
 };
 autoscaling.setInstanceProtection(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
   }
   */
 });

To disable instance protection for an instance


/* This example disables instance protection for the specified instance. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group", 
  InstanceIds: [
     "i-93633f9b"
  ], 
  ProtectedFromScaleIn: false
 };
 autoscaling.setInstanceProtection(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
   }
   */
 });

Calling the setInstanceProtection operation

var params = {
  AutoScalingGroupName: 'STRING_VALUE', /* required */
  InstanceIds: [ /* required */
    'STRING_VALUE',
    /* more items */
  ],
  ProtectedFromScaleIn: true || false /* required */
};
autoscaling.setInstanceProtection(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • InstanceIds — (Array<String>)

      One or more instance IDs.

    • AutoScalingGroupName — (String)

      The name of the group.

    • ProtectedFromScaleIn — (Boolean)

      Indicates whether the instance is protected from termination by Auto Scaling when scaling in.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

suspendProcesses(params = {}, callback) ⇒ AWS.Request

Suspends the specified Auto Scaling processes, or all processes, for the specified Auto Scaling group.

Note that if you suspend either the Launch or Terminate process types, it can prevent other process types from functioning properly.

To resume processes that have been suspended, use ResumeProcesses.

For more information, see Suspending and Resuming Auto Scaling Processes in the Auto Scaling User Guide.

Service Reference:

Examples:

To suspend Auto Scaling processes


/* This example suspends the specified scaling process for the specified Auto Scaling group. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group", 
  ScalingProcesses: [
     "AlarmNotification"
  ]
 };
 autoscaling.suspendProcesses(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the suspendProcesses operation

var params = {
  AutoScalingGroupName: 'STRING_VALUE', /* required */
  ScalingProcesses: [
    'STRING_VALUE',
    /* more items */
  ]
};
autoscaling.suspendProcesses(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AutoScalingGroupName — (String)

      The name or Amazon Resource Name (ARN) of the Auto Scaling group.

    • ScalingProcesses — (Array<String>)

      One or more of the following processes. If you omit this parameter, all processes are specified.

      • Launch

      • Terminate

      • HealthCheck

      • ReplaceUnhealthy

      • AZRebalance

      • AlarmNotification

      • ScheduledActions

      • AddToLoadBalancer

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

terminateInstanceInAutoScalingGroup(params = {}, callback) ⇒ AWS.Request

Terminates the specified instance and optionally adjusts the desired group size.

This call simply makes a termination request. The instance is not terminated immediately.

Examples:

To terminate an instance in an Auto Scaling group


/* This example terminates the specified instance from the specified Auto Scaling group without updating the size of the group. Auto Scaling launches a replacement instance after the specified instance terminates. */

 var params = {
  InstanceId: "i-93633f9b", 
  ShouldDecrementDesiredCapacity: false
 };
 autoscaling.terminateInstanceInAutoScalingGroup(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
   }
   */
 });

Calling the terminateInstanceInAutoScalingGroup operation

var params = {
  InstanceId: 'STRING_VALUE', /* required */
  ShouldDecrementDesiredCapacity: true || false /* required */
};
autoscaling.terminateInstanceInAutoScalingGroup(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • InstanceId — (String)

      The ID of the instance.

    • ShouldDecrementDesiredCapacity — (Boolean)

      If true, terminating the instance also decrements the size of the Auto Scaling group.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Activity — (map)

        A scaling activity.

        • ActivityIdrequired — (String)

          The ID of the activity.

        • AutoScalingGroupNamerequired — (String)

          The name of the Auto Scaling group.

        • Description — (String)

          A friendly, more verbose description of the activity.

        • Causerequired — (String)

          The reason the activity began.

        • StartTimerequired — (Date)

          The start time of the activity.

        • EndTime — (Date)

          The end time of the activity.

        • StatusCoderequired — (String)

          The current status of the activity.

          Possible values include:
          • "PendingSpotBidPlacement"
          • "WaitingForSpotInstanceRequestId"
          • "WaitingForSpotInstanceId"
          • "WaitingForInstanceId"
          • "PreInService"
          • "InProgress"
          • "WaitingForELBConnectionDraining"
          • "MidLifecycleAction"
          • "WaitingForInstanceWarmup"
          • "Successful"
          • "Failed"
          • "Cancelled"
        • StatusMessage — (String)

          A friendly, more verbose description of the activity status.

        • Progress — (Integer)

          A value between 0 and 100 that indicates the progress of the activity.

        • Details — (String)

          The details about the activity.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateAutoScalingGroup(params = {}, callback) ⇒ AWS.Request

Updates the configuration for the specified Auto Scaling group.

The new settings take effect on any scaling activities after this call returns. Scaling activities that are currently in progress aren't affected.

To update an Auto Scaling group with a launch configuration with InstanceMonitoring set to false, you must first disable the collection of group metrics. Otherwise, you will get an error. If you have previously enabled the collection of group metrics, you can disable it using DisableMetricsCollection.

Note the following:

  • If you specify a new value for MinSize without specifying a value for DesiredCapacity, and the new MinSize is larger than the current size of the group, we implicitly call SetDesiredCapacity to set the size of the group to the new value of MinSize.

  • If you specify a new value for MaxSize without specifying a value for DesiredCapacity, and the new MaxSize is smaller than the current size of the group, we implicitly call SetDesiredCapacity to set the size of the group to the new value of MaxSize.

  • All other optional parameters are left unchanged if not specified.

Service Reference:

Examples:

To update the launch configuration


/* This example updates the launch configuration of the specified Auto Scaling group. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group", 
  LaunchConfigurationName: "new-launch-config"
 };
 autoscaling.updateAutoScalingGroup(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

To update the minimum and maximum size


/* This example updates the minimum size and maximum size of the specified Auto Scaling group. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group", 
  MaxSize: 3, 
  MinSize: 1
 };
 autoscaling.updateAutoScalingGroup(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

To enable instance protection


/* This example enables instance protection for the specified Auto Scaling group. */

 var params = {
  AutoScalingGroupName: "my-auto-scaling-group", 
  NewInstancesProtectedFromScaleIn: true
 };
 autoscaling.updateAutoScalingGroup(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the updateAutoScalingGroup operation

var params = {
  AutoScalingGroupName: 'STRING_VALUE', /* required */
  AvailabilityZones: [
    'STRING_VALUE',
    /* more items */
  ],
  DefaultCooldown: 0,
  DesiredCapacity: 0,
  HealthCheckGracePeriod: 0,
  HealthCheckType: 'STRING_VALUE',
  LaunchConfigurationName: 'STRING_VALUE',
  MaxSize: 0,
  MinSize: 0,
  NewInstancesProtectedFromScaleIn: true || false,
  PlacementGroup: 'STRING_VALUE',
  TerminationPolicies: [
    'STRING_VALUE',
    /* more items */
  ],
  VPCZoneIdentifier: 'STRING_VALUE'
};
autoscaling.updateAutoScalingGroup(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AutoScalingGroupName — (String)

      The name of the Auto Scaling group.

    • LaunchConfigurationName — (String)

      The name of the launch configuration.

    • MinSize — (Integer)

      The minimum size of the Auto Scaling group.

    • MaxSize — (Integer)

      The maximum size of the Auto Scaling group.

    • DesiredCapacity — (Integer)

      The number of EC2 instances that should be running in the Auto Scaling group. This number must be greater than or equal to the minimum size of the group and less than or equal to the maximum size of the group.

    • DefaultCooldown — (Integer)

      The amount of time, in seconds, after a scaling activity completes before another scaling activity can start. The default is 300.

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

    • AvailabilityZones — (Array<String>)

      One or more Availability Zones for the group.

    • HealthCheckType — (String)

      The service to use for the health checks. The valid values are EC2 and ELB.

    • HealthCheckGracePeriod — (Integer)

      The amount of time, in seconds, that Auto Scaling waits before checking the health status of an EC2 instance that has come into service. The default is 0.

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

    • PlacementGroup — (String)

      The name of the placement group into which you'll launch your instances, if any. For more information, see Placement Groups in the Amazon Elastic Compute Cloud User Guide.

    • VPCZoneIdentifier — (String)

      The ID of the subnet, if you are launching into a VPC. You can specify several subnets in a comma-separated list.

      When you specify VPCZoneIdentifier with AvailabilityZones, ensure that the subnets' Availability Zones match the values you specify for AvailabilityZones.

      For more information, see Launching Auto Scaling Instances in a VPC in the Auto Scaling User Guide.

    • TerminationPolicies — (Array<String>)

      A standalone termination policy or a list of termination policies used to select the instance to terminate. The policies are executed in the order that they are listed.

      For more information, see Controlling Which Instances Auto Scaling Terminates During Scale In in the Auto Scaling User Guide.

    • NewInstancesProtectedFromScaleIn — (Boolean)

      Indicates whether newly launched instances are protected from termination by Auto Scaling when scaling in.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.