@pulumi/pagerduty
Version:
A Pulumi package for creating and managing pagerduty cloud resources.
190 lines • 6.94 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* A [v3 schedule](https://developer.pagerduty.com/api-reference/d90c4c94e3ce2-create-a-schedule) determines the time periods that users are on call using flexible rotation configurations. This resource uses the PagerDuty v3 Schedules API, which supports per-event assignment strategies and RFC 5545 recurrence rules.
*
* > **Note:** This resource requires the `flexible-schedules-early-access` early access flag on your PagerDuty account. The required `X-Early-Access` header is sent automatically by the provider.
*
* ## Example Usage
*
* ### Rotating member assignment
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pagerduty from "@pulumi/pagerduty";
*
* const example = new pagerduty.User("example", {
* name: "Earline Greenholt",
* email: "earline@example.com",
* });
* const exampleSchedulev2 = new pagerduty.Schedulev2("example", {
* name: "Engineering On-Call",
* timeZone: "America/New_York",
* description: "Managed by Pulumi",
* rotations: [{
* events: [{
* name: "Weekday Business Hours",
* startTime: "2026-06-01T09:00:00Z",
* endTime: "2026-06-01T17:00:00Z",
* effectiveSince: "2026-06-01T09:00:00Z",
* recurrences: ["RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR"],
* assignmentStrategies: [{
* type: "rotating_member_assignment_strategy",
* shiftsPerMember: 1,
* members: [{
* type: "user_member",
* userId: example.id,
* }],
* }],
* }],
* }],
* });
* ```
*
* ### Every-member assignment (all members on-call simultaneously)
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pagerduty from "@pulumi/pagerduty";
*
* const primary = new pagerduty.User("primary", {
* name: "Alice",
* email: "alice@example.com",
* });
* const secondary = new pagerduty.User("secondary", {
* name: "Bob",
* email: "bob@example.com",
* });
* const allHands = new pagerduty.Schedulev2("all_hands", {
* name: "Weekend All-Hands On-Call",
* timeZone: "UTC",
* rotations: [{
* events: [{
* name: "Weekend Coverage",
* startTime: "2026-06-06T00:00:00Z",
* endTime: "2026-06-07T23:59:00Z",
* effectiveSince: "2026-06-06T00:00:00Z",
* recurrences: ["RRULE:FREQ=WEEKLY;BYDAY=SA,SU"],
* assignmentStrategies: [{
* type: "every_member_assignment_strategy",
* members: [
* {
* type: "user_member",
* userId: primary.id,
* },
* {
* type: "user_member",
* userId: secondary.id,
* },
* ],
* }],
* }],
* }],
* });
* ```
*
* ## Import
*
* Schedules can be imported using the schedule `id`, e.g.
*
* ```sh
* $ pulumi import pagerduty:index/schedulev2:Schedulev2 example P1234AB
* ```
*/
export declare class Schedulev2 extends pulumi.CustomResource {
/**
* Get an existing Schedulev2 resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: Schedulev2State, opts?: pulumi.CustomResourceOptions): Schedulev2;
/**
* Returns true if the given object is an instance of Schedulev2. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is Schedulev2;
/**
* A description of the schedule. Maximum 1024 characters.
*/
readonly description: pulumi.Output<string>;
/**
* The name of the schedule. Maximum 255 characters.
*/
readonly name: pulumi.Output<string>;
/**
* One or more rotation blocks. Rotations documented below.
*/
readonly rotations: pulumi.Output<outputs.Schedulev2Rotation[] | undefined>;
/**
* List of team IDs to associate with this schedule.
*/
readonly teams: pulumi.Output<string[] | undefined>;
/**
* The time zone of the schedule (IANA format, e.g. `America/New_York`).
*/
readonly timeZone: pulumi.Output<string>;
/**
* Create a Schedulev2 resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: Schedulev2Args, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Schedulev2 resources.
*/
export interface Schedulev2State {
/**
* A description of the schedule. Maximum 1024 characters.
*/
description?: pulumi.Input<string | undefined>;
/**
* The name of the schedule. Maximum 255 characters.
*/
name?: pulumi.Input<string | undefined>;
/**
* One or more rotation blocks. Rotations documented below.
*/
rotations?: pulumi.Input<pulumi.Input<inputs.Schedulev2Rotation>[] | undefined>;
/**
* List of team IDs to associate with this schedule.
*/
teams?: pulumi.Input<pulumi.Input<string>[] | undefined>;
/**
* The time zone of the schedule (IANA format, e.g. `America/New_York`).
*/
timeZone?: pulumi.Input<string | undefined>;
}
/**
* The set of arguments for constructing a Schedulev2 resource.
*/
export interface Schedulev2Args {
/**
* A description of the schedule. Maximum 1024 characters.
*/
description?: pulumi.Input<string | undefined>;
/**
* The name of the schedule. Maximum 255 characters.
*/
name?: pulumi.Input<string | undefined>;
/**
* One or more rotation blocks. Rotations documented below.
*/
rotations?: pulumi.Input<pulumi.Input<inputs.Schedulev2Rotation>[] | undefined>;
/**
* List of team IDs to associate with this schedule.
*/
teams?: pulumi.Input<pulumi.Input<string>[] | undefined>;
/**
* The time zone of the schedule (IANA format, e.g. `America/New_York`).
*/
timeZone: pulumi.Input<string>;
}
//# sourceMappingURL=schedulev2.d.ts.map