UNPKG

@pulumi/pagerduty

Version:

A Pulumi package for creating and managing pagerduty cloud resources.

112 lines 5.17 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.AutomationActionsRunner = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = 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 `runbook_api_key` attribute has been omitted to avoid resource replacement after the import. * * Runners can be imported using the `id`, e.g. * * 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, Object.assign(Object.assign({}, opts), { id: id })); } /** * 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 ? state.creationTime : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["lastSeen"] = state ? state.lastSeen : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["runbookApiKey"] = state ? state.runbookApiKey : undefined; resourceInputs["runbookBaseUri"] = state ? state.runbookBaseUri : undefined; resourceInputs["runnerType"] = state ? state.runnerType : undefined; resourceInputs["type"] = state ? state.type : undefined; } else { const args = argsOrState; if ((!args || args.runnerType === undefined) && !opts.urn) { throw new Error("Missing required property 'runnerType'"); } resourceInputs["description"] = args ? args.description : undefined; resourceInputs["lastSeen"] = args ? args.lastSeen : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["runbookApiKey"] = (args === null || args === void 0 ? void 0 : args.runbookApiKey) ? pulumi.secret(args.runbookApiKey) : undefined; resourceInputs["runbookBaseUri"] = args ? args.runbookBaseUri : undefined; resourceInputs["runnerType"] = args ? args.runnerType : undefined; 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; /** @internal */ AutomationActionsRunner.__pulumiType = 'pagerduty:index/automationActionsRunner:AutomationActionsRunner'; //# sourceMappingURL=automationActionsRunner.js.map