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",
},
ForceDelete = true,
HealthCheckGracePeriod = 300,
HealthCheckType = "ELB",
MaxSize = 1,
MinSize = 1,
TerminationPolicies =
{
"OldestInstance",
},
});
var foobarSchedule = new Aws.AutoScaling.Schedule("foobarSchedule", new Aws.AutoScaling.ScheduleArgs
{
AutoscalingGroupName = foobarGroup.Name,
DesiredCapacity = 0,
EndTime = "2016-12-12T06:00:00Z",
MaxSize = 1,
MinSize = 0,
ScheduledActionName = "foobar",
StartTime = "2016-12-11T18:00:00Z",
});
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/autoscaling"
"github.com/pulumi/pulumi/sdk/v2/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"),
},
ForceDelete: pulumi.Bool(true),
HealthCheckGracePeriod: pulumi.Int(300),
HealthCheckType: pulumi.String("ELB"),
MaxSize: pulumi.Int(1),
MinSize: pulumi.Int(1),
TerminationPolicies: pulumi.StringArray{
pulumi.String("OldestInstance"),
},
})
if err != nil {
return err
}
_, err = autoscaling.NewSchedule(ctx, "foobarSchedule", &autoscaling.ScheduleArgs{
AutoscalingGroupName: foobarGroup.Name,
DesiredCapacity: pulumi.Int(0),
EndTime: pulumi.String("2016-12-12T06:00:00Z"),
MaxSize: pulumi.Int(1),
MinSize: pulumi.Int(0),
ScheduledActionName: pulumi.String("foobar"),
StartTime: pulumi.String("2016-12-11T18:00:00Z"),
})
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"],
force_delete=True,
health_check_grace_period=300,
health_check_type="ELB",
max_size=1,
min_size=1,
termination_policies=["OldestInstance"])
foobar_schedule = aws.autoscaling.Schedule("foobarSchedule",
autoscaling_group_name=foobar_group.name,
desired_capacity=0,
end_time="2016-12-12T06:00:00Z",
max_size=1,
min_size=0,
scheduled_action_name="foobar",
start_time="2016-12-11T18:00:00Z")import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const foobarGroup = new aws.autoscaling.Group("foobar", {
availabilityZones: ["us-west-2a"],
forceDelete: true,
healthCheckGracePeriod: 300,
healthCheckType: "ELB",
maxSize: 1,
minSize: 1,
terminationPolicies: ["OldestInstance"],
});
const foobarSchedule = new aws.autoscaling.Schedule("foobar", {
autoscalingGroupName: foobarGroup.name,
desiredCapacity: 0,
endTime: "2016-12-12T06:00:00Z",
maxSize: 1,
minSize: 0,
scheduledActionName: "foobar",
startTime: "2016-12-11T18:00:00Z",
});Create a Schedule Resource
new Schedule(name: string, args: ScheduleArgs, opts?: CustomResourceOptions);def Schedule(resource_name, opts=None, autoscaling_group_name=None, desired_capacity=None, end_time=None, max_size=None, min_size=None, recurrence=None, scheduled_action_name=None, start_time=None, __props__=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.
- opts ResourceOptions
- A bag of options that control this 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 Programming Model docs.
Inputs
The Schedule resource accepts the following input properties:
- Autoscaling
Group stringName The name or Amazon Resource Name (ARN) of the Auto Scaling group.
- Scheduled
Action stringName 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 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.
- 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 string
The time when recurring future actions will start. Start time is specified by the user following the Unix cron syntax format.
- Start
Time 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.
- Autoscaling
Group stringName The name or Amazon Resource Name (ARN) of the Auto Scaling group.
- Scheduled
Action stringName 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 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.
- 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 string
The time when recurring future actions will start. Start time is specified by the user following the Unix cron syntax format.
- Start
Time 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.
- autoscaling
Group stringName The name or Amazon Resource Name (ARN) of the Auto Scaling group.
- scheduled
Action stringName The name of this scaling action.
- desired
Capacity 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.
- end
Time 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.
- max
Size 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.
- min
Size 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.
- start
Time 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.
- autoscaling_
group_ strname The name or Amazon Resource Name (ARN) of the Auto Scaling group.
- scheduled_
action_ strname The name of this scaling action.
- desired_
capacity float 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 float 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 float 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.
Outputs
All input properties are implicitly available as output properties. Additionally, the Schedule resource produces the following output properties:
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): Schedulestatic get(resource_name, id, opts=None, arn=None, autoscaling_group_name=None, desired_capacity=None, end_time=None, max_size=None, min_size=None, recurrence=None, scheduled_action_name=None, start_time=None, __props__=None);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.
- Autoscaling
Group stringName 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 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.
- 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 string
The time when recurring future actions will start. Start time is specified by the user following the Unix cron syntax format.
- Scheduled
Action stringName The name of this scaling action.
- Start
Time 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.
- Arn string
The ARN assigned by AWS to the autoscaling schedule.
- Autoscaling
Group stringName 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 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.
- 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 string
The time when recurring future actions will start. Start time is specified by the user following the Unix cron syntax format.
- Scheduled
Action stringName The name of this scaling action.
- Start
Time 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.
- arn string
The ARN assigned by AWS to the autoscaling schedule.
- autoscaling
Group stringName The name or Amazon Resource Name (ARN) of the Auto Scaling group.
- desired
Capacity 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.
- end
Time 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.
- max
Size 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.
- min
Size 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.
- scheduled
Action stringName The name of this scaling action.
- start
Time 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.
- arn str
The ARN assigned by AWS to the autoscaling schedule.
- autoscaling_
group_ strname The name or Amazon Resource Name (ARN) of the Auto Scaling group.
- desired_
capacity float 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 float 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 float 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_ strname 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.
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.