Class CfnScheduledAction
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.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.AutoScaling
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnScheduledAction : CfnResource, IInspectable
Syntax (vb)
Public Class CfnScheduledAction
Inherits CfnResource
Implements IInspectable
Remarks
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 .
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(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 |
CfnScheduledAction(Construct, String, ICfnScheduledActionProps) |
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(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
CfnScheduledAction(Construct, String, ICfnScheduledActionProps)
public CfnScheduledAction(Construct scope, string id, ICfnScheduledActionProps props)
Parameters
- scope Constructs.Construct
Scope in which this resource is defined.
- id System.String
Construct identifier for this resource (unique in its scope).
- props ICfnScheduledActionProps
Resource properties.
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
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>
EndTime
The date and time for the recurring schedule to end, in UTC.
public virtual string EndTime { get; set; }
Property Value
System.String
MaxSize
The maximum size of the Auto Scaling group.
public virtual Nullable<double> MaxSize { get; set; }
Property Value
System.Nullable<System.Double>
MinSize
The minimum size of the Auto Scaling group.
public virtual Nullable<double> MinSize { get; set; }
Property Value
System.Nullable<System.Double>
Recurrence
The recurring schedule for this action.
public virtual string Recurrence { get; set; }
Property Value
System.String
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
TimeZone
Specifies the time zone for a cron expression.
public virtual string TimeZone { get; set; }
Property Value
System.String
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>