1. Packages
  2. Incident Provider
  3. API Docs
  4. Schedule
incident 5.5.0 published on Wednesday, Apr 30, 2025 by incident-io

incident.Schedule

Explore with Pulumi AI

incident logo
incident 5.5.0 published on Wednesday, Apr 30, 2025 by incident-io

    View and manage schedules. Manage your full schedule of on-call rotations, including the users and rotation configuration.

    Example Usage

    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.incident.IncidentFunctions;
    import com.pulumi.incident.inputs.GetUserArgs;
    import com.pulumi.incident.Schedule;
    import com.pulumi.incident.ScheduleArgs;
    import com.pulumi.incident.inputs.ScheduleRotationArgs;
    import com.pulumi.incident.inputs.ScheduleHolidaysPublicConfigArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var rory = IncidentFunctions.getUser(GetUserArgs.builder()
                .id("01HPFH8T92MPGSQS5C1SPAF4V0")
                .build());
    
            final var martha = IncidentFunctions.getUser(GetUserArgs.builder()
                .slackUserId("U01HJ1J2Z6Z")
                .build());
    
            final var roryb = IncidentFunctions.getUser(GetUserArgs.builder()
                .email("rory@incident.io")
                .build());
    
            // This is exportable from the incident.io dashboard as a Terraform configuration
            var primaryOnCall = new Schedule("primaryOnCall", ScheduleArgs.builder()
                .timezone("Europe/London")
                .rotations(ScheduleRotationArgs.builder()
                    .id("testing-terraform")
                    .name("Testing Terraform")
                    .versions(                
                        ScheduleRotationVersionArgs.builder()
                            .handoverStartAt("2024-05-01T12:54:13Z")
                            .users(martha.applyValue(getUserResult -> getUserResult.id()))
                            .layers(ScheduleRotationVersionLayerArgs.builder()
                                .id("primary")
                                .name("Primary")
                                .build())
                            .handovers(ScheduleRotationVersionHandoverArgs.builder()
                                .intervalType("daily")
                                .interval(1)
                                .build())
                            .build(),
                        ScheduleRotationVersionArgs.builder()
                            .effectiveFrom("2024-05-14T12:54:13Z")
                            .handoverStartAt("2024-05-01T12:54:13Z")
                            .users(                        
                                martha.applyValue(getUserResult -> getUserResult.id()),
                                rory.applyValue(getUserResult -> getUserResult.id()))
                            .layers(ScheduleRotationVersionLayerArgs.builder()
                                .id("primary")
                                .name("Primary")
                                .build())
                            .handovers(ScheduleRotationVersionHandoverArgs.builder()
                                .intervalType("weekly")
                                .interval(1)
                                .build())
                            .build())
                    .build())
                .holidaysPublicConfig(ScheduleHolidaysPublicConfigArgs.builder()
                    .country_codes(                
                        "GB",
                        "FR")
                    .build())
                .build());
    
        }
    }
    
    resources:
      # This is exportable from the incident.io dashboard as a Terraform configuration
      primaryOnCall:
        type: incident:Schedule
        properties:
          # This is a valid value from the tz database
          #   # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
          timezone: Europe/London
          rotations:
            - id: testing-terraform
              name: Testing Terraform
              versions:
                - handoverStartAt: 2024-05-01T12:54:13Z
                  users:
                    - ${martha.id}
                  layers:
                    - id: primary
                      name: Primary
                  handovers:
                    - intervalType: daily
                      interval: 1
                - effectiveFrom: 2024-05-14T12:54:13Z
                  handoverStartAt: 2024-05-01T12:54:13Z
                  users:
                    - ${martha.id}
                    - ${rory.id}
                  layers:
                    - id: primary
                      name: Primary
                  handovers:
                    - intervalType: weekly
                      interval: 1
          # If you want to show a country's public holidays on your schedule, use a list of alpha-2 country codes.
          holidaysPublicConfig:
            country_codes:
              - GB
              - FR
    variables:
      rory:
        fn::invoke:
          function: incident:getUser
          arguments:
            id: 01HPFH8T92MPGSQS5C1SPAF4V0
      martha:
        fn::invoke:
          function: incident:getUser
          arguments:
            slackUserId: U01HJ1J2Z6Z
      roryb:
        fn::invoke:
          function: incident:getUser
          arguments:
            email: rory@incident.io
    

    Create Schedule Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Schedule(name: string, args: ScheduleArgs, opts?: CustomResourceOptions);
    @overload
    def Schedule(resource_name: str,
                 args: ScheduleArgs,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def Schedule(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 rotations: Optional[Sequence[ScheduleRotationArgs]] = None,
                 timezone: Optional[str] = None,
                 holidays_public_config: Optional[ScheduleHolidaysPublicConfigArgs] = None,
                 name: Optional[str] = None,
                 team_ids: Optional[Sequence[str]] = None)
    func NewSchedule(ctx *Context, name string, args ScheduleArgs, opts ...ResourceOption) (*Schedule, error)
    public Schedule(string name, ScheduleArgs args, CustomResourceOptions? opts = null)
    public Schedule(String name, ScheduleArgs args)
    public Schedule(String name, ScheduleArgs args, CustomResourceOptions options)
    
    type: incident:Schedule
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    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.
    name String
    The unique name of the resource.
    args ScheduleArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var scheduleResource = new Incident.Schedule("scheduleResource", new()
    {
        Rotations = new[]
        {
            new Incident.Inputs.ScheduleRotationArgs
            {
                Id = "string",
                Name = "string",
                Versions = new[]
                {
                    new Incident.Inputs.ScheduleRotationVersionArgs
                    {
                        HandoverStartAt = "string",
                        Layers = new[]
                        {
                            new Incident.Inputs.ScheduleRotationVersionLayerArgs
                            {
                                Id = "string",
                                Name = "string",
                            },
                        },
                        Users = new[]
                        {
                            "string",
                        },
                        EffectiveFrom = "string",
                        Handovers = new[]
                        {
                            new Incident.Inputs.ScheduleRotationVersionHandoverArgs
                            {
                                Interval = 0,
                                IntervalType = "string",
                            },
                        },
                        WorkingIntervals = new[]
                        {
                            new Incident.Inputs.ScheduleRotationVersionWorkingIntervalArgs
                            {
                                EndTime = "string",
                                StartTime = "string",
                                Weekday = "string",
                            },
                        },
                    },
                },
            },
        },
        Timezone = "string",
        HolidaysPublicConfig = new Incident.Inputs.ScheduleHolidaysPublicConfigArgs
        {
            CountryCodes = new[]
            {
                "string",
            },
        },
        Name = "string",
        TeamIds = new[]
        {
            "string",
        },
    });
    
    example, err := incident.NewSchedule(ctx, "scheduleResource", &incident.ScheduleArgs{
    	Rotations: incident.ScheduleRotationArray{
    		&incident.ScheduleRotationArgs{
    			Id:   pulumi.String("string"),
    			Name: pulumi.String("string"),
    			Versions: incident.ScheduleRotationVersionArray{
    				&incident.ScheduleRotationVersionArgs{
    					HandoverStartAt: pulumi.String("string"),
    					Layers: incident.ScheduleRotationVersionLayerArray{
    						&incident.ScheduleRotationVersionLayerArgs{
    							Id:   pulumi.String("string"),
    							Name: pulumi.String("string"),
    						},
    					},
    					Users: pulumi.StringArray{
    						pulumi.String("string"),
    					},
    					EffectiveFrom: pulumi.String("string"),
    					Handovers: incident.ScheduleRotationVersionHandoverArray{
    						&incident.ScheduleRotationVersionHandoverArgs{
    							Interval:     pulumi.Float64(0),
    							IntervalType: pulumi.String("string"),
    						},
    					},
    					WorkingIntervals: incident.ScheduleRotationVersionWorkingIntervalArray{
    						&incident.ScheduleRotationVersionWorkingIntervalArgs{
    							EndTime:   pulumi.String("string"),
    							StartTime: pulumi.String("string"),
    							Weekday:   pulumi.String("string"),
    						},
    					},
    				},
    			},
    		},
    	},
    	Timezone: pulumi.String("string"),
    	HolidaysPublicConfig: &incident.ScheduleHolidaysPublicConfigArgs{
    		CountryCodes: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    	},
    	Name: pulumi.String("string"),
    	TeamIds: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    var scheduleResource = new Schedule("scheduleResource", ScheduleArgs.builder()
        .rotations(ScheduleRotationArgs.builder()
            .id("string")
            .name("string")
            .versions(ScheduleRotationVersionArgs.builder()
                .handoverStartAt("string")
                .layers(ScheduleRotationVersionLayerArgs.builder()
                    .id("string")
                    .name("string")
                    .build())
                .users("string")
                .effectiveFrom("string")
                .handovers(ScheduleRotationVersionHandoverArgs.builder()
                    .interval(0)
                    .intervalType("string")
                    .build())
                .workingIntervals(ScheduleRotationVersionWorkingIntervalArgs.builder()
                    .endTime("string")
                    .startTime("string")
                    .weekday("string")
                    .build())
                .build())
            .build())
        .timezone("string")
        .holidaysPublicConfig(ScheduleHolidaysPublicConfigArgs.builder()
            .countryCodes("string")
            .build())
        .name("string")
        .teamIds("string")
        .build());
    
    schedule_resource = incident.Schedule("scheduleResource",
        rotations=[{
            "id": "string",
            "name": "string",
            "versions": [{
                "handover_start_at": "string",
                "layers": [{
                    "id": "string",
                    "name": "string",
                }],
                "users": ["string"],
                "effective_from": "string",
                "handovers": [{
                    "interval": 0,
                    "interval_type": "string",
                }],
                "working_intervals": [{
                    "end_time": "string",
                    "start_time": "string",
                    "weekday": "string",
                }],
            }],
        }],
        timezone="string",
        holidays_public_config={
            "country_codes": ["string"],
        },
        name="string",
        team_ids=["string"])
    
    const scheduleResource = new incident.Schedule("scheduleResource", {
        rotations: [{
            id: "string",
            name: "string",
            versions: [{
                handoverStartAt: "string",
                layers: [{
                    id: "string",
                    name: "string",
                }],
                users: ["string"],
                effectiveFrom: "string",
                handovers: [{
                    interval: 0,
                    intervalType: "string",
                }],
                workingIntervals: [{
                    endTime: "string",
                    startTime: "string",
                    weekday: "string",
                }],
            }],
        }],
        timezone: "string",
        holidaysPublicConfig: {
            countryCodes: ["string"],
        },
        name: "string",
        teamIds: ["string"],
    });
    
    type: incident:Schedule
    properties:
        holidaysPublicConfig:
            countryCodes:
                - string
        name: string
        rotations:
            - id: string
              name: string
              versions:
                - effectiveFrom: string
                  handoverStartAt: string
                  handovers:
                    - interval: 0
                      intervalType: string
                  layers:
                    - id: string
                      name: string
                  users:
                    - string
                  workingIntervals:
                    - endTime: string
                      startTime: string
                      weekday: string
        teamIds:
            - string
        timezone: string
    

    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

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The Schedule resource accepts the following input properties:

    Rotations List<ScheduleRotation>
    Timezone string
    HolidaysPublicConfig ScheduleHolidaysPublicConfig
    Name string
    Human readable name synced from external provider
    TeamIds List<string>
    IDs of teams that own this schedule
    Rotations []ScheduleRotationArgs
    Timezone string
    HolidaysPublicConfig ScheduleHolidaysPublicConfigArgs
    Name string
    Human readable name synced from external provider
    TeamIds []string
    IDs of teams that own this schedule
    rotations List<ScheduleRotation>
    timezone String
    holidaysPublicConfig ScheduleHolidaysPublicConfig
    name String
    Human readable name synced from external provider
    teamIds List<String>
    IDs of teams that own this schedule
    rotations ScheduleRotation[]
    timezone string
    holidaysPublicConfig ScheduleHolidaysPublicConfig
    name string
    Human readable name synced from external provider
    teamIds string[]
    IDs of teams that own this schedule
    rotations Sequence[ScheduleRotationArgs]
    timezone str
    holidays_public_config ScheduleHolidaysPublicConfigArgs
    name str
    Human readable name synced from external provider
    team_ids Sequence[str]
    IDs of teams that own this schedule
    rotations List<Property Map>
    timezone String
    holidaysPublicConfig Property Map
    name String
    Human readable name synced from external provider
    teamIds List<String>
    IDs of teams that own this schedule

    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 string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up 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,
            holidays_public_config: Optional[ScheduleHolidaysPublicConfigArgs] = None,
            name: Optional[str] = None,
            rotations: Optional[Sequence[ScheduleRotationArgs]] = None,
            team_ids: Optional[Sequence[str]] = None,
            timezone: 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)
    public static Schedule get(String name, Output<String> id, ScheduleState state, CustomResourceOptions options)
    resources:  _:    type: incident:Schedule    get:      id: ${id}
    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.
    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:
    HolidaysPublicConfig ScheduleHolidaysPublicConfig
    Name string
    Human readable name synced from external provider
    Rotations List<ScheduleRotation>
    TeamIds List<string>
    IDs of teams that own this schedule
    Timezone string
    HolidaysPublicConfig ScheduleHolidaysPublicConfigArgs
    Name string
    Human readable name synced from external provider
    Rotations []ScheduleRotationArgs
    TeamIds []string
    IDs of teams that own this schedule
    Timezone string
    holidaysPublicConfig ScheduleHolidaysPublicConfig
    name String
    Human readable name synced from external provider
    rotations List<ScheduleRotation>
    teamIds List<String>
    IDs of teams that own this schedule
    timezone String
    holidaysPublicConfig ScheduleHolidaysPublicConfig
    name string
    Human readable name synced from external provider
    rotations ScheduleRotation[]
    teamIds string[]
    IDs of teams that own this schedule
    timezone string
    holidays_public_config ScheduleHolidaysPublicConfigArgs
    name str
    Human readable name synced from external provider
    rotations Sequence[ScheduleRotationArgs]
    team_ids Sequence[str]
    IDs of teams that own this schedule
    timezone str
    holidaysPublicConfig Property Map
    name String
    Human readable name synced from external provider
    rotations List<Property Map>
    teamIds List<String>
    IDs of teams that own this schedule
    timezone String

    Supporting Types

    ScheduleHolidaysPublicConfig, ScheduleHolidaysPublicConfigArgs

    CountryCodes List<string>
    ISO 3166-1 alpha-2 country codes for the countries that this schedule is configured to view holidays for
    CountryCodes []string
    ISO 3166-1 alpha-2 country codes for the countries that this schedule is configured to view holidays for
    countryCodes List<String>
    ISO 3166-1 alpha-2 country codes for the countries that this schedule is configured to view holidays for
    countryCodes string[]
    ISO 3166-1 alpha-2 country codes for the countries that this schedule is configured to view holidays for
    country_codes Sequence[str]
    ISO 3166-1 alpha-2 country codes for the countries that this schedule is configured to view holidays for
    countryCodes List<String>
    ISO 3166-1 alpha-2 country codes for the countries that this schedule is configured to view holidays for

    ScheduleRotation, ScheduleRotationArgs

    Id string
    Unique internal ID of the rotation
    Name string
    Human readable name synced from external provider
    Versions List<ScheduleRotationVersion>
    Id string
    Unique internal ID of the rotation
    Name string
    Human readable name synced from external provider
    Versions []ScheduleRotationVersion
    id String
    Unique internal ID of the rotation
    name String
    Human readable name synced from external provider
    versions List<ScheduleRotationVersion>
    id string
    Unique internal ID of the rotation
    name string
    Human readable name synced from external provider
    versions ScheduleRotationVersion[]
    id str
    Unique internal ID of the rotation
    name str
    Human readable name synced from external provider
    versions Sequence[ScheduleRotationVersion]
    id String
    Unique internal ID of the rotation
    name String
    Human readable name synced from external provider
    versions List<Property Map>

    ScheduleRotationVersion, ScheduleRotationVersionArgs

    HandoverStartAt string
    Defines the next moment we'll trigger a handover
    Layers List<ScheduleRotationVersionLayer>
    Controls how many people are on-call concurrently
    Users List<string>
    The incident.io ID of a user
    EffectiveFrom string
    When this rotation config will be effective from
    Handovers List<ScheduleRotationVersionHandover>
    Defines the handover intervals for this rota, in order they should apply
    WorkingIntervals List<ScheduleRotationVersionWorkingInterval>
    Optional restrictions that define when to schedule people for this rota
    HandoverStartAt string
    Defines the next moment we'll trigger a handover
    Layers []ScheduleRotationVersionLayer
    Controls how many people are on-call concurrently
    Users []string
    The incident.io ID of a user
    EffectiveFrom string
    When this rotation config will be effective from
    Handovers []ScheduleRotationVersionHandover
    Defines the handover intervals for this rota, in order they should apply
    WorkingIntervals []ScheduleRotationVersionWorkingInterval
    Optional restrictions that define when to schedule people for this rota
    handoverStartAt String
    Defines the next moment we'll trigger a handover
    layers List<ScheduleRotationVersionLayer>
    Controls how many people are on-call concurrently
    users List<String>
    The incident.io ID of a user
    effectiveFrom String
    When this rotation config will be effective from
    handovers List<ScheduleRotationVersionHandover>
    Defines the handover intervals for this rota, in order they should apply
    workingIntervals List<ScheduleRotationVersionWorkingInterval>
    Optional restrictions that define when to schedule people for this rota
    handoverStartAt string
    Defines the next moment we'll trigger a handover
    layers ScheduleRotationVersionLayer[]
    Controls how many people are on-call concurrently
    users string[]
    The incident.io ID of a user
    effectiveFrom string
    When this rotation config will be effective from
    handovers ScheduleRotationVersionHandover[]
    Defines the handover intervals for this rota, in order they should apply
    workingIntervals ScheduleRotationVersionWorkingInterval[]
    Optional restrictions that define when to schedule people for this rota
    handover_start_at str
    Defines the next moment we'll trigger a handover
    layers Sequence[ScheduleRotationVersionLayer]
    Controls how many people are on-call concurrently
    users Sequence[str]
    The incident.io ID of a user
    effective_from str
    When this rotation config will be effective from
    handovers Sequence[ScheduleRotationVersionHandover]
    Defines the handover intervals for this rota, in order they should apply
    working_intervals Sequence[ScheduleRotationVersionWorkingInterval]
    Optional restrictions that define when to schedule people for this rota
    handoverStartAt String
    Defines the next moment we'll trigger a handover
    layers List<Property Map>
    Controls how many people are on-call concurrently
    users List<String>
    The incident.io ID of a user
    effectiveFrom String
    When this rotation config will be effective from
    handovers List<Property Map>
    Defines the handover intervals for this rota, in order they should apply
    workingIntervals List<Property Map>
    Optional restrictions that define when to schedule people for this rota

    ScheduleRotationVersionHandover, ScheduleRotationVersionHandoverArgs

    Interval double
    IntervalType string
    Interval float64
    IntervalType string
    interval Double
    intervalType String
    interval number
    intervalType string
    interval Number
    intervalType String

    ScheduleRotationVersionLayer, ScheduleRotationVersionLayerArgs

    Id string
    Name string
    Id string
    Name string
    id String
    name String
    id string
    name string
    id str
    name str
    id String
    name String

    ScheduleRotationVersionWorkingInterval, ScheduleRotationVersionWorkingIntervalArgs

    EndTime string
    StartTime string
    Weekday string
    EndTime string
    StartTime string
    Weekday string
    endTime String
    startTime String
    weekday String
    endTime string
    startTime string
    weekday string
    endTime String
    startTime String
    weekday String

    Import

    #!/bin/bash

    Import a schedule using its ID

    Replace the ID with a real ID from your incident.io organization

    $ pulumi import incident:index/schedule:Schedule example 01ABC123DEF456GHI789JKL
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    incident incident-io/terraform-provider-incident
    License
    Notes
    This Pulumi package is based on the incident Terraform Provider.
    incident logo
    incident 5.5.0 published on Wednesday, Apr 30, 2025 by incident-io