UNPKG

@pulumi/pagerduty

Version:

A Pulumi package for creating and managing pagerduty cloud resources.

117 lines 6.41 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.AutomationActionsAction = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = 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, Object.assign(Object.assign({}, opts), { id: id })); } /** * 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 ? state.actionClassification : undefined; resourceInputs["actionDataReference"] = state ? state.actionDataReference : undefined; resourceInputs["actionType"] = state ? state.actionType : undefined; resourceInputs["allowInvocationFromEventOrchestration"] = state ? state.allowInvocationFromEventOrchestration : undefined; resourceInputs["allowInvocationManually"] = state ? state.allowInvocationManually : undefined; resourceInputs["creationTime"] = state ? state.creationTime : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["mapToAllServices"] = state ? state.mapToAllServices : undefined; resourceInputs["modifyTime"] = state ? state.modifyTime : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["onlyInvocableOnUnresolvedIncidents"] = state ? state.onlyInvocableOnUnresolvedIncidents : undefined; resourceInputs["runnerId"] = state ? state.runnerId : undefined; resourceInputs["runnerType"] = state ? state.runnerType : undefined; resourceInputs["type"] = state ? state.type : undefined; } else { const args = argsOrState; if ((!args || args.actionDataReference === undefined) && !opts.urn) { throw new Error("Missing required property 'actionDataReference'"); } if ((!args || args.actionType === undefined) && !opts.urn) { throw new Error("Missing required property 'actionType'"); } resourceInputs["actionClassification"] = args ? args.actionClassification : undefined; resourceInputs["actionDataReference"] = args ? args.actionDataReference : undefined; resourceInputs["actionType"] = args ? args.actionType : undefined; resourceInputs["allowInvocationFromEventOrchestration"] = args ? args.allowInvocationFromEventOrchestration : undefined; resourceInputs["allowInvocationManually"] = args ? args.allowInvocationManually : undefined; resourceInputs["creationTime"] = args ? args.creationTime : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["mapToAllServices"] = args ? args.mapToAllServices : undefined; resourceInputs["modifyTime"] = args ? args.modifyTime : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["onlyInvocableOnUnresolvedIncidents"] = args ? args.onlyInvocableOnUnresolvedIncidents : undefined; resourceInputs["runnerId"] = args ? args.runnerId : undefined; resourceInputs["runnerType"] = args ? args.runnerType : undefined; resourceInputs["type"] = args ? args.type : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(AutomationActionsAction.__pulumiType, name, resourceInputs, opts); } } exports.AutomationActionsAction = AutomationActionsAction; /** @internal */ AutomationActionsAction.__pulumiType = 'pagerduty:index/automationActionsAction:AutomationActionsAction'; //# sourceMappingURL=automationActionsAction.js.map