@incident-io/pulumi 0.2.0 → 0.3.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.
@@ -0,0 +1,151 @@
1
+ import * as pulumi from "@pulumi/pulumi";
2
+ import * as inputs from "./types/input";
3
+ import * as outputs from "./types/output";
4
+ /**
5
+ * Manages the structure of a standalone status page: which components it shows, in what order, how they are grouped, and how each is displayed. The page itself is created in the incident.io dashboard; look it up with the `incident.getStatusPage` data source. Components come from `incident.StatusPageComponent`.
6
+ *
7
+ * A group keeps its ID across applies as long as its name does, so links to it stay valid. Renaming a group creates a new one. Display settings left out of the configuration keep whatever the page already has, so a structure adopted from the dashboard keeps its hidden components and uptime settings until the configuration says otherwise.
8
+ *
9
+ * Terraform claims the structure, so it cannot be edited in the dashboard; set `unlockInDashboard` to leave it editable there. Destroying this resource leaves the page's structure in place, since a page always has one; it only stops Terraform managing it. The API key needs the "Configure status pages" permission. Parent and customer pages build their structure from the catalog and cannot be managed here.
10
+ *
11
+ * ## Example Usage
12
+ *
13
+ * ```typescript
14
+ * import * as pulumi from "@pulumi/pulumi";
15
+ * import * as incident from "@incident-io/pulumi";
16
+ *
17
+ * // The page itself is created in the dashboard. Its components can be managed here.
18
+ * const _public = incident.getStatusPage({
19
+ * name: "Our public status page",
20
+ * });
21
+ * const website = new incident.StatusPageComponent("website", {name: "Website"});
22
+ * const api = new incident.StatusPageComponent("api", {name: "API"});
23
+ * const database = new incident.StatusPageComponent("database", {name: "Database"});
24
+ * // The structure is the page's layout: items appear in the order listed, each one either a
25
+ * // single component or a named group of components. Display settings are optional; one left
26
+ * // out keeps whatever the dashboard has.
27
+ * const publicStatusPageStructure = new incident.StatusPageStructure("public", {
28
+ * statusPageId: _public.then(_public => _public.id),
29
+ * displayUptimeMode: "chart_and_percentage",
30
+ * items: [
31
+ * {
32
+ * componentId: website.id,
33
+ * },
34
+ * {
35
+ * group: {
36
+ * name: "Backend",
37
+ * description: "The services behind the website",
38
+ * components: [
39
+ * {
40
+ * componentId: api.id,
41
+ * },
42
+ * {
43
+ * componentId: database.id,
44
+ * displayUptime: false,
45
+ * },
46
+ * ],
47
+ * },
48
+ * },
49
+ * ],
50
+ * });
51
+ * ```
52
+ *
53
+ * ## Import
54
+ *
55
+ * Import is supported using an `import` block or the `pulumi import` command:
56
+ *
57
+ * The `pulumi import` command can be used, for example:
58
+ *
59
+ * !/bin/bash
60
+ *
61
+ * Import a status page's structure using the status page's ID
62
+ * Replace the ID with a real ID from your incident.io organization
63
+ *
64
+ * ```sh
65
+ * $ pulumi import incident:index/statusPageStructure:StatusPageStructure example 01ABC123DEF456GHI789JKL
66
+ * ```
67
+ */
68
+ export declare class StatusPageStructure extends pulumi.CustomResource {
69
+ /**
70
+ * Get an existing StatusPageStructure resource's state with the given name, ID, and optional extra
71
+ * properties used to qualify the lookup.
72
+ *
73
+ * @param name The _unique_ name of the resulting resource.
74
+ * @param id The _unique_ provider ID of the resource to lookup.
75
+ * @param state Any extra arguments used during the lookup.
76
+ * @param opts Optional settings to control the behavior of the CustomResource.
77
+ */
78
+ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: StatusPageStructureState, opts?: pulumi.CustomResourceOptions): StatusPageStructure;
79
+ /**
80
+ * Returns true if the given object is an instance of StatusPageStructure. This is designed to work even
81
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
82
+ */
83
+ static isInstance(obj: any): obj is StatusPageStructure;
84
+ /**
85
+ * How the page shows uptime against its components: `chartAndPercentage`, `chartOnly` or `nothing`. Left out, the page keeps its current setting.
86
+ */
87
+ readonly displayUptimeMode: pulumi.Output<string>;
88
+ /**
89
+ * The components and groups the page shows, in display order. Each item is either a single `componentId`, with its own `hidden` and `displayUptime`, or a `group`, not both.
90
+ */
91
+ readonly items: pulumi.Output<outputs.StatusPageStructureItem[]>;
92
+ /**
93
+ * The ID of the status page whose structure this is. Changing it manages a different page's structure.
94
+ */
95
+ readonly statusPageId: pulumi.Output<string>;
96
+ /**
97
+ * Whether to leave this resource unlocked in the incident.io dashboard, so people can edit it there. Defaults to `false`: Terraform claims what it manages, and a claimed resource cannot be edited in the dashboard. Set it to `true` to leave the resource unclaimed — pair that with `lifecycle { ignoreChanges = [...] }` naming the attributes people edit, or the next apply reverts them. Setting it on a resource Terraform already claimed hands that resource back, and someone disconnecting one in the dashboard shows as no change.
98
+ */
99
+ readonly unlockInDashboard: pulumi.Output<boolean | undefined>;
100
+ /**
101
+ * Create a StatusPageStructure resource with the given unique name, arguments, and options.
102
+ *
103
+ * @param name The _unique_ name of the resource.
104
+ * @param args The arguments to use to populate this resource's properties.
105
+ * @param opts A bag of options that control this resource's behavior.
106
+ */
107
+ constructor(name: string, args: StatusPageStructureArgs, opts?: pulumi.CustomResourceOptions);
108
+ }
109
+ /**
110
+ * Input properties used for looking up and filtering StatusPageStructure resources.
111
+ */
112
+ export interface StatusPageStructureState {
113
+ /**
114
+ * How the page shows uptime against its components: `chartAndPercentage`, `chartOnly` or `nothing`. Left out, the page keeps its current setting.
115
+ */
116
+ displayUptimeMode?: pulumi.Input<string | undefined>;
117
+ /**
118
+ * The components and groups the page shows, in display order. Each item is either a single `componentId`, with its own `hidden` and `displayUptime`, or a `group`, not both.
119
+ */
120
+ items?: pulumi.Input<pulumi.Input<inputs.StatusPageStructureItem>[] | undefined>;
121
+ /**
122
+ * The ID of the status page whose structure this is. Changing it manages a different page's structure.
123
+ */
124
+ statusPageId?: pulumi.Input<string | undefined>;
125
+ /**
126
+ * Whether to leave this resource unlocked in the incident.io dashboard, so people can edit it there. Defaults to `false`: Terraform claims what it manages, and a claimed resource cannot be edited in the dashboard. Set it to `true` to leave the resource unclaimed — pair that with `lifecycle { ignoreChanges = [...] }` naming the attributes people edit, or the next apply reverts them. Setting it on a resource Terraform already claimed hands that resource back, and someone disconnecting one in the dashboard shows as no change.
127
+ */
128
+ unlockInDashboard?: pulumi.Input<boolean | undefined>;
129
+ }
130
+ /**
131
+ * The set of arguments for constructing a StatusPageStructure resource.
132
+ */
133
+ export interface StatusPageStructureArgs {
134
+ /**
135
+ * How the page shows uptime against its components: `chartAndPercentage`, `chartOnly` or `nothing`. Left out, the page keeps its current setting.
136
+ */
137
+ displayUptimeMode?: pulumi.Input<string | undefined>;
138
+ /**
139
+ * The components and groups the page shows, in display order. Each item is either a single `componentId`, with its own `hidden` and `displayUptime`, or a `group`, not both.
140
+ */
141
+ items: pulumi.Input<pulumi.Input<inputs.StatusPageStructureItem>[]>;
142
+ /**
143
+ * The ID of the status page whose structure this is. Changing it manages a different page's structure.
144
+ */
145
+ statusPageId: pulumi.Input<string>;
146
+ /**
147
+ * Whether to leave this resource unlocked in the incident.io dashboard, so people can edit it there. Defaults to `false`: Terraform claims what it manages, and a claimed resource cannot be edited in the dashboard. Set it to `true` to leave the resource unclaimed — pair that with `lifecycle { ignoreChanges = [...] }` naming the attributes people edit, or the next apply reverts them. Setting it on a resource Terraform already claimed hands that resource back, and someone disconnecting one in the dashboard shows as no change.
148
+ */
149
+ unlockInDashboard?: pulumi.Input<boolean | undefined>;
150
+ }
151
+ //# sourceMappingURL=statusPageStructure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statusPageStructure.d.ts","sourceRoot":"","sources":["../statusPageStructure.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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AACH,qBAAa,mBAAoB,SAAQ,MAAM,CAAC,cAAc;IAC1D;;;;;;;;OAQG;WACW,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,wBAAwB,EAAE,IAAI,CAAC,EAAE,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AAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC;IACpE;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACnC;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;CACzD"}
@@ -0,0 +1,148 @@
1
+ "use strict";
2
+ // *** WARNING: this file was generated by pulumi-language-nodejs. ***
3
+ // *** Do not edit by hand unless you're certain you know what you are doing! ***
4
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
+ if (k2 === undefined) k2 = k;
6
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
+ desc = { enumerable: true, get: function() { return m[k]; } };
9
+ }
10
+ Object.defineProperty(o, k2, desc);
11
+ }) : (function(o, m, k, k2) {
12
+ if (k2 === undefined) k2 = k;
13
+ o[k2] = m[k];
14
+ }));
15
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
16
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
17
+ }) : function(o, v) {
18
+ o["default"] = v;
19
+ });
20
+ var __importStar = (this && this.__importStar) || function (mod) {
21
+ if (mod && mod.__esModule) return mod;
22
+ var result = {};
23
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
24
+ __setModuleDefault(result, mod);
25
+ return result;
26
+ };
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ exports.StatusPageStructure = void 0;
29
+ const pulumi = __importStar(require("@pulumi/pulumi"));
30
+ const utilities = __importStar(require("./utilities"));
31
+ /**
32
+ * Manages the structure of a standalone status page: which components it shows, in what order, how they are grouped, and how each is displayed. The page itself is created in the incident.io dashboard; look it up with the `incident.getStatusPage` data source. Components come from `incident.StatusPageComponent`.
33
+ *
34
+ * A group keeps its ID across applies as long as its name does, so links to it stay valid. Renaming a group creates a new one. Display settings left out of the configuration keep whatever the page already has, so a structure adopted from the dashboard keeps its hidden components and uptime settings until the configuration says otherwise.
35
+ *
36
+ * Terraform claims the structure, so it cannot be edited in the dashboard; set `unlockInDashboard` to leave it editable there. Destroying this resource leaves the page's structure in place, since a page always has one; it only stops Terraform managing it. The API key needs the "Configure status pages" permission. Parent and customer pages build their structure from the catalog and cannot be managed here.
37
+ *
38
+ * ## Example Usage
39
+ *
40
+ * ```typescript
41
+ * import * as pulumi from "@pulumi/pulumi";
42
+ * import * as incident from "@incident-io/pulumi";
43
+ *
44
+ * // The page itself is created in the dashboard. Its components can be managed here.
45
+ * const _public = incident.getStatusPage({
46
+ * name: "Our public status page",
47
+ * });
48
+ * const website = new incident.StatusPageComponent("website", {name: "Website"});
49
+ * const api = new incident.StatusPageComponent("api", {name: "API"});
50
+ * const database = new incident.StatusPageComponent("database", {name: "Database"});
51
+ * // The structure is the page's layout: items appear in the order listed, each one either a
52
+ * // single component or a named group of components. Display settings are optional; one left
53
+ * // out keeps whatever the dashboard has.
54
+ * const publicStatusPageStructure = new incident.StatusPageStructure("public", {
55
+ * statusPageId: _public.then(_public => _public.id),
56
+ * displayUptimeMode: "chart_and_percentage",
57
+ * items: [
58
+ * {
59
+ * componentId: website.id,
60
+ * },
61
+ * {
62
+ * group: {
63
+ * name: "Backend",
64
+ * description: "The services behind the website",
65
+ * components: [
66
+ * {
67
+ * componentId: api.id,
68
+ * },
69
+ * {
70
+ * componentId: database.id,
71
+ * displayUptime: false,
72
+ * },
73
+ * ],
74
+ * },
75
+ * },
76
+ * ],
77
+ * });
78
+ * ```
79
+ *
80
+ * ## Import
81
+ *
82
+ * Import is supported using an `import` block or the `pulumi import` command:
83
+ *
84
+ * The `pulumi import` command can be used, for example:
85
+ *
86
+ * !/bin/bash
87
+ *
88
+ * Import a status page's structure using the status page's ID
89
+ * Replace the ID with a real ID from your incident.io organization
90
+ *
91
+ * ```sh
92
+ * $ pulumi import incident:index/statusPageStructure:StatusPageStructure example 01ABC123DEF456GHI789JKL
93
+ * ```
94
+ */
95
+ class StatusPageStructure extends pulumi.CustomResource {
96
+ /**
97
+ * Get an existing StatusPageStructure resource's state with the given name, ID, and optional extra
98
+ * properties used to qualify the lookup.
99
+ *
100
+ * @param name The _unique_ name of the resulting resource.
101
+ * @param id The _unique_ provider ID of the resource to lookup.
102
+ * @param state Any extra arguments used during the lookup.
103
+ * @param opts Optional settings to control the behavior of the CustomResource.
104
+ */
105
+ static get(name, id, state, opts) {
106
+ return new StatusPageStructure(name, state, { ...opts, id: id });
107
+ }
108
+ /** @internal */
109
+ static __pulumiType = 'incident:index/statusPageStructure:StatusPageStructure';
110
+ /**
111
+ * Returns true if the given object is an instance of StatusPageStructure. This is designed to work even
112
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
113
+ */
114
+ static isInstance(obj) {
115
+ if (obj === undefined || obj === null) {
116
+ return false;
117
+ }
118
+ return obj['__pulumiType'] === StatusPageStructure.__pulumiType;
119
+ }
120
+ constructor(name, argsOrState, opts) {
121
+ let resourceInputs = {};
122
+ opts = opts || {};
123
+ if (opts.id) {
124
+ const state = argsOrState;
125
+ resourceInputs["displayUptimeMode"] = state?.displayUptimeMode;
126
+ resourceInputs["items"] = state?.items;
127
+ resourceInputs["statusPageId"] = state?.statusPageId;
128
+ resourceInputs["unlockInDashboard"] = state?.unlockInDashboard;
129
+ }
130
+ else {
131
+ const args = argsOrState;
132
+ if (args?.items === undefined && !opts.urn) {
133
+ throw new Error("Missing required property 'items'");
134
+ }
135
+ if (args?.statusPageId === undefined && !opts.urn) {
136
+ throw new Error("Missing required property 'statusPageId'");
137
+ }
138
+ resourceInputs["displayUptimeMode"] = args?.displayUptimeMode;
139
+ resourceInputs["items"] = args?.items;
140
+ resourceInputs["statusPageId"] = args?.statusPageId;
141
+ resourceInputs["unlockInDashboard"] = args?.unlockInDashboard;
142
+ }
143
+ opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
144
+ super(StatusPageStructure.__pulumiType, name, resourceInputs, opts);
145
+ }
146
+ }
147
+ exports.StatusPageStructure = StatusPageStructure;
148
+ //# sourceMappingURL=statusPageStructure.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statusPageStructure.js","sourceRoot":"","sources":["../statusPageStructure.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,iFAAiF;;;;;;;;;;;;;;;;;;;;;;;;;;AAEjF,uDAAyC;AAGzC,uDAAyC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AACH,MAAa,mBAAoB,SAAQ,MAAM,CAAC,cAAc;IAC1D;;;;;;;;OAQG;IACI,MAAM,CAAC,GAAG,CAAC,IAAY,EAAE,EAA2B,EAAE,KAAgC,EAAE,IAAmC;QAC9H,OAAO,IAAI,mBAAmB,CAAC,IAAI,EAAO,KAAK,EAAE,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED,gBAAgB;IACT,MAAM,CAAU,YAAY,GAAG,wDAAwD,CAAC;IAE/F;;;OAGG;IACI,MAAM,CAAC,UAAU,CAAC,GAAQ;QAC7B,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,EAAE;YACnC,OAAO,KAAK,CAAC;SAChB;QACD,OAAO,GAAG,CAAC,cAAc,CAAC,KAAK,mBAAmB,CAAC,YAAY,CAAC;IACpE,CAAC;IA2BD,YAAY,IAAY,EAAE,WAAgE,EAAE,IAAmC;QAC3H,IAAI,cAAc,GAAkB,EAAE,CAAC;QACvC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QAClB,IAAI,IAAI,CAAC,EAAE,EAAE;YACT,MAAM,KAAK,GAAG,WAAmD,CAAC;YAClE,cAAc,CAAC,mBAAmB,CAAC,GAAG,KAAK,EAAE,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