Class CfnScheduledAction
A CloudFormation AWS::AutoScaling::ScheduledAction
.
Inherited Members
Namespace: Amazon.CDK.AWS.AutoScaling
Assembly: Amazon.CDK.AWS.AutoScaling.dll
Syntax (csharp)
public class CfnScheduledAction : CfnResource, IConstruct, IDependable, IInspectable
Syntax (vb)
Public Class CfnScheduledAction
Inherits CfnResource
Implements IConstruct, IDependable, IInspectable
Remarks
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 Auto scaling template snippets .
For more information, see Scheduled scaling and Suspending and resuming scaling processes in the Amazon EC2 Auto Scaling User Guide .
CloudformationResource: AWS::AutoScaling::ScheduledAction
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.AutoScaling;
var cfnScheduledAction = new CfnScheduledAction(this, "MyCfnScheduledAction", new CfnScheduledActionProps {
AutoScalingGroupName = "autoScalingGroupName",
// the properties below are optional
DesiredCapacity = 123,
EndTime = "endTime",
MaxSize = 123,
MinSize = 123,
Recurrence = "recurrence",
StartTime = "startTime",
TimeZone = "timeZone"
});
Synopsis
Constructors
CfnScheduledAction(Construct, String, ICfnScheduledActionProps) | Create a new |
CfnScheduledAction(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnScheduledAction(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
AttrScheduledActionName | Returns the name of a scheduled action. |
AutoScalingGroupName | The name of the Auto Scaling group. |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
DesiredCapacity | The desired capacity is the initial capacity of the Auto Scaling group after the scheduled action runs and the capacity it attempts to maintain. |
EndTime | The date and time for the recurring schedule to end, in UTC. |
MaxSize | The maximum size of the Auto Scaling group. |
MinSize | The minimum size of the Auto Scaling group. |
Recurrence | The recurring schedule for this action. |
StartTime | 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, |
TimeZone | Specifies the time zone for a cron expression. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnScheduledAction(Construct, String, ICfnScheduledActionProps)
Create a new AWS::AutoScaling::ScheduledAction
.
public CfnScheduledAction(Construct scope, string id, ICfnScheduledActionProps props)
Parameters
- scope Construct
- scope in which this resource is defined.
- id System.String
- scoped id of the resource.
- props ICfnScheduledActionProps
- resource properties.
CfnScheduledAction(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnScheduledAction(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnScheduledAction(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnScheduledAction(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
AttrScheduledActionName
Returns the name of a scheduled action.
public virtual string AttrScheduledActionName { get; }
Property Value
System.String
Remarks
CloudformationAttribute: ScheduledActionName
AutoScalingGroupName
The name of the Auto Scaling group.
public virtual string AutoScalingGroupName { get; set; }
Property Value
System.String
Remarks
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
DesiredCapacity
The desired capacity is the initial capacity of the Auto Scaling group after the scheduled action runs and the capacity it attempts to maintain.
public virtual Nullable<double> DesiredCapacity { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
It can scale beyond this capacity if you add more scaling conditions.
You must specify at least one of the following properties: MaxSize
, MinSize
, or DesiredCapacity
.
EndTime
The date and time for the recurring schedule to end, in UTC.
public virtual string EndTime { get; set; }
Property Value
System.String
Remarks
For example, "2021-06-01T00:00:00Z"
.
MaxSize
The maximum size of the Auto Scaling group.
public virtual Nullable<double> MaxSize { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
MinSize
The minimum size of the Auto Scaling group.
public virtual Nullable<double> MinSize { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
Recurrence
The recurring schedule for this action.
public virtual string Recurrence { get; set; }
Property Value
System.String
Remarks
This format consists of five fields separated by white spaces: [Minute] [Hour] [Day_of_Month] [Month_of_Year] [Day_of_Week]. The value must be in quotes (for example, "30 0 1 1,6,12 *"
). For more information about this format, see Crontab .
When StartTime
and EndTime
are specified with Recurrence
, they form the boundaries of when the recurring action starts and stops.
Cron expressions use Universal Coordinated Time (UTC) by default.
StartTime
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"
).
public virtual string StartTime { get; set; }
Property Value
System.String
Remarks
If you specify Recurrence
and StartTime
, Amazon EC2 Auto Scaling performs the action at this time, and then performs the action based on the specified recurrence.
TimeZone
Specifies the time zone for a cron expression.
public virtual string TimeZone { get; set; }
Property Value
System.String
Remarks
If a time zone is not provided, UTC is used by default.
Valid values are the canonical names of the IANA time zones, derived from the IANA Time Zone Database (such as Etc/GMT+9
or Pacific/Tahiti
). For more information, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones .
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
- tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>