This documentation is for the developer preview release of the AWS CDK. Do not use this version of the AWS CDK in production. Subsequent releases of the AWS CDK will likely include breaking changes.

@aws-cdk/aws-applicationautoscaling

AWS Application AutoScaling Construct Library

Application AutoScaling is used to configure autoscaling for all services other than scaling EC2 instances. For example, you will use this to scale ECS tasks, DynamoDB capacity, Spot Fleet sizes and more.

As a CDK user, you will probably not have to interact with this library directly; instead, it will be used by other construct libraries to offer AutoScaling features for their own constructs.

This document will describe the general autoscaling features and concepts; your particular service may offer only a subset of these.

AutoScaling basics

Resources can offer one or more attributes to autoscale, typically representing some capacity dimension of the underlying service. For example, a DynamoDB Table offers autoscaling of the read and write capacity of the table proper and its Global Secondary Indexes, an ECS Service offers autoscaling of its task count, an RDS Aurora cluster offers scaling of its replica count, and so on.

When you enable autoscaling for an attribute, you specify a minimum and a maximum value for the capacity. AutoScaling policies that respond to metrics will never go higher or lower than the indicated capacity (but scheduled scaling actions might, see below).

There are three ways to scale your capacity:

  • In response to a metric (also known as step scaling); for example, you might want to scale out if the CPU usage across your cluster starts to rise, and scale in when it drops again.
  • By trying to keep a certain metric around a given value (also known as target tracking scaling); you might want to automatically scale out an in to keep your CPU usage around 50%.
  • On a schedule; you might want to organize your scaling around traffic flows you expect, by scaling out in the morning and scaling in in the evening.

The general pattern of autoscaling will look like this:

const capacity = resource.autoScaleCapacity({
  minCapacity: 5,
  maxCapacity: 100
});

// Enable a type of metric scaling and/or schedule scaling
capacity.scaleOnMetric(...);
capacity.scaleToTrackMetric(...);
capacity.scaleOnSchedule(...);

Step Scaling

This type of scaling scales in and out in deterministics steps that you configure, in response to metric values. For example, your scaling strategy to scale in response to CPU usage might look like this:

 Scaling        -1          (no change)          +1       +3
            │        │                       │        │        │
            ├────────┼───────────────────────┼────────┼────────┤
            │        │                       │        │        │
CPU usage   0%      10%                     50%       70%     100%

(Note that this is not necessarily a recommended scaling strategy, but it’s a possible one. You will have to determine what thresholds are right for you).

You would configure it like this:

capacity.scaleOnMetric('ScaleToCPU', {
  metric: service.metricCpuUtilization(),
  scalingSteps: [
    { upper: 10, change: -1 },
    { lower: 50, change: +1 },
    { lower: 70, change: +3 },
  ],

  // Change this to AdjustmentType.PercentChangeInCapacity to interpret the
  // 'change' numbers before as percentages instead of capacity counts.
  adjustmentType: autoscaling.AdjustmentType.ChangeInCapacity,
});

The AutoScaling construct library will create the required CloudWatch alarms and AutoScaling policies for you.

Target Tracking Scaling

This type of scaling scales in and out in order to keep a metric (typically representing utilization) around a value you prefer. This type of scaling is typically heavily service-dependent in what metric you can use, and so different services will have different methods here to set up target tracking scaling.

The following example configures the read capacity of a DynamoDB table to be around 60% utilization:

const readCapacity = table.autosScaleReadCapacity({
  minCapacity: 10,
  maxCapacity: 1000
});
readCapacity.scaleOnUtilization({
  targetUtilizationPercent: 60
});

Scheduled Scaling

This type of scaling is used to change capacities based on time. It works by changing the minCapacity and maxCapacity of the attribute, and so can be used for two purposes:

  • Scale in and out on a schedule by setting the minCapacity high or the maxCapacity low.
  • Still allow the regular scaling actions to do their job, but restrict the range they can scale over (by setting both minCapacity and maxCapacity but changing their range over time).

The following schedule expressions can be used:

  • at(yyyy-mm-ddThh:mm:ss) – scale at a particular moment in time
  • rate(value unit) – scale every minute/hour/day
  • cron(mm hh dd mm dow) – scale on arbitrary schedules

Of these, the cron expression is the most useful but also the most complicated. There is a Cron helper class to help build cron expressions.

The following example scales the fleet out in the morning, and lets natural scaling take over at night:

```ts const capacity = resource.autoScaleCapacity({

minCapacity: 1, maxCapacity: 50,

});

capacity.scaleOnSchedule(‘PrescaleInTheMorning’, {
schedule: autoscaling.Cron.dailyUtc(8), minCapacity: 20,

});

capacity.scaleOnSchedule(‘AllowDownscalingAtNight’, {
schedule: autoscaling.Cron.dailyUtc(20), minCapacity: 1

});

Reference

View in Nuget

csproj:

<PackageReference Include="Amazon.CDK.AWS.ApplicationAutoScaling" Version="0.25.3" />

dotnet:

dotnet add package Amazon.CDK.AWS.ApplicationAutoScaling --version 0.25.3

packages.config:

<package id="Amazon.CDK.AWS.ApplicationAutoScaling" version="0.25.3" />

View in Maven Central

Apache Buildr:

'software.amazon.awscdk:applicationautoscaling:jar:0.25.3'

Apache Ivy:

<dependency groupId="software.amazon.awscdk" name="applicationautoscaling" rev="0.25.3"/>

Apache Maven:

<dependency>
  <groupId>software.amazon.awscdk</groupId>
  <artifactId>applicationautoscaling</artifactId>
  <version>0.25.3</version>
</dependency>

Gradle / Grails:

compile 'software.amazon.awscdk:applicationautoscaling:0.25.3'

Groovy Grape:

@Grapes(
@Grab(group='software.amazon.awscdk', module='applicationautoscaling', version='0.25.3')
)

View in NPM

npm:

$ npm i @aws-cdk/aws-applicationautoscaling@0.25.3

package.json:

{
  "@aws-cdk/aws-applicationautoscaling": "^0.25.3"
}

yarn:

$ yarn add @aws-cdk/aws-applicationautoscaling@0.25.3

View in NPM

npm:

$ npm i @aws-cdk/aws-applicationautoscaling@0.25.3

package.json:

{
  "@aws-cdk/aws-applicationautoscaling": "^0.25.3"
}

yarn:

$ yarn add @aws-cdk/aws-applicationautoscaling@0.25.3

AdjustmentTier (interface)

class @aws-cdk/aws-applicationautoscaling.AdjustmentTier

Language-specific names:

using Amazon.CDK.AWS.ApplicationAutoScaling;
import software.amazon.awscdk.services.applicationautoscaling.AdjustmentTier;
// AdjustmentTier is an interface
import { AdjustmentTier } from '@aws-cdk/aws-applicationautoscaling';

An adjustment

adjustment

What number to adjust the capacity with

The number is interpeted as an added capacity, a new fixed capacity or an

added percentage depending on the AdjustmentType value of the

StepScalingPolicy.

Can be positive or negative.

Type:number
lowerBound

Lower bound where this scaling tier applies.

The scaling tier applies if the difference between the metric

value and its alarm threshold is higher than this value.

Type:number (optional)
Default:-Infinity if this is the first tier, otherwise the upperBound of the previous tier
upperBound

Upper bound where this scaling tier applies

The scaling tier applies if the difference between the metric

value and its alarm threshold is lower than this value.

Type:number (optional)
Default:+Infinity

AdjustmentType (enum)

class @aws-cdk/aws-applicationautoscaling.AdjustmentType

Language-specific names:

using Amazon.CDK.AWS.ApplicationAutoScaling;
import software.amazon.awscdk.services.applicationautoscaling.AdjustmentType;
const { AdjustmentType } = require('@aws-cdk/aws-applicationautoscaling');
import { AdjustmentType } from '@aws-cdk/aws-applicationautoscaling';

How adjustment numbers are interpreted

ChangeInCapacity

Add the adjustment number to the current capacity.

A positive number increases capacity, a negative number decreases capacity.

PercentChangeInCapacity

Add this percentage of the current capacity to itself.

The number must be between -100 and 100; a positive number increases

capacity and a negative number decreases it.

ExactCapacity

Make the capacity equal to the exact number given.

BaseScalableAttribute

class @aws-cdk/aws-applicationautoscaling.BaseScalableAttribute(scope, id, props)

Language-specific names:

using Amazon.CDK.AWS.ApplicationAutoScaling;
import software.amazon.awscdk.services.applicationautoscaling.BaseScalableAttribute;
const { BaseScalableAttribute } = require('@aws-cdk/aws-applicationautoscaling');
import { BaseScalableAttribute } from '@aws-cdk/aws-applicationautoscaling';

Represent an attribute for which autoscaling can be configured

This class is basically a light wrapper around ScalableTarget, but with

all methods protected instead of public so they can be selectively

exposed and/or more specific versions of them can be exposed by derived

classes for individual services support autoscaling.

Typical use cases:

  • Hide away the PredefinedMetric enum for target tracking policies.

  • Don’t expose all scaling methods (for example Dynamo tables don’t support

    Step Scaling, so the Dynamo subclass won’t expose this method).

Extends:

@aws-cdk/cdk.Construct

Abstract:

Yes

Parameters:
doScaleOnMetric(id, props)

Scale out or in based on a metric value

Protected method

Parameters:
doScaleOnSchedule(id, props)

Scale out or in based on time

Protected method

Parameters:
doScaleToTrackMetric(id, props)

Scale out or in in order to keep a metric around a target value

Protected method

Parameters:
props

Protected property

Type:BaseScalableAttributeProps (readonly)
prepare()

Inherited from @aws-cdk/cdk.Construct

Perform final modifications before synthesis

This method can be implemented by derived constructs in order to perform

final changes before synthesis. prepare() will be called after child

constructs have been prepared.

This is an advanced framework feature. Only use this if you

understand the implications.

Protected method

toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)

BaseScalableAttributeProps (interface)

class @aws-cdk/aws-applicationautoscaling.BaseScalableAttributeProps

Language-specific names:

using Amazon.CDK.AWS.ApplicationAutoScaling;
import software.amazon.awscdk.services.applicationautoscaling.BaseScalableAttributeProps;
// BaseScalableAttributeProps is an interface
import { BaseScalableAttributeProps } from '@aws-cdk/aws-applicationautoscaling';

Properties for a ScalableTableAttribute

Extends:EnableScalingProps
dimension

Scalable dimension of the attribute

Type:string
resourceId

Resource ID of the attribute

Type:string
role

Role to use for scaling

Type:@aws-cdk/aws-iam.IRole
serviceNamespace

Service namespace of the scalable attribute

Type:ServiceNamespace
maxCapacity

Inherited from @aws-cdk/aws-applicationautoscaling.EnableScalingProps

Maximum capacity to scale to

Type:number
minCapacity

Inherited from @aws-cdk/aws-applicationautoscaling.EnableScalingProps

Minimum capacity to scale to

Type:number (optional)
Default:1

BaseTargetTrackingProps (interface)

class @aws-cdk/aws-applicationautoscaling.BaseTargetTrackingProps

Language-specific names:

using Amazon.CDK.AWS.ApplicationAutoScaling;
import software.amazon.awscdk.services.applicationautoscaling.BaseTargetTrackingProps;
// BaseTargetTrackingProps is an interface
import { BaseTargetTrackingProps } from '@aws-cdk/aws-applicationautoscaling';

Base interface for target tracking props

Contains the attributes that are common to target tracking policies,

except the ones relating to the metric and to the scalable target.

This interface is reused by more specific target tracking props objects

in other services.

disableScaleIn

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 capacity from the scalable resource. Otherwise, scale in is

enabled and the target tracking policy can remove capacity from the

scalable resource.

Type:boolean (optional)
Default:false
policyName

A name for the scaling policy

Type:string (optional)
Default:Automatically generated name
scaleInCooldownSec

Period after a scale in activity completes before another scale in activity can start.

Type:number (optional)
Default:No scale in cooldown
scaleOutCooldownSec

Period after a scale out activity completes before another scale out activity can start.

Type:number (optional)
Default:No scale out cooldown

BasicStepScalingPolicyProps (interface)

class @aws-cdk/aws-applicationautoscaling.BasicStepScalingPolicyProps

Language-specific names:

using Amazon.CDK.AWS.ApplicationAutoScaling;
import software.amazon.awscdk.services.applicationautoscaling.BasicStepScalingPolicyProps;
// BasicStepScalingPolicyProps is an interface
import { BasicStepScalingPolicyProps } from '@aws-cdk/aws-applicationautoscaling';
metric

Metric to scale on.

Type:@aws-cdk/aws-cloudwatch.Metric
scalingSteps

The intervals for scaling.

Maps a range of metric values to a particular scaling behavior.

Type:ScalingInterval[]
adjustmentType

How the adjustment numbers inside ‘intervals’ are interpreted.

Type:AdjustmentType (optional)
Default:ChangeInCapacity
cooldownSec

Grace period after scaling activity.

Subsequent scale outs during the cooldown period are squashed so that only

the biggest scale out happens.

Subsequent scale ins during the cooldown period are ignored.

Type:number (optional)
Default:No cooldown period
minAdjustmentMagnitude

Minimum absolute number to adjust capacity with as result of percentage scaling.

Only when using AdjustmentType = PercentChangeInCapacity, this number controls

the minimum absolute effect size.

Type:number (optional)
Default:No minimum scaling effect

BasicTargetTrackingScalingPolicyProps (interface)

class @aws-cdk/aws-applicationautoscaling.BasicTargetTrackingScalingPolicyProps

Language-specific names:

using Amazon.CDK.AWS.ApplicationAutoScaling;
import software.amazon.awscdk.services.applicationautoscaling.BasicTargetTrackingScalingPolicyProps;
// BasicTargetTrackingScalingPolicyProps is an interface
import { BasicTargetTrackingScalingPolicyProps } from '@aws-cdk/aws-applicationautoscaling';

Properties for a Target Tracking policy that include the metric but exclude the target

Extends:BaseTargetTrackingProps
targetValue

The target value for the metric.

Type:number
customMetric

A custom metric for application autoscaling

The metric must track utilization. Scaling out will happen if the metric is higher than

the target value, scaling in will happen in the metric is lower than the target value.

Exactly one of customMetric or predefinedMetric must be specified.

Type:@aws-cdk/aws-cloudwatch.Metric (optional)
predefinedMetric

A predefined metric for application autoscaling

The metric must track utilization. Scaling out will happen if the metric is higher than

the target value, scaling in will happen in the metric is lower than the target value.

Exactly one of customMetric or predefinedMetric must be specified.

Type:PredefinedMetric (optional)
resourceLabel

Identify the resource associated with the metric type.

Only used for predefined metric ALBRequestCountPerTarget.

Type:string (optional)
disableScaleIn

Inherited from @aws-cdk/aws-applicationautoscaling.BaseTargetTrackingProps

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 capacity from the scalable resource. Otherwise, scale in is

enabled and the target tracking policy can remove capacity from the

scalable resource.

Type:boolean (optional)
Default:false
policyName

Inherited from @aws-cdk/aws-applicationautoscaling.BaseTargetTrackingProps

A name for the scaling policy

Type:string (optional)
Default:Automatically generated name
scaleInCooldownSec

Inherited from @aws-cdk/aws-applicationautoscaling.BaseTargetTrackingProps

Period after a scale in activity completes before another scale in activity can start.

Type:number (optional)
Default:No scale in cooldown
scaleOutCooldownSec

Inherited from @aws-cdk/aws-applicationautoscaling.BaseTargetTrackingProps

Period after a scale out activity completes before another scale out activity can start.

Type:number (optional)
Default:No scale out cooldown

CfnScalableTarget

class @aws-cdk/aws-applicationautoscaling.CfnScalableTarget(scope, id, props)

Language-specific names:

using Amazon.CDK.AWS.ApplicationAutoScaling;
import software.amazon.awscdk.services.applicationautoscaling.CfnScalableTarget;
const { CfnScalableTarget } = require('@aws-cdk/aws-applicationautoscaling');
import { CfnScalableTarget } from '@aws-cdk/aws-applicationautoscaling';
Extends:

@aws-cdk/cdk.Resource

Parameters:
renderProperties(properties) → string => any

Overrides @aws-cdk/cdk.Resource.renderProperties()

Protected method

Parameters:properties (any) –
Return type:string => any
resourceTypeName

The CloudFormation resource type name for this resource class.

Type:string (readonly) (static)
propertyOverrides
Type:CfnScalableTargetProps (readonly)
scalableTargetId
Type:string (readonly)
class ScalableTargetActionProperty

Language-specific names:

using Amazon.CDK.AWS.ApplicationAutoScaling;
import software.amazon.awscdk.services.applicationautoscaling.CfnScalableTarget.ScalableTargetActionProperty;
// CfnScalableTarget.ScalableTargetActionProperty is an interface
import { CfnScalableTarget.ScalableTargetActionProperty } from '@aws-cdk/aws-applicationautoscaling';
maxCapacity

CfnScalableTarget.ScalableTargetActionProperty.MaxCapacity

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalabletarget-scalabletargetaction.html#cfn-applicationautoscaling-scalabletarget-scalabletargetaction-maxcapacity

Type:number or @aws-cdk/cdk.Token (optional)
minCapacity

CfnScalableTarget.ScalableTargetActionProperty.MinCapacity

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalabletarget-scalabletargetaction.html#cfn-applicationautoscaling-scalabletarget-scalabletargetaction-mincapacity

Type:number or @aws-cdk/cdk.Token (optional)
class ScheduledActionProperty

Language-specific names:

using Amazon.CDK.AWS.ApplicationAutoScaling;
import software.amazon.awscdk.services.applicationautoscaling.CfnScalableTarget.ScheduledActionProperty;
// CfnScalableTarget.ScheduledActionProperty is an interface
import { CfnScalableTarget.ScheduledActionProperty } from '@aws-cdk/aws-applicationautoscaling';
schedule

CfnScalableTarget.ScheduledActionProperty.Schedule

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalabletarget-scheduledaction.html#cfn-applicationautoscaling-scalabletarget-scheduledaction-schedule

Type:string
scheduledActionName

CfnScalableTarget.ScheduledActionProperty.ScheduledActionName

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalabletarget-scheduledaction.html#cfn-applicationautoscaling-scalabletarget-scheduledaction-scheduledactionname

Type:string
endTime

CfnScalableTarget.ScheduledActionProperty.EndTime

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalabletarget-scheduledaction.html#cfn-applicationautoscaling-scalabletarget-scheduledaction-endtime

Type:@aws-cdk/cdk.Token or date (optional)
scalableTargetAction

CfnScalableTarget.ScheduledActionProperty.ScalableTargetAction

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalabletarget-scheduledaction.html#cfn-applicationautoscaling-scalabletarget-scheduledaction-scalabletargetaction

Type:@aws-cdk/cdk.Token or ScalableTargetActionProperty (optional)
startTime

CfnScalableTarget.ScheduledActionProperty.StartTime

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalabletarget-scheduledaction.html#cfn-applicationautoscaling-scalabletarget-scheduledaction-starttime

Type:@aws-cdk/cdk.Token or date (optional)
toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)
ref

Inherited from @aws-cdk/cdk.Referenceable

Returns a token to a CloudFormation { Ref } that references this entity based on it’s logical ID.

Type:string (readonly)
addDeletionOverride(path)

Inherited from @aws-cdk/cdk.Resource

Syntactic sugar for addOverride(path, undefined).

Parameters:path (string) – The path of the value to delete
addDependsOn(resource)

Inherited from @aws-cdk/cdk.Resource

Indicates that this resource depends on another resource and cannot be provisioned

unless the other resource has been successfully provisioned.

Parameters:resource (@aws-cdk/cdk.Resource) –
addOverride(path, value)

Inherited from @aws-cdk/cdk.Resource

Adds an override to the synthesized CloudFormation resource. To add a

property override, either use addPropertyOverride or prefix path with

“Properties.” (i.e. Properties.TopicName).

Parameters:
  • path (string) – The path of the property, you can use dot notation to override values in complex types. Any intermdediate keys will be created as needed.
  • value (any) – The value. Could be primitive or complex.
addPropertyDeletionOverride(propertyPath)

Inherited from @aws-cdk/cdk.Resource

Adds an override that deletes the value of a property from the resource definition.

Parameters:propertyPath (string) – The path to the property.
addPropertyOverride(propertyPath, value)

Inherited from @aws-cdk/cdk.Resource

Adds an override to a resource property.

Syntactic sugar for addOverride(“Properties.<…>”, value).

Parameters:
  • propertyPath (string) – The path of the property
  • value (any) – The value
getAtt(attributeName) → @aws-cdk/cdk.CfnReference

Inherited from @aws-cdk/cdk.Resource

Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility

in case there is no generated attribute.

Parameters:attributeName (string) – The name of the attribute.
Return type:@aws-cdk/cdk.CfnReference
toCloudFormation() → json

Inherited from @aws-cdk/cdk.Resource

Emits CloudFormation for this resource.

Return type:json
options

Inherited from @aws-cdk/cdk.Resource

Options for this resource, such as condition, update policy etc.

Type:@aws-cdk/cdk.ResourceOptions (readonly)
properties

Inherited from @aws-cdk/cdk.Resource

AWS resource properties.

This object is rendered via a call to “renderProperties(this.properties)”.

Protected property

Type:any (readonly)
resourceType

Inherited from @aws-cdk/cdk.Resource

AWS resource type.

Type:string (readonly)
untypedPropertyOverrides

Inherited from @aws-cdk/cdk.Resource

AWS resource property overrides.

During synthesis, the method “renderProperties(this.overrides)” is called

with this object, and merged on top of the output of

“renderProperties(this.properties)”.

Derived classes should expose a strongly-typed version of this object as

a public property called propertyOverrides.

Protected property

Type:any (readonly)
overrideLogicalId(newLogicalId)

Inherited from @aws-cdk/cdk.StackElement

Overrides the auto-generated logical ID with a specific ID.

Parameters:newLogicalId (string) – The new logical ID to use for this stack element.
prepare()

Inherited from @aws-cdk/cdk.StackElement

Automatically detect references in this StackElement

Protected method

creationStackTrace

Inherited from @aws-cdk/cdk.StackElement

Type:string[] (readonly)
logicalId

Inherited from @aws-cdk/cdk.StackElement

The logical ID for this CloudFormation stack element. The logical ID of the element

is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).

Type:string (readonly)
stackPath

Inherited from @aws-cdk/cdk.StackElement

Return the path with respect to the stack

Type:string (readonly)

CfnScalableTargetProps (interface)

class @aws-cdk/aws-applicationautoscaling.CfnScalableTargetProps

Language-specific names:

using Amazon.CDK.AWS.ApplicationAutoScaling;
import software.amazon.awscdk.services.applicationautoscaling.CfnScalableTargetProps;
// CfnScalableTargetProps is an interface
import { CfnScalableTargetProps } from '@aws-cdk/aws-applicationautoscaling';
maxCapacity

AWS::ApplicationAutoScaling::ScalableTarget.MaxCapacity

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-applicationautoscaling-scalabletarget.html#cfn-applicationautoscaling-scalabletarget-maxcapacity

Type:number or @aws-cdk/cdk.Token
minCapacity

AWS::ApplicationAutoScaling::ScalableTarget.MinCapacity

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-applicationautoscaling-scalabletarget.html#cfn-applicationautoscaling-scalabletarget-mincapacity

Type:number or @aws-cdk/cdk.Token
resourceId

AWS::ApplicationAutoScaling::ScalableTarget.ResourceId

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-applicationautoscaling-scalabletarget.html#cfn-applicationautoscaling-scalabletarget-resourceid

Type:string
roleArn

AWS::ApplicationAutoScaling::ScalableTarget.RoleARN

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-applicationautoscaling-scalabletarget.html#cfn-applicationautoscaling-scalabletarget-rolearn

Type:string
scalableDimension

AWS::ApplicationAutoScaling::ScalableTarget.ScalableDimension

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-applicationautoscaling-scalabletarget.html#cfn-applicationautoscaling-scalabletarget-scalabledimension

Type:string
serviceNamespace

AWS::ApplicationAutoScaling::ScalableTarget.ServiceNamespace

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-applicationautoscaling-scalabletarget.html#cfn-applicationautoscaling-scalabletarget-servicenamespace

Type:string
scheduledActions

AWS::ApplicationAutoScaling::ScalableTarget.ScheduledActions

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-applicationautoscaling-scalabletarget.html#cfn-applicationautoscaling-scalabletarget-scheduledactions

Type:@aws-cdk/cdk.Token or (@aws-cdk/cdk.Token or ScheduledActionProperty)[] (optional)

CfnScalingPolicy

class @aws-cdk/aws-applicationautoscaling.CfnScalingPolicy(scope, id, props)

Language-specific names:

using Amazon.CDK.AWS.ApplicationAutoScaling;
import software.amazon.awscdk.services.applicationautoscaling.CfnScalingPolicy;
const { CfnScalingPolicy } = require('@aws-cdk/aws-applicationautoscaling');
import { CfnScalingPolicy } from '@aws-cdk/aws-applicationautoscaling';
Extends:

@aws-cdk/cdk.Resource

Parameters:
renderProperties(properties) → string => any

Overrides @aws-cdk/cdk.Resource.renderProperties()

Protected method

Parameters:properties (any) –
Return type:string => any
resourceTypeName

The CloudFormation resource type name for this resource class.

Type:string (readonly) (static)
propertyOverrides
Type:CfnScalingPolicyProps (readonly)
scalingPolicyArn
Type:string (readonly)
class CustomizedMetricSpecificationProperty

Language-specific names:

using Amazon.CDK.AWS.ApplicationAutoScaling;
import software.amazon.awscdk.services.applicationautoscaling.CfnScalingPolicy.CustomizedMetricSpecificationProperty;
// CfnScalingPolicy.CustomizedMetricSpecificationProperty is an interface
import { CfnScalingPolicy.CustomizedMetricSpecificationProperty } from '@aws-cdk/aws-applicationautoscaling';
metricName

CfnScalingPolicy.CustomizedMetricSpecificationProperty.MetricName

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-customizedmetricspecification.html#cfn-applicationautoscaling-scalingpolicy-customizedmetricspecification-metricname

Type:string
namespace

CfnScalingPolicy.CustomizedMetricSpecificationProperty.Namespace

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-customizedmetricspecification.html#cfn-applicationautoscaling-scalingpolicy-customizedmetricspecification-namespace

Type:string
statistic

CfnScalingPolicy.CustomizedMetricSpecificationProperty.Statistic

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-customizedmetricspecification.html#cfn-applicationautoscaling-scalingpolicy-customizedmetricspecification-statistic

Type:string
dimensions

CfnScalingPolicy.CustomizedMetricSpecificationProperty.Dimensions

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-customizedmetricspecification.html#cfn-applicationautoscaling-scalingpolicy-customizedmetricspecification-dimensions

Type:@aws-cdk/cdk.Token or (@aws-cdk/cdk.Token or MetricDimensionProperty)[] (optional)
unit

CfnScalingPolicy.CustomizedMetricSpecificationProperty.Unit

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-customizedmetricspecification.html#cfn-applicationautoscaling-scalingpolicy-customizedmetricspecification-unit

Type:string (optional)
class MetricDimensionProperty

Language-specific names:

using Amazon.CDK.AWS.ApplicationAutoScaling;
import software.amazon.awscdk.services.applicationautoscaling.CfnScalingPolicy.MetricDimensionProperty;
// CfnScalingPolicy.MetricDimensionProperty is an interface
import { CfnScalingPolicy.MetricDimensionProperty } from '@aws-cdk/aws-applicationautoscaling';
name

CfnScalingPolicy.MetricDimensionProperty.Name

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-metricdimension.html#cfn-applicationautoscaling-scalingpolicy-metricdimension-name

Type:string
value

CfnScalingPolicy.MetricDimensionProperty.Value

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-metricdimension.html#cfn-applicationautoscaling-scalingpolicy-metricdimension-value

Type:string
class PredefinedMetricSpecificationProperty

Language-specific names:

using Amazon.CDK.AWS.ApplicationAutoScaling;
import software.amazon.awscdk.services.applicationautoscaling.CfnScalingPolicy.PredefinedMetricSpecificationProperty;
// CfnScalingPolicy.PredefinedMetricSpecificationProperty is an interface
import { CfnScalingPolicy.PredefinedMetricSpecificationProperty } from '@aws-cdk/aws-applicationautoscaling';
predefinedMetricType

CfnScalingPolicy.PredefinedMetricSpecificationProperty.PredefinedMetricType

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predefinedmetricspecification.html#cfn-applicationautoscaling-scalingpolicy-predefinedmetricspecification-predefinedmetrictype

Type:string
resourceLabel

CfnScalingPolicy.PredefinedMetricSpecificationProperty.ResourceLabel

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predefinedmetricspecification.html#cfn-applicationautoscaling-scalingpolicy-predefinedmetricspecification-resourcelabel

Type:string (optional)
class StepAdjustmentProperty

Language-specific names:

using Amazon.CDK.AWS.ApplicationAutoScaling;
import software.amazon.awscdk.services.applicationautoscaling.CfnScalingPolicy.StepAdjustmentProperty;
// CfnScalingPolicy.StepAdjustmentProperty is an interface
import { CfnScalingPolicy.StepAdjustmentProperty } from '@aws-cdk/aws-applicationautoscaling';
scalingAdjustment

CfnScalingPolicy.StepAdjustmentProperty.ScalingAdjustment

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-stepscalingpolicyconfiguration-stepadjustment.html#cfn-applicationautoscaling-scalingpolicy-stepscalingpolicyconfiguration-stepadjustment-scalingadjustment

Type:number or @aws-cdk/cdk.Token
metricIntervalLowerBound

CfnScalingPolicy.StepAdjustmentProperty.MetricIntervalLowerBound

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-stepscalingpolicyconfiguration-stepadjustment.html#cfn-applicationautoscaling-scalingpolicy-stepscalingpolicyconfiguration-stepadjustment-metricintervallowerbound

Type:number or @aws-cdk/cdk.Token (optional)
metricIntervalUpperBound

CfnScalingPolicy.StepAdjustmentProperty.MetricIntervalUpperBound

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-stepscalingpolicyconfiguration-stepadjustment.html#cfn-applicationautoscaling-scalingpolicy-stepscalingpolicyconfiguration-stepadjustment-metricintervalupperbound

Type:number or @aws-cdk/cdk.Token (optional)
class StepScalingPolicyConfigurationProperty

Language-specific names:

using Amazon.CDK.AWS.ApplicationAutoScaling;
import software.amazon.awscdk.services.applicationautoscaling.CfnScalingPolicy.StepScalingPolicyConfigurationProperty;
// CfnScalingPolicy.StepScalingPolicyConfigurationProperty is an interface
import { CfnScalingPolicy.StepScalingPolicyConfigurationProperty } from '@aws-cdk/aws-applicationautoscaling';
adjustmentType

CfnScalingPolicy.StepScalingPolicyConfigurationProperty.AdjustmentType

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-stepscalingpolicyconfiguration.html#cfn-applicationautoscaling-scalingpolicy-stepscalingpolicyconfiguration-adjustmenttype

Type:string (optional)
cooldown

CfnScalingPolicy.StepScalingPolicyConfigurationProperty.Cooldown

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-stepscalingpolicyconfiguration.html#cfn-applicationautoscaling-scalingpolicy-stepscalingpolicyconfiguration-cooldown

Type:number or @aws-cdk/cdk.Token (optional)
metricAggregationType

CfnScalingPolicy.StepScalingPolicyConfigurationProperty.MetricAggregationType

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-stepscalingpolicyconfiguration.html#cfn-applicationautoscaling-scalingpolicy-stepscalingpolicyconfiguration-metricaggregationtype

Type:string (optional)
minAdjustmentMagnitude

CfnScalingPolicy.StepScalingPolicyConfigurationProperty.MinAdjustmentMagnitude

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-stepscalingpolicyconfiguration.html#cfn-applicationautoscaling-scalingpolicy-stepscalingpolicyconfiguration-minadjustmentmagnitude

Type:number or @aws-cdk/cdk.Token (optional)
stepAdjustments

CfnScalingPolicy.StepScalingPolicyConfigurationProperty.StepAdjustments

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-stepscalingpolicyconfiguration.html#cfn-applicationautoscaling-scalingpolicy-stepscalingpolicyconfiguration-stepadjustments

Type:@aws-cdk/cdk.Token or (@aws-cdk/cdk.Token or StepAdjustmentProperty)[] (optional)
class TargetTrackingScalingPolicyConfigurationProperty

Language-specific names:

using Amazon.CDK.AWS.ApplicationAutoScaling;
import software.amazon.awscdk.services.applicationautoscaling.CfnScalingPolicy.TargetTrackingScalingPolicyConfigurationProperty;
// CfnScalingPolicy.TargetTrackingScalingPolicyConfigurationProperty is an interface
import { CfnScalingPolicy.TargetTrackingScalingPolicyConfigurationProperty } from '@aws-cdk/aws-applicationautoscaling';
targetValue

CfnScalingPolicy.TargetTrackingScalingPolicyConfigurationProperty.TargetValue

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-targettrackingscalingpolicyconfiguration.html#cfn-applicationautoscaling-scalingpolicy-targettrackingscalingpolicyconfiguration-targetvalue

Type:number or @aws-cdk/cdk.Token
customizedMetricSpecification

CfnScalingPolicy.TargetTrackingScalingPolicyConfigurationProperty.CustomizedMetricSpecification

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-targettrackingscalingpolicyconfiguration.html#cfn-applicationautoscaling-scalingpolicy-targettrackingscalingpolicyconfiguration-customizedmetricspecification

Type:@aws-cdk/cdk.Token or CustomizedMetricSpecificationProperty (optional)
disableScaleIn

CfnScalingPolicy.TargetTrackingScalingPolicyConfigurationProperty.DisableScaleIn

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-targettrackingscalingpolicyconfiguration.html#cfn-applicationautoscaling-scalingpolicy-targettrackingscalingpolicyconfiguration-disablescalein

Type:boolean or @aws-cdk/cdk.Token (optional)
predefinedMetricSpecification

CfnScalingPolicy.TargetTrackingScalingPolicyConfigurationProperty.PredefinedMetricSpecification

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-targettrackingscalingpolicyconfiguration.html#cfn-applicationautoscaling-scalingpolicy-targettrackingscalingpolicyconfiguration-predefinedmetricspecification

Type:@aws-cdk/cdk.Token or PredefinedMetricSpecificationProperty (optional)
scaleInCooldown

CfnScalingPolicy.TargetTrackingScalingPolicyConfigurationProperty.ScaleInCooldown

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-targettrackingscalingpolicyconfiguration.html#cfn-applicationautoscaling-scalingpolicy-targettrackingscalingpolicyconfiguration-scaleincooldown

Type:number or @aws-cdk/cdk.Token (optional)
scaleOutCooldown

CfnScalingPolicy.TargetTrackingScalingPolicyConfigurationProperty.ScaleOutCooldown

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-targettrackingscalingpolicyconfiguration.html#cfn-applicationautoscaling-scalingpolicy-targettrackingscalingpolicyconfiguration-scaleoutcooldown

Type:number or @aws-cdk/cdk.Token (optional)
toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)
ref

Inherited from @aws-cdk/cdk.Referenceable

Returns a token to a CloudFormation { Ref } that references this entity based on it’s logical ID.

Type:string (readonly)
addDeletionOverride(path)

Inherited from @aws-cdk/cdk.Resource

Syntactic sugar for addOverride(path, undefined).

Parameters:path (string) – The path of the value to delete
addDependsOn(resource)

Inherited from @aws-cdk/cdk.Resource

Indicates that this resource depends on another resource and cannot be provisioned

unless the other resource has been successfully provisioned.

Parameters:resource (@aws-cdk/cdk.Resource) –
addOverride(path, value)

Inherited from @aws-cdk/cdk.Resource

Adds an override to the synthesized CloudFormation resource. To add a

property override, either use addPropertyOverride or prefix path with

“Properties.” (i.e. Properties.TopicName).

Parameters:
  • path (string) – The path of the property, you can use dot notation to override values in complex types. Any intermdediate keys will be created as needed.
  • value (any) – The value. Could be primitive or complex.
addPropertyDeletionOverride(propertyPath)

Inherited from @aws-cdk/cdk.Resource

Adds an override that deletes the value of a property from the resource definition.

Parameters:propertyPath (string) – The path to the property.
addPropertyOverride(propertyPath, value)

Inherited from @aws-cdk/cdk.Resource

Adds an override to a resource property.

Syntactic sugar for addOverride(“Properties.<…>”, value).

Parameters:
  • propertyPath (string) – The path of the property
  • value (any) – The value
getAtt(attributeName) → @aws-cdk/cdk.CfnReference

Inherited from @aws-cdk/cdk.Resource

Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility

in case there is no generated attribute.

Parameters:attributeName (string) – The name of the attribute.
Return type:@aws-cdk/cdk.CfnReference
toCloudFormation() → json

Inherited from @aws-cdk/cdk.Resource

Emits CloudFormation for this resource.

Return type:json
options

Inherited from @aws-cdk/cdk.Resource

Options for this resource, such as condition, update policy etc.

Type:@aws-cdk/cdk.ResourceOptions (readonly)
properties

Inherited from @aws-cdk/cdk.Resource

AWS resource properties.

This object is rendered via a call to “renderProperties(this.properties)”.

Protected property

Type:any (readonly)
resourceType

Inherited from @aws-cdk/cdk.Resource

AWS resource type.

Type:string (readonly)
untypedPropertyOverrides

Inherited from @aws-cdk/cdk.Resource

AWS resource property overrides.

During synthesis, the method “renderProperties(this.overrides)” is called

with this object, and merged on top of the output of

“renderProperties(this.properties)”.

Derived classes should expose a strongly-typed version of this object as

a public property called propertyOverrides.

Protected property

Type:any (readonly)
overrideLogicalId(newLogicalId)

Inherited from @aws-cdk/cdk.StackElement

Overrides the auto-generated logical ID with a specific ID.

Parameters:newLogicalId (string) – The new logical ID to use for this stack element.
prepare()

Inherited from @aws-cdk/cdk.StackElement

Automatically detect references in this StackElement

Protected method

creationStackTrace

Inherited from @aws-cdk/cdk.StackElement

Type:string[] (readonly)
logicalId

Inherited from @aws-cdk/cdk.StackElement

The logical ID for this CloudFormation stack element. The logical ID of the element

is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).

Type:string (readonly)
stackPath

Inherited from @aws-cdk/cdk.StackElement

Return the path with respect to the stack

Type:string (readonly)

CfnScalingPolicyProps (interface)

class @aws-cdk/aws-applicationautoscaling.CfnScalingPolicyProps

Language-specific names:

using Amazon.CDK.AWS.ApplicationAutoScaling;
import software.amazon.awscdk.services.applicationautoscaling.CfnScalingPolicyProps;
// CfnScalingPolicyProps is an interface
import { CfnScalingPolicyProps } from '@aws-cdk/aws-applicationautoscaling';
policyName

AWS::ApplicationAutoScaling::ScalingPolicy.PolicyName

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-applicationautoscaling-scalingpolicy.html#cfn-applicationautoscaling-scalingpolicy-policyname

Type:string
policyType

AWS::ApplicationAutoScaling::ScalingPolicy.PolicyType

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-applicationautoscaling-scalingpolicy.html#cfn-applicationautoscaling-scalingpolicy-policytype

Type:string
resourceId

AWS::ApplicationAutoScaling::ScalingPolicy.ResourceId

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-applicationautoscaling-scalingpolicy.html#cfn-applicationautoscaling-scalingpolicy-resourceid

Type:string (optional)
scalableDimension

AWS::ApplicationAutoScaling::ScalingPolicy.ScalableDimension

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-applicationautoscaling-scalingpolicy.html#cfn-applicationautoscaling-scalingpolicy-scalabledimension

Type:string (optional)
scalingTargetId

AWS::ApplicationAutoScaling::ScalingPolicy.ScalingTargetId

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-applicationautoscaling-scalingpolicy.html#cfn-applicationautoscaling-scalingpolicy-scalingtargetid

Type:string (optional)
serviceNamespace

AWS::ApplicationAutoScaling::ScalingPolicy.ServiceNamespace

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-applicationautoscaling-scalingpolicy.html#cfn-applicationautoscaling-scalingpolicy-servicenamespace

Type:string (optional)
stepScalingPolicyConfiguration

AWS::ApplicationAutoScaling::ScalingPolicy.StepScalingPolicyConfiguration

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-applicationautoscaling-scalingpolicy.html#cfn-applicationautoscaling-scalingpolicy-stepscalingpolicyconfiguration

Type:@aws-cdk/cdk.Token or StepScalingPolicyConfigurationProperty (optional)
targetTrackingScalingPolicyConfiguration

AWS::ApplicationAutoScaling::ScalingPolicy.TargetTrackingScalingPolicyConfiguration

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-applicationautoscaling-scalingpolicy.html#cfn-applicationautoscaling-scalingpolicy-targettrackingscalingpolicyconfiguration

Type:@aws-cdk/cdk.Token or TargetTrackingScalingPolicyConfigurationProperty (optional)

Cron

class @aws-cdk/aws-applicationautoscaling.Cron

Language-specific names:

using Amazon.CDK.AWS.ApplicationAutoScaling;
import software.amazon.awscdk.services.applicationautoscaling.Cron;
const { Cron } = require('@aws-cdk/aws-applicationautoscaling');
import { Cron } from '@aws-cdk/aws-applicationautoscaling';

Helper class to generate Cron expressions

static dailyUtc(hour[, minute]) → string

Return a cron expression to run every day at a particular time

The time is specified in UTC.

Parameters:
  • hour (number) – The hour in UTC to schedule this action
  • minute (number (optional)) – The minute in the our to schedule this action (defaults to 0)
Return type:

string

EnableScalingProps (interface)

class @aws-cdk/aws-applicationautoscaling.EnableScalingProps

Language-specific names:

using Amazon.CDK.AWS.ApplicationAutoScaling;
import software.amazon.awscdk.services.applicationautoscaling.EnableScalingProps;
// EnableScalingProps is an interface
import { EnableScalingProps } from '@aws-cdk/aws-applicationautoscaling';

Properties for enabling DynamoDB capacity scaling

maxCapacity

Maximum capacity to scale to

Type:number
minCapacity

Minimum capacity to scale to

Type:number (optional)
Default:1

MetricAggregationType (enum)

class @aws-cdk/aws-applicationautoscaling.MetricAggregationType

Language-specific names:

using Amazon.CDK.AWS.ApplicationAutoScaling;
import software.amazon.awscdk.services.applicationautoscaling.MetricAggregationType;
const { MetricAggregationType } = require('@aws-cdk/aws-applicationautoscaling');
import { MetricAggregationType } from '@aws-cdk/aws-applicationautoscaling';

How the scaling metric is going to be aggregated

Average

Average

Minimum

Minimum

Maximum

Maximum

PredefinedMetric (enum)

class @aws-cdk/aws-applicationautoscaling.PredefinedMetric

Language-specific names:

using Amazon.CDK.AWS.ApplicationAutoScaling;
import software.amazon.awscdk.services.applicationautoscaling.PredefinedMetric;
const { PredefinedMetric } = require('@aws-cdk/aws-applicationautoscaling');
import { PredefinedMetric } from '@aws-cdk/aws-applicationautoscaling';

One of the predefined autoscaling metrics

DynamoDBReadCapacityUtilization
DynamoDBWriteCapacityUtilization
ALBRequestCountPerTarget
RDSReaderAverageCPUUtilization
RDSReaderAverageDatabaseConnections
EC2SpotFleetRequestAverageCPUUtilization
EC2SpotFleetRequestAverageNetworkIn
EC2SpotFleetRequestAverageNetworkOut
SageMakerVariantInvocationsPerInstance
ECSServiceAverageCPUUtilization
ECSServiceAverageMemoryUtilization

ScalableTarget

class @aws-cdk/aws-applicationautoscaling.ScalableTarget(scope, id, props)

Language-specific names:

using Amazon.CDK.AWS.ApplicationAutoScaling;
import software.amazon.awscdk.services.applicationautoscaling.ScalableTarget;
const { ScalableTarget } = require('@aws-cdk/aws-applicationautoscaling');
import { ScalableTarget } from '@aws-cdk/aws-applicationautoscaling';

Define a scalable target

Extends:

@aws-cdk/cdk.Construct

Parameters:
addToRolePolicy(statement)

Add a policy statement to the role’s policy

Parameters:statement (@aws-cdk/aws-iam.PolicyStatement) –
scaleOnMetric(id, props) → @aws-cdk/aws-applicationautoscaling.StepScalingPolicy

Scale out or in, in response to a metric

Parameters:
Return type:

StepScalingPolicy

scaleOnSchedule(id, action)

Scale out or in based on time

Parameters:
scaleToTrackMetric(id, props) → @aws-cdk/aws-applicationautoscaling.TargetTrackingScalingPolicy

Scale out or in in order to keep a metric around a target value

Parameters:
Return type:

TargetTrackingScalingPolicy

role

The role used to give AutoScaling permissions to your resource

Type:@aws-cdk/aws-iam.IRole (readonly)
scalableTargetId

ID of the Scalable Target

Type:string (readonly)
prepare()

Inherited from @aws-cdk/cdk.Construct

Perform final modifications before synthesis

This method can be implemented by derived constructs in order to perform

final changes before synthesis. prepare() will be called after child

constructs have been prepared.

This is an advanced framework feature. Only use this if you

understand the implications.

Protected method

toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)

ScalableTargetProps (interface)

class @aws-cdk/aws-applicationautoscaling.ScalableTargetProps

Language-specific names:

using Amazon.CDK.AWS.ApplicationAutoScaling;
import software.amazon.awscdk.services.applicationautoscaling.ScalableTargetProps;
// ScalableTargetProps is an interface
import { ScalableTargetProps } from '@aws-cdk/aws-applicationautoscaling';

Properties for a scalable target

maxCapacity

The maximum value that Application Auto Scaling can use to scale a target during a scaling activity.

Type:number
minCapacity

The minimum value that Application Auto Scaling can use to scale a target during a scaling activity.

Type:number
resourceId

The resource identifier to associate with this scalable target.

This string consists of the resource type and unique identifier.

Type:string
scalableDimension

The scalable dimension that’s associated with the scalable target.

Specify the service namespace, resource type, and scaling property.

Type:string
serviceNamespace

The namespace of the AWS service that provides the resource or

custom-resource for a resource provided by your own application or

service.

For valid AWS service namespace values, see the RegisterScalableTarget

action in the Application Auto Scaling API Reference.

Type:ServiceNamespace
role

Role that allows Application Auto Scaling to modify your scalable target.

Type:@aws-cdk/aws-iam.IRole (optional)
Default:A role is automatically created

ScalingInterval (interface)

class @aws-cdk/aws-applicationautoscaling.ScalingInterval

Language-specific names:

using Amazon.CDK.AWS.ApplicationAutoScaling;
import software.amazon.awscdk.services.applicationautoscaling.ScalingInterval;
// ScalingInterval is an interface
import { ScalingInterval } from '@aws-cdk/aws-applicationautoscaling';

A range of metric values in which to apply a certain scaling operation

change

The capacity adjustment to apply in this interval

The number is interpreted differently based on AdjustmentType:

  • ChangeInCapacity: add the adjustment to the current capacity.

    The number can be positive or negative.

  • PercentChangeInCapacity: add or remove the given percentage of the current

    capacity to itself. The number can be in the range [-100..100].

  • ExactCapacity: set the capacity to this number. The number must

    be positive.

Type:number
lower

The lower bound of the interval.

The scaling adjustment will be applied if the metric is higher than this value.

Type:number (optional)
Default:Threshold automatically derived from neighbouring intervals
upper

The upper bound of the interval.

The scaling adjustment will be applied if the metric is lower than this value.

Type:number (optional)
Default:Threshold automatically derived from neighbouring intervals

ScalingSchedule (interface)

class @aws-cdk/aws-applicationautoscaling.ScalingSchedule

Language-specific names:

using Amazon.CDK.AWS.ApplicationAutoScaling;
import software.amazon.awscdk.services.applicationautoscaling.ScalingSchedule;
// ScalingSchedule is an interface
import { ScalingSchedule } from '@aws-cdk/aws-applicationautoscaling';

A scheduled scaling action

schedule

When to perform this action.

Support formats:

  • at(yyyy-mm-ddThh:mm:ss)
  • rate(value unit)
  • cron(fields)

“At” expressions are useful for one-time schedules. Specify the time in

UTC.

For “rate” expressions, value is a positive integer, and unit is minute,

minutes, hour, hours, day, or days.

For more information about cron expressions, see https://en.wikipedia.org/wiki/Cron.

Type:string
endTime

When this scheduled action expires.

Type:date (optional)
Default:The rule never expires.
maxCapacity

The new maximum capacity.

During the scheduled time, the current capacity is above the maximum

capacity, Application Auto Scaling scales in to the maximum capacity.

At least one of maxCapacity and minCapacity must be supplied.

Type:number (optional)
Default:No new maximum capacity
minCapacity

The new minimum capacity.

During the scheduled time, if the current capacity is below the minimum

capacity, Application Auto Scaling scales out to the minimum capacity.

At least one of maxCapacity and minCapacity must be supplied.

Type:number (optional)
Default:No new minimum capacity
startTime

When this scheduled action becomes active.

Type:date (optional)
Default:The rule is activate immediately

ServiceNamespace (enum)

class @aws-cdk/aws-applicationautoscaling.ServiceNamespace

Language-specific names:

using Amazon.CDK.AWS.ApplicationAutoScaling;
import software.amazon.awscdk.services.applicationautoscaling.ServiceNamespace;
const { ServiceNamespace } = require('@aws-cdk/aws-applicationautoscaling');
import { ServiceNamespace } from '@aws-cdk/aws-applicationautoscaling';

The service that supports Application AutoScaling

Ecs

Elastic Container Service

ElasticMapReduce

Elastic Map Reduce

Ec2

Elastic Compute Cloud

AppStream

App Stream

DynamoDb

Dynamo DB

Rds

Relational Database Service

SageMaker

SageMaker

CustomResource

Custom Resource

StepScalingAction

class @aws-cdk/aws-applicationautoscaling.StepScalingAction(scope, id, props)

Language-specific names:

using Amazon.CDK.AWS.ApplicationAutoScaling;
import software.amazon.awscdk.services.applicationautoscaling.StepScalingAction;
const { StepScalingAction } = require('@aws-cdk/aws-applicationautoscaling');
import { StepScalingAction } from '@aws-cdk/aws-applicationautoscaling';

Define a step scaling action

This kind of scaling policy adjusts the target capacity in configurable

steps. The size of the step is configurable based on the metric’s distance

to its alarm threshold.

This Action must be used as the target of a CloudWatch alarm to take effect.

Extends:

@aws-cdk/cdk.Construct

Implements:

@aws-cdk/aws-cloudwatch.IAlarmAction

Parameters:
addAdjustment(adjustment)

Add an adjusment interval to the ScalingAction

Parameters:adjustment (AdjustmentTier) –
alarmActionArn

Implements @aws-cdk/aws-cloudwatch.IAlarmAction.alarmActionArn()

ARN when this scaling policy is used as an Alarm action

Type:string (readonly)
scalingPolicyArn

ARN of the scaling policy

Type:string (readonly)
prepare()

Inherited from @aws-cdk/cdk.Construct

Perform final modifications before synthesis

This method can be implemented by derived constructs in order to perform

final changes before synthesis. prepare() will be called after child

constructs have been prepared.

This is an advanced framework feature. Only use this if you

understand the implications.

Protected method

toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)

StepScalingActionProps (interface)

class @aws-cdk/aws-applicationautoscaling.StepScalingActionProps

Language-specific names:

using Amazon.CDK.AWS.ApplicationAutoScaling;
import software.amazon.awscdk.services.applicationautoscaling.StepScalingActionProps;
// StepScalingActionProps is an interface
import { StepScalingActionProps } from '@aws-cdk/aws-applicationautoscaling';

Properties for a scaling policy

scalingTarget

The scalable target

Type:ScalableTarget
adjustmentType

How the adjustment numbers are interpreted

Type:AdjustmentType (optional)
Default:ChangeInCapacity
cooldownSec

Grace period after scaling activity.

For scale out policies, multiple scale outs during the cooldown period are

squashed so that only the biggest scale out happens.

For scale in policies, subsequent scale ins during the cooldown period are

ignored.

Type:number (optional)
Default:No cooldown period
metricAggregationType

The aggregation type for the CloudWatch metrics.

Type:MetricAggregationType (optional)
Default:Average
minAdjustmentMagnitude

Minimum absolute number to adjust capacity with as result of percentage scaling.

Only when using AdjustmentType = PercentChangeInCapacity, this number controls

the minimum absolute effect size.

Type:number (optional)
Default:No minimum scaling effect
policyName

A name for the scaling policy

Type:string (optional)
Default:Automatically generated name

StepScalingPolicy

class @aws-cdk/aws-applicationautoscaling.StepScalingPolicy(scope, id, props)

Language-specific names:

using Amazon.CDK.AWS.ApplicationAutoScaling;
import software.amazon.awscdk.services.applicationautoscaling.StepScalingPolicy;
const { StepScalingPolicy } = require('@aws-cdk/aws-applicationautoscaling');
import { StepScalingPolicy } from '@aws-cdk/aws-applicationautoscaling';

Define a acaling strategy which scales depending on absolute values of some metric.

You can specify the scaling behavior for various values of the metric.

Implemented using one or more CloudWatch alarms and Step Scaling Policies.

Extends:

@aws-cdk/cdk.Construct

Parameters:
lowerAction
Type:StepScalingAction (optional) (readonly)
lowerAlarm
Type:@aws-cdk/aws-cloudwatch.Alarm (optional) (readonly)
upperAction
Type:StepScalingAction (optional) (readonly)
upperAlarm
Type:@aws-cdk/aws-cloudwatch.Alarm (optional) (readonly)
prepare()

Inherited from @aws-cdk/cdk.Construct

Perform final modifications before synthesis

This method can be implemented by derived constructs in order to perform

final changes before synthesis. prepare() will be called after child

constructs have been prepared.

This is an advanced framework feature. Only use this if you

understand the implications.

Protected method

toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)

StepScalingPolicyProps (interface)

class @aws-cdk/aws-applicationautoscaling.StepScalingPolicyProps

Language-specific names:

using Amazon.CDK.AWS.ApplicationAutoScaling;
import software.amazon.awscdk.services.applicationautoscaling.StepScalingPolicyProps;
// StepScalingPolicyProps is an interface
import { StepScalingPolicyProps } from '@aws-cdk/aws-applicationautoscaling';
Extends:BasicStepScalingPolicyProps
scalingTarget

The scaling target

Type:ScalableTarget
metric

Inherited from @aws-cdk/aws-applicationautoscaling.BasicStepScalingPolicyProps

Metric to scale on.

Type:@aws-cdk/aws-cloudwatch.Metric
scalingSteps

Inherited from @aws-cdk/aws-applicationautoscaling.BasicStepScalingPolicyProps

The intervals for scaling.

Maps a range of metric values to a particular scaling behavior.

Type:ScalingInterval[]
adjustmentType

Inherited from @aws-cdk/aws-applicationautoscaling.BasicStepScalingPolicyProps

How the adjustment numbers inside ‘intervals’ are interpreted.

Type:AdjustmentType (optional)
Default:ChangeInCapacity
cooldownSec

Inherited from @aws-cdk/aws-applicationautoscaling.BasicStepScalingPolicyProps

Grace period after scaling activity.

Subsequent scale outs during the cooldown period are squashed so that only

the biggest scale out happens.

Subsequent scale ins during the cooldown period are ignored.

Type:number (optional)
Default:No cooldown period
minAdjustmentMagnitude

Inherited from @aws-cdk/aws-applicationautoscaling.BasicStepScalingPolicyProps

Minimum absolute number to adjust capacity with as result of percentage scaling.

Only when using AdjustmentType = PercentChangeInCapacity, this number controls

the minimum absolute effect size.

Type:number (optional)
Default:No minimum scaling effect

TargetTrackingScalingPolicy

class @aws-cdk/aws-applicationautoscaling.TargetTrackingScalingPolicy(scope, id, props)

Language-specific names:

using Amazon.CDK.AWS.ApplicationAutoScaling;
import software.amazon.awscdk.services.applicationautoscaling.TargetTrackingScalingPolicy;
const { TargetTrackingScalingPolicy } = require('@aws-cdk/aws-applicationautoscaling');
import { TargetTrackingScalingPolicy } from '@aws-cdk/aws-applicationautoscaling';
Extends:

@aws-cdk/cdk.Construct

Parameters:
scalingPolicyArn

ARN of the scaling policy

Type:string (readonly)
prepare()

Inherited from @aws-cdk/cdk.Construct

Perform final modifications before synthesis

This method can be implemented by derived constructs in order to perform

final changes before synthesis. prepare() will be called after child

constructs have been prepared.

This is an advanced framework feature. Only use this if you

understand the implications.

Protected method

toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)

TargetTrackingScalingPolicyProps (interface)

class @aws-cdk/aws-applicationautoscaling.TargetTrackingScalingPolicyProps

Language-specific names:

using Amazon.CDK.AWS.ApplicationAutoScaling;
import software.amazon.awscdk.services.applicationautoscaling.TargetTrackingScalingPolicyProps;
// TargetTrackingScalingPolicyProps is an interface
import { TargetTrackingScalingPolicyProps } from '@aws-cdk/aws-applicationautoscaling';

Properties for a concrete TargetTrackingPolicy

Adds the scalingTarget.

Extends:BasicTargetTrackingScalingPolicyProps
scalingTarget
Type:ScalableTarget
disableScaleIn

Inherited from @aws-cdk/aws-applicationautoscaling.BaseTargetTrackingProps

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 capacity from the scalable resource. Otherwise, scale in is

enabled and the target tracking policy can remove capacity from the

scalable resource.

Type:boolean (optional)
Default:false
policyName

Inherited from @aws-cdk/aws-applicationautoscaling.BaseTargetTrackingProps

A name for the scaling policy

Type:string (optional)
Default:Automatically generated name
scaleInCooldownSec

Inherited from @aws-cdk/aws-applicationautoscaling.BaseTargetTrackingProps

Period after a scale in activity completes before another scale in activity can start.

Type:number (optional)
Default:No scale in cooldown
scaleOutCooldownSec

Inherited from @aws-cdk/aws-applicationautoscaling.BaseTargetTrackingProps

Period after a scale out activity completes before another scale out activity can start.

Type:number (optional)
Default:No scale out cooldown
targetValue

Inherited from @aws-cdk/aws-applicationautoscaling.BasicTargetTrackingScalingPolicyProps

The target value for the metric.

Type:number
customMetric

Inherited from @aws-cdk/aws-applicationautoscaling.BasicTargetTrackingScalingPolicyProps

A custom metric for application autoscaling

The metric must track utilization. Scaling out will happen if the metric is higher than

the target value, scaling in will happen in the metric is lower than the target value.

Exactly one of customMetric or predefinedMetric must be specified.

Type:@aws-cdk/aws-cloudwatch.Metric (optional)
predefinedMetric

Inherited from @aws-cdk/aws-applicationautoscaling.BasicTargetTrackingScalingPolicyProps

A predefined metric for application autoscaling

The metric must track utilization. Scaling out will happen if the metric is higher than

the target value, scaling in will happen in the metric is lower than the target value.

Exactly one of customMetric or predefinedMetric must be specified.

Type:PredefinedMetric (optional)
resourceLabel

Inherited from @aws-cdk/aws-applicationautoscaling.BasicTargetTrackingScalingPolicyProps

Identify the resource associated with the metric type.

Only used for predefined metric ALBRequestCountPerTarget.

Type:string (optional)