Class CfnScheduledAction
- All Implemented Interfaces:
IInspectable,IScheduledActionRef,IEnvironmentAware,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
AWS::AutoScaling::ScheduledAction resource specifies an Amazon EC2 Auto Scaling scheduled action so that the Auto Scaling group can change the number of instances available for your application in response to predictable load changes.
When you update a stack with an Auto Scaling group and scheduled action, CloudFormation always sets the min size, max size, and desired capacity properties of your group to the values that are defined in the AWS::AutoScaling::AutoScalingGroup section of your template. However, you might not want CloudFormation to do that when you have a scheduled action in effect. You can use an UpdatePolicy attribute to prevent CloudFormation from changing the min size, max size, or desired capacity property values during a stack update unless you modified the individual values in your template. If you have rolling updates enabled, before you can update the Auto Scaling group, you must suspend scheduled actions by specifying an UpdatePolicy attribute for the Auto Scaling group. You can find a sample update policy for rolling updates in Configure Amazon EC2 Auto Scaling resources .
For more information, see Scheduled scaling and Suspending and resuming scaling processes in the Amazon EC2 Auto Scaling User Guide .
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.autoscaling.*;
CfnScheduledAction cfnScheduledAction = CfnScheduledAction.Builder.create(this, "MyCfnScheduledAction")
.autoScalingGroupName("autoScalingGroupName")
// the properties below are optional
.desiredCapacity(123)
.endTime("endTime")
.maxSize(123)
.minSize(123)
.recurrence("recurrence")
.startTime("startTime")
.timeZone("timeZone")
.build();
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.autoscaling.IScheduledActionRef
IScheduledActionRef.Jsii$Default, IScheduledActionRef.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnScheduledAction(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnScheduledAction(software.amazon.jsii.JsiiObjectRef objRef) CfnScheduledAction(software.constructs.Construct scope, String id, CfnScheduledActionProps props) Create a newAWS::AutoScaling::ScheduledAction. -
Method Summary
Modifier and TypeMethodDescriptionReturns the name of a scheduled action.The name of the Auto Scaling group.The desired capacity is the initial capacity of the Auto Scaling group after the scheduled action runs and the capacity it attempts to maintain.The date and time for the recurring schedule to end, in UTC.The maximum size of the Auto Scaling group.The minimum size of the Auto Scaling group.The recurring schedule for this action.A reference to a ScheduledAction resource.The date and time for this action to start, in YYYY-MM-DDThh:mm:ssZ format in UTC/GMT only and in quotes (for example,"2021-06-01T00:00:00Z").Specifies the time zone for a cron expression.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.static BooleanChecks whether the given object is a CfnScheduledAction.renderProperties(Map<String, Object> props) voidsetAutoScalingGroupName(String value) The name of the Auto Scaling group.voidsetDesiredCapacity(Number value) The desired capacity is the initial capacity of the Auto Scaling group after the scheduled action runs and the capacity it attempts to maintain.voidsetEndTime(String value) The date and time for the recurring schedule to end, in UTC.voidsetMaxSize(Number value) The maximum size of the Auto Scaling group.voidsetMinSize(Number value) The minimum size of the Auto Scaling group.voidsetRecurrence(String value) The recurring schedule for this action.voidsetStartTime(String value) The date and time for this action to start, in YYYY-MM-DDThh:mm:ssZ format in UTC/GMT only and in quotes (for example,"2021-06-01T00:00:00Z").voidsetTimeZone(String value) Specifies the time zone for a cron expression.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnScheduledAction
protected CfnScheduledAction(software.amazon.jsii.JsiiObjectRef objRef) -
CfnScheduledAction
protected CfnScheduledAction(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnScheduledAction
@Stability(Stable) public CfnScheduledAction(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnScheduledActionProps props) Create a newAWS::AutoScaling::ScheduledAction.- Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties. This parameter is required.
-
-
Method Details
-
isCfnScheduledAction
Checks whether the given object is a CfnScheduledAction.- Parameters:
x- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrScheduledActionName
Returns the name of a scheduled action. -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getScheduledActionRef
A reference to a ScheduledAction resource.- Specified by:
getScheduledActionRefin interfaceIScheduledActionRef
-
getAutoScalingGroupName
The name of the Auto Scaling group. -
setAutoScalingGroupName
The name of the Auto Scaling group. -
getDesiredCapacity
The desired capacity is the initial capacity of the Auto Scaling group after the scheduled action runs and the capacity it attempts to maintain. -
setDesiredCapacity
The desired capacity is the initial capacity of the Auto Scaling group after the scheduled action runs and the capacity it attempts to maintain. -
getEndTime
The date and time for the recurring schedule to end, in UTC. -
setEndTime
The date and time for the recurring schedule to end, in UTC. -
getMaxSize
The maximum size of the Auto Scaling group. -
setMaxSize
The maximum size of the Auto Scaling group. -
getMinSize
The minimum size of the Auto Scaling group. -
setMinSize
The minimum size of the Auto Scaling group. -
getRecurrence
The recurring schedule for this action. -
setRecurrence
The recurring schedule for this action. -
getStartTime
The date and time for this action to start, in YYYY-MM-DDThh:mm:ssZ format in UTC/GMT only and in quotes (for example,"2021-06-01T00:00:00Z"). -
setStartTime
The date and time for this action to start, in YYYY-MM-DDThh:mm:ssZ format in UTC/GMT only and in quotes (for example,"2021-06-01T00:00:00Z"). -
getTimeZone
Specifies the time zone for a cron expression. -
setTimeZone
Specifies the time zone for a cron expression.
-