Schedule

A schedule determines the time periods that users are on call. Only on-call users are eligible to receive notifications from incidents.

Example Usage

using Pulumi;
using Pagerduty = Pulumi.Pagerduty;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new Pagerduty.User("example", new Pagerduty.UserArgs
        {
            Email = "125.greenholt.earline@graham.name",
            Teams = 
            {
                pagerduty_team.Example.Id,
            },
        });
        var foo = new Pagerduty.Schedule("foo", new Pagerduty.ScheduleArgs
        {
            TimeZone = "America/New_York",
            Layers = 
            {
                new Pagerduty.Inputs.ScheduleLayerArgs
                {
                    Name = "Night Shift",
                    Start = "2015-11-06T20:00:00-05:00",
                    RotationVirtualStart = "2015-11-06T20:00:00-05:00",
                    RotationTurnLengthSeconds = 86400,
                    Users = 
                    {
                        pagerduty_user.Foo.Id,
                    },
                    Restrictions = 
                    {
                        new Pagerduty.Inputs.ScheduleLayerRestrictionArgs
                        {
                            Type = "daily_restriction",
                            StartTimeOfDay = "08:00:00",
                            DurationSeconds = 32400,
                        },
                    },
                },
            },
        });
    }

}

Coming soon!

import pulumi
import pulumi_pagerduty as pagerduty

example = pagerduty.User("example",
    email="125.greenholt.earline@graham.name",
    teams=[pagerduty_team["example"]["id"]])
foo = pagerduty.Schedule("foo",
    time_zone="America/New_York",
    layers=[pagerduty.ScheduleLayerArgs(
        name="Night Shift",
        start="2015-11-06T20:00:00-05:00",
        rotation_virtual_start="2015-11-06T20:00:00-05:00",
        rotation_turn_length_seconds=86400,
        users=[pagerduty_user["foo"]["id"]],
        restrictions=[pagerduty.ScheduleLayerRestrictionArgs(
            type="daily_restriction",
            start_time_of_day="08:00:00",
            duration_seconds=32400,
        )],
    )])
import * as pulumi from "@pulumi/pulumi";
import * as pagerduty from "@pulumi/pagerduty";

const example = new pagerduty.User("example", {
    email: "125.greenholt.earline@graham.name",
    teams: [pagerduty_team.example.id],
});
const foo = new pagerduty.Schedule("foo", {
    timeZone: "America/New_York",
    layers: [{
        name: "Night Shift",
        start: "2015-11-06T20:00:00-05:00",
        rotationVirtualStart: "2015-11-06T20:00:00-05:00",
        rotationTurnLengthSeconds: 86400,
        users: [pagerduty_user.foo.id],
        restrictions: [{
            type: "daily_restriction",
            startTimeOfDay: "08:00:00",
            durationSeconds: 32400,
        }],
    }],
});

Create a Schedule Resource

new Schedule(name: string, args: ScheduleArgs, opts?: CustomResourceOptions);
@overload
def Schedule(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             description: Optional[str] = None,
             layers: Optional[Sequence[ScheduleLayerArgs]] = None,
             name: Optional[str] = None,
             overflow: Optional[bool] = 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 Programming Model docs.

Inputs

The Schedule resource accepts the following input properties:

Layers List<ScheduleLayerArgs>
A schedule layer block. Schedule layers documented below.
TimeZone string
The time zone of the schedule (e.g Europe/Berlin).
Description string
The description of the schedule
Name string
The name of the schedule.
Overflow bool
Any on-call schedule entries that pass the date range bounds will be truncated at the bounds, unless the parameter overflow is passed. For instance, if your schedule is a rotation that changes daily at midnight UTC, and your date range is from 2011-06-01T10:00:00Z to 2011-06-01T14:00:00Z: If you don’t pass the overflow=true parameter, you will get one schedule entry returned with a start of 2011-06-01T10:00:00Z and end of 2011-06-01T14:00:00Z. If you do pass the overflow parameter, you will get one schedule entry returned with a start of 2011-06-01T00:00:00Z and end of 2011-06-02T00:00:00Z.
Layers []ScheduleLayer
A schedule layer block. Schedule layers documented below.
TimeZone string
The time zone of the schedule (e.g Europe/Berlin).
Description string
The description of the schedule
Name string
The name of the schedule.
Overflow bool
Any on-call schedule entries that pass the date range bounds will be truncated at the bounds, unless the parameter overflow is passed. For instance, if your schedule is a rotation that changes daily at midnight UTC, and your date range is from 2011-06-01T10:00:00Z to 2011-06-01T14:00:00Z: If you don’t pass the overflow=true parameter, you will get one schedule entry returned with a start of 2011-06-01T10:00:00Z and end of 2011-06-01T14:00:00Z. If you do pass the overflow parameter, you will get one schedule entry returned with a start of 2011-06-01T00:00:00Z and end of 2011-06-02T00:00:00Z.
layers ScheduleLayerArgs[]
A schedule layer block. Schedule layers documented below.
timeZone string
The time zone of the schedule (e.g Europe/Berlin).
description string
The description of the schedule
name string
The name of the schedule.
overflow boolean
Any on-call schedule entries that pass the date range bounds will be truncated at the bounds, unless the parameter overflow is passed. For instance, if your schedule is a rotation that changes daily at midnight UTC, and your date range is from 2011-06-01T10:00:00Z to 2011-06-01T14:00:00Z: If you don’t pass the overflow=true parameter, you will get one schedule entry returned with a start of 2011-06-01T10:00:00Z and end of 2011-06-01T14:00:00Z. If you do pass the overflow parameter, you will get one schedule entry returned with a start of 2011-06-01T00:00:00Z and end of 2011-06-02T00:00:00Z.
layers Sequence[ScheduleLayerArgs]
A schedule layer block. Schedule layers documented below.
time_zone str
The time zone of the schedule (e.g Europe/Berlin).
description str
The description of the schedule
name str
The name of the schedule.
overflow bool
Any on-call schedule entries that pass the date range bounds will be truncated at the bounds, unless the parameter overflow is passed. For instance, if your schedule is a rotation that changes daily at midnight UTC, and your date range is from 2011-06-01T10:00:00Z to 2011-06-01T14:00:00Z: If you don’t pass the overflow=true parameter, you will get one schedule entry returned with a start of 2011-06-01T10:00:00Z and end of 2011-06-01T14:00:00Z. If you do pass the overflow parameter, you will get one schedule entry returned with a start of 2011-06-01T00:00:00Z and end of 2011-06-02T00:00:00Z.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
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,
        description: Optional[str] = None,
        layers: Optional[Sequence[ScheduleLayerArgs]] = None,
        name: Optional[str] = None,
        overflow: Optional[bool] = 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:

Description string
The description of the schedule
Layers List<ScheduleLayerArgs>
A schedule layer block. Schedule layers documented below.
Name string
The name of the schedule.
Overflow bool
Any on-call schedule entries that pass the date range bounds will be truncated at the bounds, unless the parameter overflow is passed. For instance, if your schedule is a rotation that changes daily at midnight UTC, and your date range is from 2011-06-01T10:00:00Z to 2011-06-01T14:00:00Z: If you don’t pass the overflow=true parameter, you will get one schedule entry returned with a start of 2011-06-01T10:00:00Z and end of 2011-06-01T14:00:00Z. If you do pass the overflow parameter, you will get one schedule entry returned with a start of 2011-06-01T00:00:00Z and end of 2011-06-02T00:00:00Z.
TimeZone string
The time zone of the schedule (e.g Europe/Berlin).
Description string
The description of the schedule
Layers []ScheduleLayer
A schedule layer block. Schedule layers documented below.
Name string
The name of the schedule.
Overflow bool
Any on-call schedule entries that pass the date range bounds will be truncated at the bounds, unless the parameter overflow is passed. For instance, if your schedule is a rotation that changes daily at midnight UTC, and your date range is from 2011-06-01T10:00:00Z to 2011-06-01T14:00:00Z: If you don’t pass the overflow=true parameter, you will get one schedule entry returned with a start of 2011-06-01T10:00:00Z and end of 2011-06-01T14:00:00Z. If you do pass the overflow parameter, you will get one schedule entry returned with a start of 2011-06-01T00:00:00Z and end of 2011-06-02T00:00:00Z.
TimeZone string
The time zone of the schedule (e.g Europe/Berlin).
description string
The description of the schedule
layers ScheduleLayerArgs[]
A schedule layer block. Schedule layers documented below.
name string
The name of the schedule.
overflow boolean
Any on-call schedule entries that pass the date range bounds will be truncated at the bounds, unless the parameter overflow is passed. For instance, if your schedule is a rotation that changes daily at midnight UTC, and your date range is from 2011-06-01T10:00:00Z to 2011-06-01T14:00:00Z: If you don’t pass the overflow=true parameter, you will get one schedule entry returned with a start of 2011-06-01T10:00:00Z and end of 2011-06-01T14:00:00Z. If you do pass the overflow parameter, you will get one schedule entry returned with a start of 2011-06-01T00:00:00Z and end of 2011-06-02T00:00:00Z.
timeZone string
The time zone of the schedule (e.g Europe/Berlin).
description str
The description of the schedule
layers Sequence[ScheduleLayerArgs]
A schedule layer block. Schedule layers documented below.
name str
The name of the schedule.
overflow bool
Any on-call schedule entries that pass the date range bounds will be truncated at the bounds, unless the parameter overflow is passed. For instance, if your schedule is a rotation that changes daily at midnight UTC, and your date range is from 2011-06-01T10:00:00Z to 2011-06-01T14:00:00Z: If you don’t pass the overflow=true parameter, you will get one schedule entry returned with a start of 2011-06-01T10:00:00Z and end of 2011-06-01T14:00:00Z. If you do pass the overflow parameter, you will get one schedule entry returned with a start of 2011-06-01T00:00:00Z and end of 2011-06-02T00:00:00Z.
time_zone str
The time zone of the schedule (e.g Europe/Berlin).

Supporting Types

ScheduleLayer

RotationTurnLengthSeconds int
The duration of each on-call shift in seconds.
RotationVirtualStart string
The effective start time of the schedule layer. This can be before the start time of the schedule.
Start string
The start time of the schedule layer. This value will not be read back from the PagerDuty API because the API will always return a new start time, which represents the last updated time of the schedule layer.
Users List<string>
The ordered list of users on this layer. The position of the user on the list determines their order in the layer.
End string
The end time of the schedule layer. If not specified, the layer does not end.
Id string
The ID of the schedule
Name string
The name of the schedule layer.
Restrictions List<ScheduleLayerRestrictionArgs>
A schedule layer restriction block. Restriction blocks documented below.
RotationTurnLengthSeconds int
The duration of each on-call shift in seconds.
RotationVirtualStart string
The effective start time of the schedule layer. This can be before the start time of the schedule.
Start string
The start time of the schedule layer. This value will not be read back from the PagerDuty API because the API will always return a new start time, which represents the last updated time of the schedule layer.
Users []string
The ordered list of users on this layer. The position of the user on the list determines their order in the layer.
End string
The end time of the schedule layer. If not specified, the layer does not end.
Id string
The ID of the schedule
Name string
The name of the schedule layer.
Restrictions []ScheduleLayerRestriction
A schedule layer restriction block. Restriction blocks documented below.
rotationTurnLengthSeconds number
The duration of each on-call shift in seconds.
rotationVirtualStart string
The effective start time of the schedule layer. This can be before the start time of the schedule.
start string
The start time of the schedule layer. This value will not be read back from the PagerDuty API because the API will always return a new start time, which represents the last updated time of the schedule layer.
users string[]
The ordered list of users on this layer. The position of the user on the list determines their order in the layer.
end string
The end time of the schedule layer. If not specified, the layer does not end.
id string
The ID of the schedule
name string
The name of the schedule layer.
restrictions ScheduleLayerRestrictionArgs[]
A schedule layer restriction block. Restriction blocks documented below.
rotation_turn_length_seconds int
The duration of each on-call shift in seconds.
rotation_virtual_start str
The effective start time of the schedule layer. This can be before the start time of the schedule.
start str
The start time of the schedule layer. This value will not be read back from the PagerDuty API because the API will always return a new start time, which represents the last updated time of the schedule layer.
users Sequence[str]
The ordered list of users on this layer. The position of the user on the list determines their order in the layer.
end str
The end time of the schedule layer. If not specified, the layer does not end.
id str
The ID of the schedule
name str
The name of the schedule layer.
restrictions Sequence[ScheduleLayerRestrictionArgs]
A schedule layer restriction block. Restriction blocks documented below.

ScheduleLayerRestriction

DurationSeconds int
The duration of the restriction in seconds.
StartTimeOfDay string
The start time in HH:mm:ss format.
Type string
Can be daily_restriction or weekly_restriction
StartDayOfWeek int
Number of the day when restriction starts. From 1 to 7 where 1 is Monday and 7 is Sunday.
DurationSeconds int
The duration of the restriction in seconds.
StartTimeOfDay string
The start time in HH:mm:ss format.
Type string
Can be daily_restriction or weekly_restriction
StartDayOfWeek int
Number of the day when restriction starts. From 1 to 7 where 1 is Monday and 7 is Sunday.
durationSeconds number
The duration of the restriction in seconds.
startTimeOfDay string
The start time in HH:mm:ss format.
type string
Can be daily_restriction or weekly_restriction
startDayOfWeek number
Number of the day when restriction starts. From 1 to 7 where 1 is Monday and 7 is Sunday.
duration_seconds int
The duration of the restriction in seconds.
start_time_of_day str
The start time in HH:mm:ss format.
type str
Can be daily_restriction or weekly_restriction
start_day_of_week int
Number of the day when restriction starts. From 1 to 7 where 1 is Monday and 7 is Sunday.

Import

Schedules can be imported using the id, e.g.

 $ pulumi import pagerduty:index/schedule:Schedule main PLBP09X

Package Details

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