1. Packages
  2. Packages
  3. Incident Provider
  4. API Docs
  5. ScheduleSyncRule
Viewing docs for incident 5.38.1
published on Friday, May 22, 2026 by incident-io
Viewing docs for incident 5.38.1
published on Friday, May 22, 2026 by incident-io

    Manage schedule sync rules that link schedules to sync targets (Slack user groups).

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as incident from "@pulumi/incident";
    
    // Create a sync target (Slack user group)
    const platformOncall = new incident.ScheduleSyncTarget("platform_oncall", {
        addBotToGroup: true,
        newSlackUserGroup: {
            name: "Platform On-Call",
            handle: "platform-oncall",
            description: "Current on-call engineers for the Platform team",
        },
    });
    // Link a schedule to the sync target
    // Only the current on-call engineer(s) will be synced to the user group
    const platformOncallScheduleSyncRule = new incident.ScheduleSyncRule("platform_oncall", {
        scheduleId: platform.id,
        scheduleSyncTargetId: platformOncall.id,
        syncType: "on_call",
    });
    // Alternatively, sync all users in the rotation (not just who's on call)
    const platformAllUsers = new incident.ScheduleSyncRule("platform_all_users", {
        scheduleId: platform.id,
        scheduleSyncTargetId: platformTeam.id,
        syncType: "all_users",
    });
    
    import pulumi
    import pulumi_incident as incident
    
    # Create a sync target (Slack user group)
    platform_oncall = incident.ScheduleSyncTarget("platform_oncall",
        add_bot_to_group=True,
        new_slack_user_group={
            "name": "Platform On-Call",
            "handle": "platform-oncall",
            "description": "Current on-call engineers for the Platform team",
        })
    # Link a schedule to the sync target
    # Only the current on-call engineer(s) will be synced to the user group
    platform_oncall_schedule_sync_rule = incident.ScheduleSyncRule("platform_oncall",
        schedule_id=platform["id"],
        schedule_sync_target_id=platform_oncall.id,
        sync_type="on_call")
    # Alternatively, sync all users in the rotation (not just who's on call)
    platform_all_users = incident.ScheduleSyncRule("platform_all_users",
        schedule_id=platform["id"],
        schedule_sync_target_id=platform_team["id"],
        sync_type="all_users")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/incident/v5/incident"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Create a sync target (Slack user group)
    		platformOncall, err := incident.NewScheduleSyncTarget(ctx, "platform_oncall", &incident.ScheduleSyncTargetArgs{
    			AddBotToGroup: pulumi.Bool(true),
    			NewSlackUserGroup: &incident.ScheduleSyncTargetNewSlackUserGroupArgs{
    				Name:        pulumi.String("Platform On-Call"),
    				Handle:      pulumi.String("platform-oncall"),
    				Description: pulumi.String("Current on-call engineers for the Platform team"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// Link a schedule to the sync target
    		// Only the current on-call engineer(s) will be synced to the user group
    		_, err = incident.NewScheduleSyncRule(ctx, "platform_oncall", &incident.ScheduleSyncRuleArgs{
    			ScheduleId:           pulumi.Any(platform.Id),
    			ScheduleSyncTargetId: platformOncall.ID(),
    			SyncType:             pulumi.String("on_call"),
    		})
    		if err != nil {
    			return err
    		}
    		// Alternatively, sync all users in the rotation (not just who's on call)
    		_, err = incident.NewScheduleSyncRule(ctx, "platform_all_users", &incident.ScheduleSyncRuleArgs{
    			ScheduleId:           pulumi.Any(platform.Id),
    			ScheduleSyncTargetId: pulumi.Any(platformTeam.Id),
    			SyncType:             pulumi.String("all_users"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Incident = Pulumi.Incident;
    
    return await Deployment.RunAsync(() => 
    {
        // Create a sync target (Slack user group)
        var platformOncall = new Incident.ScheduleSyncTarget("platform_oncall", new()
        {
            AddBotToGroup = true,
            NewSlackUserGroup = new Incident.Inputs.ScheduleSyncTargetNewSlackUserGroupArgs
            {
                Name = "Platform On-Call",
                Handle = "platform-oncall",
                Description = "Current on-call engineers for the Platform team",
            },
        });
    
        // Link a schedule to the sync target
        // Only the current on-call engineer(s) will be synced to the user group
        var platformOncallScheduleSyncRule = new Incident.ScheduleSyncRule("platform_oncall", new()
        {
            ScheduleId = platform.Id,
            ScheduleSyncTargetId = platformOncall.Id,
            SyncType = "on_call",
        });
    
        // Alternatively, sync all users in the rotation (not just who's on call)
        var platformAllUsers = new Incident.ScheduleSyncRule("platform_all_users", new()
        {
            ScheduleId = platform.Id,
            ScheduleSyncTargetId = platformTeam.Id,
            SyncType = "all_users",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.incident.ScheduleSyncTarget;
    import com.pulumi.incident.ScheduleSyncTargetArgs;
    import com.pulumi.incident.inputs.ScheduleSyncTargetNewSlackUserGroupArgs;
    import com.pulumi.incident.ScheduleSyncRule;
    import com.pulumi.incident.ScheduleSyncRuleArgs;
    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) {
            // Create a sync target (Slack user group)
            var platformOncall = new ScheduleSyncTarget("platformOncall", ScheduleSyncTargetArgs.builder()
                .addBotToGroup(true)
                .newSlackUserGroup(ScheduleSyncTargetNewSlackUserGroupArgs.builder()
                    .name("Platform On-Call")
                    .handle("platform-oncall")
                    .description("Current on-call engineers for the Platform team")
                    .build())
                .build());
    
            // Link a schedule to the sync target
            // Only the current on-call engineer(s) will be synced to the user group
            var platformOncallScheduleSyncRule = new ScheduleSyncRule("platformOncallScheduleSyncRule", ScheduleSyncRuleArgs.builder()
                .scheduleId(platform.id())
                .scheduleSyncTargetId(platformOncall.id())
                .syncType("on_call")
                .build());
    
            // Alternatively, sync all users in the rotation (not just who's on call)
            var platformAllUsers = new ScheduleSyncRule("platformAllUsers", ScheduleSyncRuleArgs.builder()
                .scheduleId(platform.id())
                .scheduleSyncTargetId(platformTeam.id())
                .syncType("all_users")
                .build());
    
        }
    }
    
    resources:
      # Create a sync target (Slack user group)
      platformOncall:
        type: incident:ScheduleSyncTarget
        name: platform_oncall
        properties:
          addBotToGroup: true
          newSlackUserGroup:
            name: Platform On-Call
            handle: platform-oncall
            description: Current on-call engineers for the Platform team
      # Link a schedule to the sync target
      # Only the current on-call engineer(s) will be synced to the user group
      platformOncallScheduleSyncRule:
        type: incident:ScheduleSyncRule
        name: platform_oncall
        properties:
          scheduleId: ${platform.id}
          scheduleSyncTargetId: ${platformOncall.id}
          syncType: on_call
      # Alternatively, sync all users in the rotation (not just who's on call)
      platformAllUsers:
        type: incident:ScheduleSyncRule
        name: platform_all_users
        properties:
          scheduleId: ${platform.id}
          scheduleSyncTargetId: ${platformTeam.id}
          syncType: all_users
    
    Example coming soon!
    

    Create ScheduleSyncRule Resource

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

    Constructor syntax

    new ScheduleSyncRule(name: string, args: ScheduleSyncRuleArgs, opts?: CustomResourceOptions);
    @overload
    def ScheduleSyncRule(resource_name: str,
                         args: ScheduleSyncRuleArgs,
                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def ScheduleSyncRule(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         schedule_id: Optional[str] = None,
                         schedule_sync_target_id: Optional[str] = None,
                         sync_type: Optional[str] = None)
    func NewScheduleSyncRule(ctx *Context, name string, args ScheduleSyncRuleArgs, opts ...ResourceOption) (*ScheduleSyncRule, error)
    public ScheduleSyncRule(string name, ScheduleSyncRuleArgs args, CustomResourceOptions? opts = null)
    public ScheduleSyncRule(String name, ScheduleSyncRuleArgs args)
    public ScheduleSyncRule(String name, ScheduleSyncRuleArgs args, CustomResourceOptions options)
    
    type: incident:ScheduleSyncRule
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "incident_schedulesyncrule" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args ScheduleSyncRuleArgs
    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 ScheduleSyncRuleArgs
    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 ScheduleSyncRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ScheduleSyncRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ScheduleSyncRuleArgs
    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 scheduleSyncRuleResource = new Incident.ScheduleSyncRule("scheduleSyncRuleResource", new()
    {
        ScheduleId = "string",
        ScheduleSyncTargetId = "string",
        SyncType = "string",
    });
    
    example, err := incident.NewScheduleSyncRule(ctx, "scheduleSyncRuleResource", &incident.ScheduleSyncRuleArgs{
    	ScheduleId:           pulumi.String("string"),
    	ScheduleSyncTargetId: pulumi.String("string"),
    	SyncType:             pulumi.String("string"),
    })
    
    resource "incident_schedulesyncrule" "scheduleSyncRuleResource" {
      schedule_id             = "string"
      schedule_sync_target_id = "string"
      sync_type               = "string"
    }
    
    var scheduleSyncRuleResource = new ScheduleSyncRule("scheduleSyncRuleResource", ScheduleSyncRuleArgs.builder()
        .scheduleId("string")
        .scheduleSyncTargetId("string")
        .syncType("string")
        .build());
    
    schedule_sync_rule_resource = incident.ScheduleSyncRule("scheduleSyncRuleResource",
        schedule_id="string",
        schedule_sync_target_id="string",
        sync_type="string")
    
    const scheduleSyncRuleResource = new incident.ScheduleSyncRule("scheduleSyncRuleResource", {
        scheduleId: "string",
        scheduleSyncTargetId: "string",
        syncType: "string",
    });
    
    type: incident:ScheduleSyncRule
    properties:
        scheduleId: string
        scheduleSyncTargetId: string
        syncType: string
    

    ScheduleSyncRule 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 ScheduleSyncRule resource accepts the following input properties:

    ScheduleId string
    The schedule this rule belongs to
    ScheduleSyncTargetId string
    The sync target ID this rule links to
    SyncType string
    Which schedule members sync to the user group
    ScheduleId string
    The schedule this rule belongs to
    ScheduleSyncTargetId string
    The sync target ID this rule links to
    SyncType string
    Which schedule members sync to the user group
    schedule_id string
    The schedule this rule belongs to
    schedule_sync_target_id string
    The sync target ID this rule links to
    sync_type string
    Which schedule members sync to the user group
    scheduleId String
    The schedule this rule belongs to
    scheduleSyncTargetId String
    The sync target ID this rule links to
    syncType String
    Which schedule members sync to the user group
    scheduleId string
    The schedule this rule belongs to
    scheduleSyncTargetId string
    The sync target ID this rule links to
    syncType string
    Which schedule members sync to the user group
    schedule_id str
    The schedule this rule belongs to
    schedule_sync_target_id str
    The sync target ID this rule links to
    sync_type str
    Which schedule members sync to the user group
    scheduleId String
    The schedule this rule belongs to
    scheduleSyncTargetId String
    The sync target ID this rule links to
    syncType String
    Which schedule members sync to the user group

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ScheduleSyncRule 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 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 ScheduleSyncRule Resource

    Get an existing ScheduleSyncRule 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?: ScheduleSyncRuleState, opts?: CustomResourceOptions): ScheduleSyncRule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            schedule_id: Optional[str] = None,
            schedule_sync_target_id: Optional[str] = None,
            sync_type: Optional[str] = None) -> ScheduleSyncRule
    func GetScheduleSyncRule(ctx *Context, name string, id IDInput, state *ScheduleSyncRuleState, opts ...ResourceOption) (*ScheduleSyncRule, error)
    public static ScheduleSyncRule Get(string name, Input<string> id, ScheduleSyncRuleState? state, CustomResourceOptions? opts = null)
    public static ScheduleSyncRule get(String name, Output<String> id, ScheduleSyncRuleState state, CustomResourceOptions options)
    resources:  _:    type: incident:ScheduleSyncRule    get:      id: ${id}
    import {
      to = incident_schedulesyncrule.example
      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:
    ScheduleId string
    The schedule this rule belongs to
    ScheduleSyncTargetId string
    The sync target ID this rule links to
    SyncType string
    Which schedule members sync to the user group
    ScheduleId string
    The schedule this rule belongs to
    ScheduleSyncTargetId string
    The sync target ID this rule links to
    SyncType string
    Which schedule members sync to the user group
    schedule_id string
    The schedule this rule belongs to
    schedule_sync_target_id string
    The sync target ID this rule links to
    sync_type string
    Which schedule members sync to the user group
    scheduleId String
    The schedule this rule belongs to
    scheduleSyncTargetId String
    The sync target ID this rule links to
    syncType String
    Which schedule members sync to the user group
    scheduleId string
    The schedule this rule belongs to
    scheduleSyncTargetId string
    The sync target ID this rule links to
    syncType string
    Which schedule members sync to the user group
    schedule_id str
    The schedule this rule belongs to
    schedule_sync_target_id str
    The sync target ID this rule links to
    sync_type str
    Which schedule members sync to the user group
    scheduleId String
    The schedule this rule belongs to
    scheduleSyncTargetId String
    The sync target ID this rule links to
    syncType String
    Which schedule members sync to the user group

    Package Details

    Repository
    incident incident-io/terraform-provider-incident
    License
    Notes
    This Pulumi package is based on the incident Terraform Provider.
    Viewing docs for incident 5.38.1
    published on Friday, May 22, 2026 by incident-io

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial