Welcome to Pulumi Registry, your window into the cloud. Read the announcement.

AWS Classic

v4.25.0 published on Friday, Oct 15, 2021 by Pulumi

Schedule

Provides an AutoScaling Schedule resource.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var foobarGroup = new Aws.AutoScaling.Group("foobarGroup", new Aws.AutoScaling.GroupArgs
        {
            AvailabilityZones = 
            {
                "us-west-2a",
            },
            MaxSize = 1,
            MinSize = 1,
            HealthCheckGracePeriod = 300,
            HealthCheckType = "ELB",
            ForceDelete = true,
            TerminationPolicies = 
            {
                "OldestInstance",
            },
        });
        var foobarSchedule = new Aws.AutoScaling.Schedule("foobarSchedule", new Aws.AutoScaling.ScheduleArgs
        {
            ScheduledActionName = "foobar",
            MinSize = 0,
            MaxSize = 1,
            DesiredCapacity = 0,
            StartTime = "2016-12-11T18:00:00Z",
            EndTime = "2016-12-12T06:00:00Z",
            AutoscalingGroupName = foobarGroup.Name,
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/autoscaling"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		foobarGroup, err := autoscaling.NewGroup(ctx, "foobarGroup", &autoscaling.GroupArgs{
			AvailabilityZones: pulumi.StringArray{
				pulumi.String("us-west-2a"),
			},
			MaxSize:                pulumi.Int(1),
			MinSize:                pulumi.Int(1),
			HealthCheckGracePeriod: pulumi.Int(300),
			HealthCheckType:        pulumi.String("ELB"),
			ForceDelete:            pulumi.Bool(true),
			TerminationPolicies: pulumi.StringArray{
				pulumi.String("OldestInstance"),
			},
		})
		if err != nil {
			return err
		}
		_, err = autoscaling.NewSchedule(ctx, "foobarSchedule", &autoscaling.ScheduleArgs{
			ScheduledActionName:  pulumi.String("foobar"),
			MinSize:              pulumi.Int(0),
			MaxSize:              pulumi.Int(1),
			DesiredCapacity:      pulumi.Int(0),
			StartTime:            pulumi.String("2016-12-11T18:00:00Z"),
			EndTime:              pulumi.String("2016-12-12T06:00:00Z"),
			AutoscalingGroupName: foobarGroup.Name,
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

foobar_group = aws.autoscaling.Group("foobarGroup",
    availability_zones=["us-west-2a"],
    max_size=1,
    min_size=1,
    health_check_grace_period=300,
    health_check_type="ELB",
    force_delete=True,
    termination_policies=["OldestInstance"])
foobar_schedule = aws.autoscaling.Schedule("foobarSchedule",
    scheduled_action_name="foobar",
    min_size=0,
    max_size=1,
    desired_capacity=0,
    start_time="2016-12-11T18:00:00Z",
    end_time="2016-12-12T06:00:00Z",
    autoscaling_group_name=foobar_group.name)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const foobarGroup = new aws.autoscaling.Group("foobarGroup", {
    availabilityZones: ["us-west-2a"],
    maxSize: 1,
    minSize: 1,
    healthCheckGracePeriod: 300,
    healthCheckType: "ELB",
    forceDelete: true,
    terminationPolicies: ["OldestInstance"],
});
const foobarSchedule = new aws.autoscaling.Schedule("foobarSchedule", {
    scheduledActionName: "foobar",
    minSize: 0,
    maxSize: 1,
    desiredCapacity: 0,
    startTime: "2016-12-11T18:00:00Z",
    endTime: "2016-12-12T06:00:00Z",
    autoscalingGroupName: foobarGroup.name,
});

Create a Schedule Resource

new Schedule(name: string, args: ScheduleArgs, opts?: CustomResourceOptions);
@overload
def Schedule(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             autoscaling_group_name: Optional[str] = None,
             desired_capacity: Optional[int] = None,
             end_time: Optional[str] = None,
             max_size: Optional[int] = None,
             min_size: Optional[int] = None,
             recurrence: Optional[str] = None,
             scheduled_action_name: Optional[str] = None,
             start_time: Optional[str] = None,
             time_zone: Optional[str] = None)
@overload
def Schedule(resource_name: str,
             args: ScheduleArgs,
             opts: Optional[ResourceOptions] = None)
func NewSchedule(ctx *Context, name string, args ScheduleArgs, opts ...ResourceOption) (*Schedule, error)
public Schedule(string name, ScheduleArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args ScheduleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args ScheduleArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args ScheduleArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ScheduleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Schedule Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Schedule resource accepts the following input properties:

AutoscalingGroupName string
The name or Amazon Resource Name (ARN) of the Auto Scaling group.
ScheduledActionName string
The name of this scaling action.
DesiredCapacity int
The number of EC2 instances that should be running in the group. Default 0. Set to -1 if you don’t want to change the desired capacity at the scheduled time.
EndTime string
The time for this action to end, in “YYYY-MM-DDThh:mm:ssZ” format in UTC/GMT only (for example, 2014-06-01T00:00:00Z ). If you try to schedule your action in the past, Auto Scaling returns an error message.
MaxSize int
The maximum size for the Auto Scaling group. Default 0. Set to -1 if you don’t want to change the maximum size at the scheduled time.
MinSize int
The minimum size for the Auto Scaling group. Default 0. Set to -1 if you don’t want to change the minimum size at the scheduled time.
Recurrence string
The time when recurring future actions will start. Start time is specified by the user following the Unix cron syntax format.
StartTime string
The time for this action to start, in “YYYY-MM-DDThh:mm:ssZ” format in UTC/GMT only (for example, 2014-06-01T00:00:00Z ). If you try to schedule your action in the past, Auto Scaling returns an error message.
TimeZone string
The timezone for the cron expression. Valid values are the canonical names of the IANA time zones (such as Etc/GMT+9 or Pacific/Tahiti).
AutoscalingGroupName string
The name or Amazon Resource Name (ARN) of the Auto Scaling group.
ScheduledActionName string
The name of this scaling action.
DesiredCapacity int
The number of EC2 instances that should be running in the group. Default 0. Set to -1 if you don’t want to change the desired capacity at the scheduled time.
EndTime string
The time for this action to end, in “YYYY-MM-DDThh:mm:ssZ” format in UTC/GMT only (for example, 2014-06-01T00:00:00Z ). If you try to schedule your action in the past, Auto Scaling returns an error message.
MaxSize int
The maximum size for the Auto Scaling group. Default 0. Set to -1 if you don’t want to change the maximum size at the scheduled time.
MinSize int
The minimum size for the Auto Scaling group. Default 0. Set to -1 if you don’t want to change the minimum size at the scheduled time.
Recurrence string
The time when recurring future actions will start. Start time is specified by the user following the Unix cron syntax format.
StartTime string
The time for this action to start, in “YYYY-MM-DDThh:mm:ssZ” format in UTC/GMT only (for example, 2014-06-01T00:00:00Z ). If you try to schedule your action in the past, Auto Scaling returns an error message.
TimeZone string
The timezone for the cron expression. Valid values are the canonical names of the IANA time zones (such as Etc/GMT+9 or Pacific/Tahiti).
autoscalingGroupName string
The name or Amazon Resource Name (ARN) of the Auto Scaling group.
scheduledActionName string
The name of this scaling action.
desiredCapacity number
The number of EC2 instances that should be running in the group. Default 0. Set to -1 if you don’t want to change the desired capacity at the scheduled time.
endTime string
The time for this action to end, in “YYYY-MM-DDThh:mm:ssZ” format in UTC/GMT only (for example, 2014-06-01T00:00:00Z ). If you try to schedule your action in the past, Auto Scaling returns an error message.
maxSize number
The maximum size for the Auto Scaling group. Default 0. Set to -1 if you don’t want to change the maximum size at the scheduled time.
minSize number
The minimum size for the Auto Scaling group. Default 0. Set to -1 if you don’t want to change the minimum size at the scheduled time.
recurrence string
The time when recurring future actions will start. Start time is specified by the user following the Unix cron syntax format.
startTime string
The time for this action to start, in “YYYY-MM-DDThh:mm:ssZ” format in UTC/GMT only (for example, 2014-06-01T00:00:00Z ). If you try to schedule your action in the past, Auto Scaling returns an error message.
timeZone string
The timezone for the cron expression. Valid values are the canonical names of the IANA time zones (such as Etc/GMT+9 or Pacific/Tahiti).
autoscaling_group_name str
The name or Amazon Resource Name (ARN) of the Auto Scaling group.
scheduled_action_name str
The name of this scaling action.
desired_capacity int
The number of EC2 instances that should be running in the group. Default 0. Set to -1 if you don’t want to change the desired capacity at the scheduled time.
end_time str
The time for this action to end, in “YYYY-MM-DDThh:mm:ssZ” format in UTC/GMT only (for example, 2014-06-01T00:00:00Z ). If you try to schedule your action in the past, Auto Scaling returns an error message.
max_size int
The maximum size for the Auto Scaling group. Default 0. Set to -1 if you don’t want to change the maximum size at the scheduled time.
min_size int
The minimum size for the Auto Scaling group. Default 0. Set to -1 if you don’t want to change the minimum size at the scheduled time.
recurrence str
The time when recurring future actions will start. Start time is specified by the user following the Unix cron syntax format.
start_time str
The time for this action to start, in “YYYY-MM-DDThh:mm:ssZ” format in UTC/GMT only (for example, 2014-06-01T00:00:00Z ). If you try to schedule your action in the past, Auto Scaling returns an error message.
time_zone str
The timezone for the cron expression. Valid values are the canonical names of the IANA time zones (such as Etc/GMT+9 or Pacific/Tahiti).

Outputs

All input properties are implicitly available as output properties. Additionally, the Schedule resource produces the following output properties:

Arn string
The ARN assigned by AWS to the autoscaling schedule.
Id string
The provider-assigned unique ID for this managed resource.
Arn string
The ARN assigned by AWS to the autoscaling schedule.
Id string
The provider-assigned unique ID for this managed resource.
arn string
The ARN assigned by AWS to the autoscaling schedule.
id string
The provider-assigned unique ID for this managed resource.
arn str
The ARN assigned by AWS to the autoscaling schedule.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing Schedule Resource

Get an existing Schedule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ScheduleState, opts?: CustomResourceOptions): Schedule
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        arn: Optional[str] = None,
        autoscaling_group_name: Optional[str] = None,
        desired_capacity: Optional[int] = None,
        end_time: Optional[str] = None,
        max_size: Optional[int] = None,
        min_size: Optional[int] = None,
        recurrence: Optional[str] = None,
        scheduled_action_name: Optional[str] = None,
        start_time: Optional[str] = None,
        time_zone: Optional[str] = None) -> Schedule
func GetSchedule(ctx *Context, name string, id IDInput, state *ScheduleState, opts ...ResourceOption) (*Schedule, error)
public static Schedule Get(string name, Input<string> id, ScheduleState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Arn string
The ARN assigned by AWS to the autoscaling schedule.
AutoscalingGroupName string
The name or Amazon Resource Name (ARN) of the Auto Scaling group.
DesiredCapacity int
The number of EC2 instances that should be running in the group. Default 0. Set to -1 if you don’t want to change the desired capacity at the scheduled time.
EndTime string
The time for this action to end, in “YYYY-MM-DDThh:mm:ssZ” format in UTC/GMT only (for example, 2014-06-01T00:00:00Z ). If you try to schedule your action in the past, Auto Scaling returns an error message.
MaxSize int
The maximum size for the Auto Scaling group. Default 0. Set to -1 if you don’t want to change the maximum size at the scheduled time.
MinSize int
The minimum size for the Auto Scaling group. Default 0. Set to -1 if you don’t want to change the minimum size at the scheduled time.
Recurrence string
The time when recurring future actions will start. Start time is specified by the user following the Unix cron syntax format.
ScheduledActionName string
The name of this scaling action.
StartTime string
The time for this action to start, in “YYYY-MM-DDThh:mm:ssZ” format in UTC/GMT only (for example, 2014-06-01T00:00:00Z ). If you try to schedule your action in the past, Auto Scaling returns an error message.
TimeZone string
The timezone for the cron expression. Valid values are the canonical names of the IANA time zones (such as Etc/GMT+9 or Pacific/Tahiti).
Arn string
The ARN assigned by AWS to the autoscaling schedule.
AutoscalingGroupName string
The name or Amazon Resource Name (ARN) of the Auto Scaling group.
DesiredCapacity int
The number of EC2 instances that should be running in the group. Default 0. Set to -1 if you don’t want to change the desired capacity at the scheduled time.
EndTime string
The time for this action to end, in “YYYY-MM-DDThh:mm:ssZ” format in UTC/GMT only (for example, 2014-06-01T00:00:00Z ). If you try to schedule your action in the past, Auto Scaling returns an error message.
MaxSize int
The maximum size for the Auto Scaling group. Default 0. Set to -1 if you don’t want to change the maximum size at the scheduled time.
MinSize int
The minimum size for the Auto Scaling group. Default 0. Set to -1 if you don’t want to change the minimum size at the scheduled time.
Recurrence string
The time when recurring future actions will start. Start time is specified by the user following the Unix cron syntax format.
ScheduledActionName string
The name of this scaling action.
StartTime string
The time for this action to start, in “YYYY-MM-DDThh:mm:ssZ” format in UTC/GMT only (for example, 2014-06-01T00:00:00Z ). If you try to schedule your action in the past, Auto Scaling returns an error message.
TimeZone string
The timezone for the cron expression. Valid values are the canonical names of the IANA time zones (such as Etc/GMT+9 or Pacific/Tahiti).
arn string
The ARN assigned by AWS to the autoscaling schedule.
autoscalingGroupName string
The name or Amazon Resource Name (ARN) of the Auto Scaling group.
desiredCapacity number
The number of EC2 instances that should be running in the group. Default 0. Set to -1 if you don’t want to change the desired capacity at the scheduled time.
endTime string
The time for this action to end, in “YYYY-MM-DDThh:mm:ssZ” format in UTC/GMT only (for example, 2014-06-01T00:00:00Z ). If you try to schedule your action in the past, Auto Scaling returns an error message.
maxSize number
The maximum size for the Auto Scaling group. Default 0. Set to -1 if you don’t want to change the maximum size at the scheduled time.
minSize number
The minimum size for the Auto Scaling group. Default 0. Set to -1 if you don’t want to change the minimum size at the scheduled time.
recurrence string
The time when recurring future actions will start. Start time is specified by the user following the Unix cron syntax format.
scheduledActionName string
The name of this scaling action.
startTime string
The time for this action to start, in “YYYY-MM-DDThh:mm:ssZ” format in UTC/GMT only (for example, 2014-06-01T00:00:00Z ). If you try to schedule your action in the past, Auto Scaling returns an error message.
timeZone string
The timezone for the cron expression. Valid values are the canonical names of the IANA time zones (such as Etc/GMT+9 or Pacific/Tahiti).
arn str
The ARN assigned by AWS to the autoscaling schedule.
autoscaling_group_name str
The name or Amazon Resource Name (ARN) of the Auto Scaling group.
desired_capacity int
The number of EC2 instances that should be running in the group. Default 0. Set to -1 if you don’t want to change the desired capacity at the scheduled time.
end_time str
The time for this action to end, in “YYYY-MM-DDThh:mm:ssZ” format in UTC/GMT only (for example, 2014-06-01T00:00:00Z ). If you try to schedule your action in the past, Auto Scaling returns an error message.
max_size int
The maximum size for the Auto Scaling group. Default 0. Set to -1 if you don’t want to change the maximum size at the scheduled time.
min_size int
The minimum size for the Auto Scaling group. Default 0. Set to -1 if you don’t want to change the minimum size at the scheduled time.
recurrence str
The time when recurring future actions will start. Start time is specified by the user following the Unix cron syntax format.
scheduled_action_name str
The name of this scaling action.
start_time str
The time for this action to start, in “YYYY-MM-DDThh:mm:ssZ” format in UTC/GMT only (for example, 2014-06-01T00:00:00Z ). If you try to schedule your action in the past, Auto Scaling returns an error message.
time_zone str
The timezone for the cron expression. Valid values are the canonical names of the IANA time zones (such as Etc/GMT+9 or Pacific/Tahiti).

Import

AutoScaling ScheduledAction can be imported using the auto-scaling-group-name and scheduled-action-name, e.g.

 $ pulumi import aws:autoscaling/schedule:Schedule resource-name auto-scaling-group-name/scheduled-action-name

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.