@pulumi/pagerduty
Version:
A Pulumi package for creating and managing pagerduty cloud resources.
140 lines • 6.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.AutomationActionsAction = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("./utilities"));
/**
* An Automation Actions [action](https://developer.pagerduty.com/api-reference/d64584a4371d3-create-an-automation-action) invokes jobs and workflows that are staged in Runbook Automation or Process Automation. It may also execute a command line script run by a Process Automation runner installed in your infrastructure.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pagerduty from "@pulumi/pagerduty";
*
* const paActionExample = new pagerduty.AutomationActionsAction("pa_action_example", {
* name: "PA Action created via TF",
* description: "Description of the PA Action created via TF",
* actionType: "process_automation",
* actionDataReference: {
* processAutomationJobId: "P123456",
* },
* });
* const scriptActionExample = new pagerduty.AutomationActionsAction("script_action_example", {
* name: "Script Action created via TF",
* description: "Description of the Script Action created via TF",
* actionType: "script",
* actionDataReference: {
* script: "print(\"Hello from a Python script!\")",
* invocationCommand: "/usr/local/bin/python3",
* },
* });
* ```
*
* ## Import
*
* Actions can be imported using the `id`, e.g.
*
* ```sh
* $ pulumi import pagerduty:index/automationActionsAction:AutomationActionsAction example 01DER7CUUBF7TH4116K0M4WKPU
* ```
*/
class AutomationActionsAction extends pulumi.CustomResource {
/**
* Get an existing AutomationActionsAction 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 AutomationActionsAction(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'pagerduty:index/automationActionsAction:AutomationActionsAction';
/**
* Returns true if the given object is an instance of AutomationActionsAction. 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'] === AutomationActionsAction.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["actionClassification"] = state?.actionClassification;
resourceInputs["actionDataReference"] = state?.actionDataReference;
resourceInputs["actionType"] = state?.actionType;
resourceInputs["allowInvocationFromEventOrchestration"] = state?.allowInvocationFromEventOrchestration;
resourceInputs["allowInvocationManually"] = state?.allowInvocationManually;
resourceInputs["creationTime"] = state?.creationTime;
resourceInputs["description"] = state?.description;
resourceInputs["mapToAllServices"] = state?.mapToAllServices;
resourceInputs["modifyTime"] = state?.modifyTime;
resourceInputs["name"] = state?.name;
resourceInputs["onlyInvocableOnUnresolvedIncidents"] = state?.onlyInvocableOnUnresolvedIncidents;
resourceInputs["runnerId"] = state?.runnerId;
resourceInputs["runnerType"] = state?.runnerType;
resourceInputs["type"] = state?.type;
}
else {
const args = argsOrState;
if (args?.actionDataReference === undefined && !opts.urn) {
throw new Error("Missing required property 'actionDataReference'");
}
if (args?.actionType === undefined && !opts.urn) {
throw new Error("Missing required property 'actionType'");
}
resourceInputs["actionClassification"] = args?.actionClassification;
resourceInputs["actionDataReference"] = args?.actionDataReference;
resourceInputs["actionType"] = args?.actionType;
resourceInputs["allowInvocationFromEventOrchestration"] = args?.allowInvocationFromEventOrchestration;
resourceInputs["allowInvocationManually"] = args?.allowInvocationManually;
resourceInputs["creationTime"] = args?.creationTime;
resourceInputs["description"] = args?.description;
resourceInputs["mapToAllServices"] = args?.mapToAllServices;
resourceInputs["modifyTime"] = args?.modifyTime;
resourceInputs["name"] = args?.name;
resourceInputs["onlyInvocableOnUnresolvedIncidents"] = args?.onlyInvocableOnUnresolvedIncidents;
resourceInputs["runnerId"] = args?.runnerId;
resourceInputs["runnerType"] = args?.runnerType;
resourceInputs["type"] = args?.type;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(AutomationActionsAction.__pulumiType, name, resourceInputs, opts);
}
}
exports.AutomationActionsAction = AutomationActionsAction;
//# sourceMappingURL=automationActionsAction.js.map