@pulumi/pagerduty 4.33.0 → 4.33.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/getSchedulev2.d.ts +2 -6
- package/getSchedulev2.d.ts.map +1 -1
- package/getSchedulev2.js +2 -6
- package/getSchedulev2.js.map +1 -1
- package/package.json +2 -2
- package/schedulev2.d.ts +117 -1
- package/schedulev2.d.ts.map +1 -1
- package/schedulev2.js +117 -1
- package/schedulev2.js.map +1 -1
package/getSchedulev2.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import * as pulumi from "@pulumi/pulumi";
|
|
2
2
|
/**
|
|
3
|
-
* Use this data source to look up a specific [v3 schedule](https://developer.pagerduty.com/api-reference/e792b51909787-create-a-schedule) by name so you can reference its ID in other resources such as escalation policies.
|
|
4
|
-
*
|
|
5
|
-
* > **Note:** This data source 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.
|
|
3
|
+
* Use this data source to look up a specific [v3 schedule](https://developer.pagerduty.com/api-reference/e792b51909787-create-a-schedule) by name so you can reference its ID in other resources such as escalation policies. This data source looks up shift-based (v3) schedules; for legacy schedules use the [`pagerduty.Schedule`](https://www.terraform.io/docs/providers/pagerduty/d/schedule.html) data source.
|
|
6
4
|
*
|
|
7
5
|
* ## Example Usage
|
|
8
6
|
*
|
|
@@ -50,9 +48,7 @@ export interface GetSchedulev2Result {
|
|
|
50
48
|
readonly name: string;
|
|
51
49
|
}
|
|
52
50
|
/**
|
|
53
|
-
* Use this data source to look up a specific [v3 schedule](https://developer.pagerduty.com/api-reference/e792b51909787-create-a-schedule) by name so you can reference its ID in other resources such as escalation policies.
|
|
54
|
-
*
|
|
55
|
-
* > **Note:** This data source 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.
|
|
51
|
+
* Use this data source to look up a specific [v3 schedule](https://developer.pagerduty.com/api-reference/e792b51909787-create-a-schedule) by name so you can reference its ID in other resources such as escalation policies. This data source looks up shift-based (v3) schedules; for legacy schedules use the [`pagerduty.Schedule`](https://www.terraform.io/docs/providers/pagerduty/d/schedule.html) data source.
|
|
56
52
|
*
|
|
57
53
|
* ## Example Usage
|
|
58
54
|
*
|
package/getSchedulev2.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSchedulev2.d.ts","sourceRoot":"","sources":["../getSchedulev2.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AAGzC
|
|
1
|
+
{"version":3,"file":"getSchedulev2.d.ts","sourceRoot":"","sources":["../getSchedulev2.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AAGzC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,iBAAiB,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,aAAa,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAKhH;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAC9B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACzB;AACD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,uBAAuB,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAKxI;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;CAC9B"}
|
package/getSchedulev2.js
CHANGED
|
@@ -29,9 +29,7 @@ exports.getSchedulev2Output = exports.getSchedulev2 = void 0;
|
|
|
29
29
|
const pulumi = __importStar(require("@pulumi/pulumi"));
|
|
30
30
|
const utilities = __importStar(require("./utilities"));
|
|
31
31
|
/**
|
|
32
|
-
* Use this data source to look up a specific [v3 schedule](https://developer.pagerduty.com/api-reference/e792b51909787-create-a-schedule) by name so you can reference its ID in other resources such as escalation policies.
|
|
33
|
-
*
|
|
34
|
-
* > **Note:** This data source 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.
|
|
32
|
+
* Use this data source to look up a specific [v3 schedule](https://developer.pagerduty.com/api-reference/e792b51909787-create-a-schedule) by name so you can reference its ID in other resources such as escalation policies. This data source looks up shift-based (v3) schedules; for legacy schedules use the [`pagerduty.Schedule`](https://www.terraform.io/docs/providers/pagerduty/d/schedule.html) data source.
|
|
35
33
|
*
|
|
36
34
|
* ## Example Usage
|
|
37
35
|
*
|
|
@@ -63,9 +61,7 @@ function getSchedulev2(args, opts) {
|
|
|
63
61
|
}
|
|
64
62
|
exports.getSchedulev2 = getSchedulev2;
|
|
65
63
|
/**
|
|
66
|
-
* Use this data source to look up a specific [v3 schedule](https://developer.pagerduty.com/api-reference/e792b51909787-create-a-schedule) by name so you can reference its ID in other resources such as escalation policies.
|
|
67
|
-
*
|
|
68
|
-
* > **Note:** This data source 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.
|
|
64
|
+
* Use this data source to look up a specific [v3 schedule](https://developer.pagerduty.com/api-reference/e792b51909787-create-a-schedule) by name so you can reference its ID in other resources such as escalation policies. This data source looks up shift-based (v3) schedules; for legacy schedules use the [`pagerduty.Schedule`](https://www.terraform.io/docs/providers/pagerduty/d/schedule.html) data source.
|
|
69
65
|
*
|
|
70
66
|
* ## Example Usage
|
|
71
67
|
*
|
package/getSchedulev2.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSchedulev2.js","sourceRoot":"","sources":["../getSchedulev2.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,iFAAiF;;;;;;;;;;;;;;;;;;;;;;;;;;AAEjF,uDAAyC;AACzC,uDAAyC;AAEzC
|
|
1
|
+
{"version":3,"file":"getSchedulev2.js","sourceRoot":"","sources":["../getSchedulev2.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,iFAAiF;;;;;;;;;;;;;;;;;;;;;;;;;;AAEjF,uDAAyC;AACzC,uDAAyC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,SAAgB,aAAa,CAAC,IAAuB,EAAE,IAA2B;IAC9E,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,oBAAoB,EAAE,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC;IACzE,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,6CAA6C,EAAE;QACxE,MAAM,EAAE,IAAI,CAAC,IAAI;KACpB,EAAE,IAAI,CAAC,CAAC;AACb,CAAC;AALD,sCAKC;AAyBD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,SAAgB,mBAAmB,CAAC,IAA6B,EAAE,IAAiC;IAChG,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,oBAAoB,EAAE,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC;IACzE,OAAO,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,6CAA6C,EAAE;QAC9E,MAAM,EAAE,IAAI,CAAC,IAAI;KACpB,EAAE,IAAI,CAAC,CAAC;AACb,CAAC;AALD,kDAKC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pulumi/pagerduty",
|
|
3
|
-
"version": "4.33.
|
|
3
|
+
"version": "4.33.1",
|
|
4
4
|
"description": "A Pulumi package for creating and managing pagerduty cloud resources.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pulumi",
|
|
@@ -23,6 +23,6 @@
|
|
|
23
23
|
"pulumi": {
|
|
24
24
|
"resource": true,
|
|
25
25
|
"name": "pagerduty",
|
|
26
|
-
"version": "4.33.
|
|
26
|
+
"version": "4.33.1"
|
|
27
27
|
}
|
|
28
28
|
}
|
package/schedulev2.d.ts
CHANGED
|
@@ -4,7 +4,16 @@ import * as outputs from "./types/output";
|
|
|
4
4
|
/**
|
|
5
5
|
* 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.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* ## Schedule versions and resource naming
|
|
8
|
+
*
|
|
9
|
+
* The Terraform resource names do not line up one-to-one with the API version numbers, which is a common source of confusion. The table below maps the two:
|
|
10
|
+
*
|
|
11
|
+
* | Schedule type | Terraform resource | API version |
|
|
12
|
+
* | -------------------- | ---------------------- | ---------------------- |
|
|
13
|
+
* | Legacy schedule | `pagerduty.Schedule` | v2 (Accept header) |
|
|
14
|
+
* | Shift-based schedule | `pagerduty.Schedulev2` | v3 (in the URL path) |
|
|
15
|
+
*
|
|
16
|
+
* `pagerduty.Schedule` manages the legacy schedule (now deprecated); `pagerduty.Schedulev2` manages the newer shift-based schedule. In the UI, legacy schedules are marked with a `legacy` tag on the schedules list page.
|
|
8
17
|
*
|
|
9
18
|
* ## Example Usage
|
|
10
19
|
*
|
|
@@ -84,6 +93,113 @@ import * as outputs from "./types/output";
|
|
|
84
93
|
* });
|
|
85
94
|
* ```
|
|
86
95
|
*
|
|
96
|
+
* ## Migrating from `pagerduty.Schedule`
|
|
97
|
+
*
|
|
98
|
+
* The legacy `pagerduty.Schedule` resource models on-call coverage with `layer` blocks (a list of `users` rotating on a fixed `rotationTurnLengthSeconds`, optionally constrained by `restriction` blocks). The shift-based `pagerduty.Schedulev2` resource models the same coverage with `rotation` → `event` blocks, where an `assignmentStrategy` decides how the listed `member`s cover each occurrence of an RFC 5545 `recurrence`.
|
|
99
|
+
*
|
|
100
|
+
* The most common legacy shape is a single layer with several users handing off once per week (a 24/7 weekly rotation) and one or more team associations. The example below shows that shape before and after migration.
|
|
101
|
+
*
|
|
102
|
+
* **Before** — legacy `pagerduty.Schedule` (single `OnCall` layer, six users, weekly handoff, two teams):
|
|
103
|
+
*
|
|
104
|
+
* ```typescript
|
|
105
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
106
|
+
* import * as pagerduty from "@pulumi/pagerduty";
|
|
107
|
+
*
|
|
108
|
+
* const exampleOncall = new pagerduty.Schedule("example_oncall", {
|
|
109
|
+
* name: "Example OnCall Schedule",
|
|
110
|
+
* description: "A Example OnCall Schedule.",
|
|
111
|
+
* timeZone: "Europe/Amsterdam",
|
|
112
|
+
* layers: [{
|
|
113
|
+
* name: "OnCall",
|
|
114
|
+
* start: "2024-06-24T00:00:00-00:00",
|
|
115
|
+
* rotationVirtualStart: "2025-03-17T07:00:00+02:00",
|
|
116
|
+
* rotationTurnLengthSeconds: 604800,
|
|
117
|
+
* users: [
|
|
118
|
+
* user1.id,
|
|
119
|
+
* user2.id,
|
|
120
|
+
* user3.id,
|
|
121
|
+
* user4.id,
|
|
122
|
+
* user5.id,
|
|
123
|
+
* user6.id,
|
|
124
|
+
* ],
|
|
125
|
+
* }],
|
|
126
|
+
* teams: [
|
|
127
|
+
* k8sPlatform.id,
|
|
128
|
+
* k8sOperational.id,
|
|
129
|
+
* ],
|
|
130
|
+
* });
|
|
131
|
+
* ```
|
|
132
|
+
*
|
|
133
|
+
* **After** — equivalent `pagerduty.Schedulev2`:
|
|
134
|
+
*
|
|
135
|
+
* ```typescript
|
|
136
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
137
|
+
* import * as pagerduty from "@pulumi/pagerduty";
|
|
138
|
+
*
|
|
139
|
+
* const exampleOncall = new pagerduty.Schedulev2("example_oncall", {
|
|
140
|
+
* name: "Example OnCall Schedule",
|
|
141
|
+
* description: "A Example OnCall Schedule.",
|
|
142
|
+
* timeZone: "Europe/Amsterdam",
|
|
143
|
+
* teams: [
|
|
144
|
+
* k8sPlatform.id,
|
|
145
|
+
* k8sOperational.id,
|
|
146
|
+
* ],
|
|
147
|
+
* rotations: [{
|
|
148
|
+
* events: [{
|
|
149
|
+
* name: "OnCall",
|
|
150
|
+
* startTime: "2025-03-17T07:00:00+02:00",
|
|
151
|
+
* endTime: "2025-03-24T07:00:00+02:00",
|
|
152
|
+
* effectiveSince: "2025-03-17T07:00:00+02:00",
|
|
153
|
+
* recurrences: ["RRULE:FREQ=WEEKLY"],
|
|
154
|
+
* assignmentStrategies: [{
|
|
155
|
+
* type: "rotating_member_assignment_strategy",
|
|
156
|
+
* shiftsPerMember: 1,
|
|
157
|
+
* members: [
|
|
158
|
+
* {
|
|
159
|
+
* type: "user_member",
|
|
160
|
+
* userId: user1.id,
|
|
161
|
+
* },
|
|
162
|
+
* {
|
|
163
|
+
* type: "user_member",
|
|
164
|
+
* userId: user2.id,
|
|
165
|
+
* },
|
|
166
|
+
* {
|
|
167
|
+
* type: "user_member",
|
|
168
|
+
* userId: user3.id,
|
|
169
|
+
* },
|
|
170
|
+
* {
|
|
171
|
+
* type: "user_member",
|
|
172
|
+
* userId: user4.id,
|
|
173
|
+
* },
|
|
174
|
+
* {
|
|
175
|
+
* type: "user_member",
|
|
176
|
+
* userId: user5.id,
|
|
177
|
+
* },
|
|
178
|
+
* {
|
|
179
|
+
* type: "user_member",
|
|
180
|
+
* userId: user6.id,
|
|
181
|
+
* },
|
|
182
|
+
* ],
|
|
183
|
+
* }],
|
|
184
|
+
* }],
|
|
185
|
+
* }],
|
|
186
|
+
* });
|
|
187
|
+
* ```
|
|
188
|
+
*
|
|
189
|
+
* Field mapping:
|
|
190
|
+
*
|
|
191
|
+
* | Legacy (`pagerduty.Schedule`) | Shift-based (`pagerduty.Schedulev2`) |
|
|
192
|
+
* | ------------------------------------- | -------------------------------------------------------------------- |
|
|
193
|
+
* | `layer` | `rotation` (one `rotation` per layer) |
|
|
194
|
+
* | `layer.name` | `rotation.event.name` |
|
|
195
|
+
* | `layer.users` | `assignment_strategy.member` (one `member` per user) |
|
|
196
|
+
* | `layer.rotation_turn_length_seconds` | `event.start_time`/`endTime` window + `recurrence` (e.g. one week → 7-day window + `RRULE:FREQ=WEEKLY`) |
|
|
197
|
+
* | `layer.rotation_virtual_start` | `event.start_time` / `effectiveSince` |
|
|
198
|
+
* | `layer.restriction` | a narrower `event` window plus a `BYDAY`/`BYHOUR` `RRULE` |
|
|
199
|
+
* | `teams` | `teams` (unchanged) |
|
|
200
|
+
*
|
|
201
|
+
* > **Note:** Multiple members rotate when `assignment_strategy.type` is `"rotatingMemberAssignmentStrategy"`; use `"everyMemberAssignmentStrategy"` when everyone should be on call simultaneously. To reproduce a legacy `restriction` (e.g. weekday business hours), narrow the `event` window and encode the days/hours in the `RRULE` — see the *Rotating member assignment* example above.
|
|
202
|
+
*
|
|
87
203
|
* ## Import
|
|
88
204
|
*
|
|
89
205
|
* Schedules can be imported using the schedule `id`, e.g.
|
package/schedulev2.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedulev2.d.ts","sourceRoot":"","sources":["../schedulev2.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AACzC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAG1C
|
|
1
|
+
{"version":3,"file":"schedulev2.d.ts","sourceRoot":"","sources":["../schedulev2.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AACzC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAG1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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C;IAC/C;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACxC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,kBAAkB,CAAC,EAAE,GAAG,SAAS,CAAC,CAAC;IAChF;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,GAAG,SAAS,CAAC,CAAC;IACzD;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CAC/C;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC/C;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACxC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,kBAAkB,CAAC,EAAE,GAAG,SAAS,CAAC,CAAC;IAChF;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,GAAG,SAAS,CAAC,CAAC;IACzD;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;CAClC"}
|
package/schedulev2.js
CHANGED
|
@@ -31,7 +31,16 @@ const utilities = __importStar(require("./utilities"));
|
|
|
31
31
|
/**
|
|
32
32
|
* 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.
|
|
33
33
|
*
|
|
34
|
-
*
|
|
34
|
+
* ## Schedule versions and resource naming
|
|
35
|
+
*
|
|
36
|
+
* The Terraform resource names do not line up one-to-one with the API version numbers, which is a common source of confusion. The table below maps the two:
|
|
37
|
+
*
|
|
38
|
+
* | Schedule type | Terraform resource | API version |
|
|
39
|
+
* | -------------------- | ---------------------- | ---------------------- |
|
|
40
|
+
* | Legacy schedule | `pagerduty.Schedule` | v2 (Accept header) |
|
|
41
|
+
* | Shift-based schedule | `pagerduty.Schedulev2` | v3 (in the URL path) |
|
|
42
|
+
*
|
|
43
|
+
* `pagerduty.Schedule` manages the legacy schedule (now deprecated); `pagerduty.Schedulev2` manages the newer shift-based schedule. In the UI, legacy schedules are marked with a `legacy` tag on the schedules list page.
|
|
35
44
|
*
|
|
36
45
|
* ## Example Usage
|
|
37
46
|
*
|
|
@@ -111,6 +120,113 @@ const utilities = __importStar(require("./utilities"));
|
|
|
111
120
|
* });
|
|
112
121
|
* ```
|
|
113
122
|
*
|
|
123
|
+
* ## Migrating from `pagerduty.Schedule`
|
|
124
|
+
*
|
|
125
|
+
* The legacy `pagerduty.Schedule` resource models on-call coverage with `layer` blocks (a list of `users` rotating on a fixed `rotationTurnLengthSeconds`, optionally constrained by `restriction` blocks). The shift-based `pagerduty.Schedulev2` resource models the same coverage with `rotation` → `event` blocks, where an `assignmentStrategy` decides how the listed `member`s cover each occurrence of an RFC 5545 `recurrence`.
|
|
126
|
+
*
|
|
127
|
+
* The most common legacy shape is a single layer with several users handing off once per week (a 24/7 weekly rotation) and one or more team associations. The example below shows that shape before and after migration.
|
|
128
|
+
*
|
|
129
|
+
* **Before** — legacy `pagerduty.Schedule` (single `OnCall` layer, six users, weekly handoff, two teams):
|
|
130
|
+
*
|
|
131
|
+
* ```typescript
|
|
132
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
133
|
+
* import * as pagerduty from "@pulumi/pagerduty";
|
|
134
|
+
*
|
|
135
|
+
* const exampleOncall = new pagerduty.Schedule("example_oncall", {
|
|
136
|
+
* name: "Example OnCall Schedule",
|
|
137
|
+
* description: "A Example OnCall Schedule.",
|
|
138
|
+
* timeZone: "Europe/Amsterdam",
|
|
139
|
+
* layers: [{
|
|
140
|
+
* name: "OnCall",
|
|
141
|
+
* start: "2024-06-24T00:00:00-00:00",
|
|
142
|
+
* rotationVirtualStart: "2025-03-17T07:00:00+02:00",
|
|
143
|
+
* rotationTurnLengthSeconds: 604800,
|
|
144
|
+
* users: [
|
|
145
|
+
* user1.id,
|
|
146
|
+
* user2.id,
|
|
147
|
+
* user3.id,
|
|
148
|
+
* user4.id,
|
|
149
|
+
* user5.id,
|
|
150
|
+
* user6.id,
|
|
151
|
+
* ],
|
|
152
|
+
* }],
|
|
153
|
+
* teams: [
|
|
154
|
+
* k8sPlatform.id,
|
|
155
|
+
* k8sOperational.id,
|
|
156
|
+
* ],
|
|
157
|
+
* });
|
|
158
|
+
* ```
|
|
159
|
+
*
|
|
160
|
+
* **After** — equivalent `pagerduty.Schedulev2`:
|
|
161
|
+
*
|
|
162
|
+
* ```typescript
|
|
163
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
164
|
+
* import * as pagerduty from "@pulumi/pagerduty";
|
|
165
|
+
*
|
|
166
|
+
* const exampleOncall = new pagerduty.Schedulev2("example_oncall", {
|
|
167
|
+
* name: "Example OnCall Schedule",
|
|
168
|
+
* description: "A Example OnCall Schedule.",
|
|
169
|
+
* timeZone: "Europe/Amsterdam",
|
|
170
|
+
* teams: [
|
|
171
|
+
* k8sPlatform.id,
|
|
172
|
+
* k8sOperational.id,
|
|
173
|
+
* ],
|
|
174
|
+
* rotations: [{
|
|
175
|
+
* events: [{
|
|
176
|
+
* name: "OnCall",
|
|
177
|
+
* startTime: "2025-03-17T07:00:00+02:00",
|
|
178
|
+
* endTime: "2025-03-24T07:00:00+02:00",
|
|
179
|
+
* effectiveSince: "2025-03-17T07:00:00+02:00",
|
|
180
|
+
* recurrences: ["RRULE:FREQ=WEEKLY"],
|
|
181
|
+
* assignmentStrategies: [{
|
|
182
|
+
* type: "rotating_member_assignment_strategy",
|
|
183
|
+
* shiftsPerMember: 1,
|
|
184
|
+
* members: [
|
|
185
|
+
* {
|
|
186
|
+
* type: "user_member",
|
|
187
|
+
* userId: user1.id,
|
|
188
|
+
* },
|
|
189
|
+
* {
|
|
190
|
+
* type: "user_member",
|
|
191
|
+
* userId: user2.id,
|
|
192
|
+
* },
|
|
193
|
+
* {
|
|
194
|
+
* type: "user_member",
|
|
195
|
+
* userId: user3.id,
|
|
196
|
+
* },
|
|
197
|
+
* {
|
|
198
|
+
* type: "user_member",
|
|
199
|
+
* userId: user4.id,
|
|
200
|
+
* },
|
|
201
|
+
* {
|
|
202
|
+
* type: "user_member",
|
|
203
|
+
* userId: user5.id,
|
|
204
|
+
* },
|
|
205
|
+
* {
|
|
206
|
+
* type: "user_member",
|
|
207
|
+
* userId: user6.id,
|
|
208
|
+
* },
|
|
209
|
+
* ],
|
|
210
|
+
* }],
|
|
211
|
+
* }],
|
|
212
|
+
* }],
|
|
213
|
+
* });
|
|
214
|
+
* ```
|
|
215
|
+
*
|
|
216
|
+
* Field mapping:
|
|
217
|
+
*
|
|
218
|
+
* | Legacy (`pagerduty.Schedule`) | Shift-based (`pagerduty.Schedulev2`) |
|
|
219
|
+
* | ------------------------------------- | -------------------------------------------------------------------- |
|
|
220
|
+
* | `layer` | `rotation` (one `rotation` per layer) |
|
|
221
|
+
* | `layer.name` | `rotation.event.name` |
|
|
222
|
+
* | `layer.users` | `assignment_strategy.member` (one `member` per user) |
|
|
223
|
+
* | `layer.rotation_turn_length_seconds` | `event.start_time`/`endTime` window + `recurrence` (e.g. one week → 7-day window + `RRULE:FREQ=WEEKLY`) |
|
|
224
|
+
* | `layer.rotation_virtual_start` | `event.start_time` / `effectiveSince` |
|
|
225
|
+
* | `layer.restriction` | a narrower `event` window plus a `BYDAY`/`BYHOUR` `RRULE` |
|
|
226
|
+
* | `teams` | `teams` (unchanged) |
|
|
227
|
+
*
|
|
228
|
+
* > **Note:** Multiple members rotate when `assignment_strategy.type` is `"rotatingMemberAssignmentStrategy"`; use `"everyMemberAssignmentStrategy"` when everyone should be on call simultaneously. To reproduce a legacy `restriction` (e.g. weekday business hours), narrow the `event` window and encode the days/hours in the `RRULE` — see the *Rotating member assignment* example above.
|
|
229
|
+
*
|
|
114
230
|
* ## Import
|
|
115
231
|
*
|
|
116
232
|
* Schedules can be imported using the schedule `id`, e.g.
|
package/schedulev2.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedulev2.js","sourceRoot":"","sources":["../schedulev2.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,iFAAiF;;;;;;;;;;;;;;;;;;;;;;;;;;AAEjF,uDAAyC;AAGzC,uDAAyC;AAEzC
|
|
1
|
+
{"version":3,"file":"schedulev2.js","sourceRoot":"","sources":["../schedulev2.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,iFAAiF;;;;;;;;;;;;;;;;;;;;;;;;;;AAEjF,uDAAyC;AAGzC,uDAAyC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8MG;AACH,MAAa,UAAW,SAAQ,MAAM,CAAC,cAAc;IACjD;;;;;;;;OAQG;IACI,MAAM,CAAC,GAAG,CAAC,IAAY,EAAE,EAA2B,EAAE,KAAuB,EAAE,IAAmC;QACrH,OAAO,IAAI,UAAU,CAAC,IAAI,EAAO,KAAK,EAAE,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IACjE,CAAC;IAED,gB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