UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

150 lines 4.77 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.Plan = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Resource for managing an AWS SSM Contact Plan. * * ## Example Usage * * ### Basic Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.ssmcontacts.Plan("example", { * contactId: "arn:aws:ssm-contacts:us-west-2:123456789012:contact/contactalias", * stages: [{ * durationInMinutes: 1, * }], * }); * ``` * * ### Usage with SSM Contact * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const contact = new aws.ssmcontacts.Contact("contact", { * alias: "alias", * type: "PERSONAL", * }); * const plan = new aws.ssmcontacts.Plan("plan", { * contactId: contact.arn, * stages: [{ * durationInMinutes: 1, * }], * }); * ``` * * ### Usage With All Fields * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const escalationPlan = new aws.ssmcontacts.Contact("escalation_plan", { * alias: "escalation-plan-alias", * type: "ESCALATION", * }); * const contactOne = new aws.ssmcontacts.Contact("contact_one", { * alias: "alias", * type: "PERSONAL", * }); * const contactTwo = new aws.ssmcontacts.Contact("contact_two", { * alias: "alias", * type: "PERSONAL", * }); * const test = new aws.ssmcontacts.Plan("test", { * contactId: escalationPlan.arn, * stages: [{ * durationInMinutes: 0, * targets: [ * { * contactTargetInfo: { * isEssential: false, * contactId: contactOne.arn, * }, * }, * { * contactTargetInfo: { * isEssential: true, * contactId: contactTwo.arn, * }, * }, * { * channelTargetInfo: { * retryIntervalInMinutes: 2, * contactChannelId: channel.arn, * }, * }, * ], * }], * }); * ``` * * ## Import * * Using `pulumi import`, import SSM Contact Plan using the Contact ARN. For example: * * ```sh * $ pulumi import aws:ssmcontacts/plan:Plan example {ARNValue} * ``` */ class Plan extends pulumi.CustomResource { /** * Get an existing Plan 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 Plan(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Plan. 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'] === Plan.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["contactId"] = state?.contactId; resourceInputs["region"] = state?.region; resourceInputs["stages"] = state?.stages; } else { const args = argsOrState; if (args?.contactId === undefined && !opts.urn) { throw new Error("Missing required property 'contactId'"); } if (args?.stages === undefined && !opts.urn) { throw new Error("Missing required property 'stages'"); } resourceInputs["contactId"] = args?.contactId; resourceInputs["region"] = args?.region; resourceInputs["stages"] = args?.stages; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Plan.__pulumiType, name, resourceInputs, opts); } } exports.Plan = Plan; /** @internal */ Plan.__pulumiType = 'aws:ssmcontacts/plan:Plan'; //# sourceMappingURL=plan.js.map