Class CfnScheduledAction

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)", date="2024-07-12T19:33:57.931Z") @Stability(Stable) public class CfnScheduledAction extends CfnResource implements IInspectable
The 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:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String 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)
      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

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      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:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrScheduledActionName

      @Stability(Stable) @NotNull public String getAttrScheduledActionName()
      Returns the name of a scheduled action.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getAutoScalingGroupName

      @Stability(Stable) @NotNull public String getAutoScalingGroupName()
      The name of the Auto Scaling group.
    • setAutoScalingGroupName

      @Stability(Stable) public void setAutoScalingGroupName(@NotNull String value)
      The name of the Auto Scaling group.
    • getDesiredCapacity

      @Stability(Stable) @Nullable public Number 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

      @Stability(Stable) public void setDesiredCapacity(@Nullable 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.
    • getEndTime

      @Stability(Stable) @Nullable public String getEndTime()
      The date and time for the recurring schedule to end, in UTC.
    • setEndTime

      @Stability(Stable) public void setEndTime(@Nullable String value)
      The date and time for the recurring schedule to end, in UTC.
    • getMaxSize

      @Stability(Stable) @Nullable public Number getMaxSize()
      The maximum size of the Auto Scaling group.
    • setMaxSize

      @Stability(Stable) public void setMaxSize(@Nullable Number value)
      The maximum size of the Auto Scaling group.
    • getMinSize

      @Stability(Stable) @Nullable public Number getMinSize()
      The minimum size of the Auto Scaling group.
    • setMinSize

      @Stability(Stable) public void setMinSize(@Nullable Number value)
      The minimum size of the Auto Scaling group.
    • getRecurrence

      @Stability(Stable) @Nullable public String getRecurrence()
      The recurring schedule for this action.
    • setRecurrence

      @Stability(Stable) public void setRecurrence(@Nullable String value)
      The recurring schedule for this action.
    • getStartTime

      @Stability(Stable) @Nullable public String 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

      @Stability(Stable) public void setStartTime(@Nullable 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" ).
    • getTimeZone

      @Stability(Stable) @Nullable public String getTimeZone()
      Specifies the time zone for a cron expression.
    • setTimeZone

      @Stability(Stable) public void setTimeZone(@Nullable String value)
      Specifies the time zone for a cron expression.