@pulumi/pagerduty
Version:
A Pulumi package for creating and managing pagerduty cloud resources.
131 lines • 5.87 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.AutomationActionsRunner = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("./utilities"));
/**
* An Automation Actions [runner](https://developer.pagerduty.com/api-reference/d78999fb7e863-create-an-automation-action-runner) is the method for how actions are executed. This can be done locally using an installed runner agent or as a connection to a PD Runbook Automation instance.
*
* > Only Runbook Automation (runbook) runners can be created.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pagerduty from "@pulumi/pagerduty";
*
* const config = new pulumi.Config();
* const RUNBOOK_API_KEY = config.require("RUNBOOK_API_KEY");
* const example = new pagerduty.AutomationActionsRunner("example", {
* name: "Runner created via TF",
* description: "Description of the Runner created via TF",
* runnerType: "runbook",
* runbookBaseUri: "rdcat.stg",
* runbookApiKey: RUNBOOK_API_KEY,
* });
* ```
*
* ## Import
*
* > In the example below the `runbookApiKey` attribute has been omitted to avoid resource replacement after the import.
*
* Runners can be imported using the `id`, e.g.
*
* ```sh
* resource "pagerduty_automation_actions_runner" "example" {
* name = "Runner created via TF"
* description = "Description of the Runner created via TF"
* runner_type = "runbook"
* runbook_base_uri = "rdcat.stg"
* }
* ```
* ```sh
* $ pulumi import pagerduty:index/automationActionsRunner:AutomationActionsRunner example 01DER7CUUBF7TH4116K0M4WKPU
* ```
*/
class AutomationActionsRunner extends pulumi.CustomResource {
/**
* Get an existing AutomationActionsRunner 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, id, state, opts) {
return new AutomationActionsRunner(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'pagerduty:index/automationActionsRunner:AutomationActionsRunner';
/**
* Returns true if the given object is an instance of AutomationActionsRunner. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === AutomationActionsRunner.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["creationTime"] = state?.creationTime;
resourceInputs["description"] = state?.description;
resourceInputs["lastSeen"] = state?.lastSeen;
resourceInputs["name"] = state?.name;
resourceInputs["runbookApiKey"] = state?.runbookApiKey;
resourceInputs["runbookBaseUri"] = state?.runbookBaseUri;
resourceInputs["runnerType"] = state?.runnerType;
resourceInputs["type"] = state?.type;
}
else {
const args = argsOrState;
if (args?.runnerType === undefined && !opts.urn) {
throw new Error("Missing required property 'runnerType'");
}
resourceInputs["description"] = args?.description;
resourceInputs["lastSeen"] = args?.lastSeen;
resourceInputs["name"] = args?.name;
resourceInputs["runbookApiKey"] = args?.runbookApiKey ? pulumi.secret(args.runbookApiKey) : undefined;
resourceInputs["runbookBaseUri"] = args?.runbookBaseUri;
resourceInputs["runnerType"] = args?.runnerType;
resourceInputs["creationTime"] = undefined /*out*/;
resourceInputs["type"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["runbookApiKey"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(AutomationActionsRunner.__pulumiType, name, resourceInputs, opts);
}
}
exports.AutomationActionsRunner = AutomationActionsRunner;
//# sourceMappingURL=automationActionsRunner.js.map