UNPKG

@pulumi/aws

Version:

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

131 lines 5.39 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.MaintenanceWindowTarget = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides an SSM Maintenance Window Target resource * * ## Example Usage * * ### Instance Target * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const window = new aws.ssm.MaintenanceWindow("window", { * name: "maintenance-window-webapp", * schedule: "cron(0 16 ? * TUE *)", * duration: 3, * cutoff: 1, * }); * const target1 = new aws.ssm.MaintenanceWindowTarget("target1", { * windowId: window.id, * name: "maintenance-window-target", * description: "This is a maintenance window target", * resourceType: "INSTANCE", * targets: [{ * key: "tag:Name", * values: ["acceptance_test"], * }], * }); * ``` * * ### Resource Group Target * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const window = new aws.ssm.MaintenanceWindow("window", { * name: "maintenance-window-webapp", * schedule: "cron(0 16 ? * TUE *)", * duration: 3, * cutoff: 1, * }); * const target1 = new aws.ssm.MaintenanceWindowTarget("target1", { * windowId: window.id, * name: "maintenance-window-target", * description: "This is a maintenance window target", * resourceType: "RESOURCE_GROUP", * targets: [{ * key: "resource-groups:ResourceTypeFilters", * values: ["AWS::EC2::Instance"], * }], * }); * ``` * * ## Import * * Using `pulumi import`, import SSM Maintenance Window targets using `WINDOW_ID/WINDOW_TARGET_ID`. For example: * * ```sh * $ pulumi import aws:ssm/maintenanceWindowTarget:MaintenanceWindowTarget example mw-0c50858d01EXAMPLE/23639a0b-ddbc-4bca-9e72-78d96EXAMPLE * ``` */ class MaintenanceWindowTarget extends pulumi.CustomResource { /** * Get an existing MaintenanceWindowTarget 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 MaintenanceWindowTarget(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of MaintenanceWindowTarget. 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'] === MaintenanceWindowTarget.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["ownerInformation"] = state ? state.ownerInformation : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["resourceType"] = state ? state.resourceType : undefined; resourceInputs["targets"] = state ? state.targets : undefined; resourceInputs["windowId"] = state ? state.windowId : undefined; } else { const args = argsOrState; if ((!args || args.resourceType === undefined) && !opts.urn) { throw new Error("Missing required property 'resourceType'"); } if ((!args || args.targets === undefined) && !opts.urn) { throw new Error("Missing required property 'targets'"); } if ((!args || args.windowId === undefined) && !opts.urn) { throw new Error("Missing required property 'windowId'"); } resourceInputs["description"] = args ? args.description : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["ownerInformation"] = args ? args.ownerInformation : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["resourceType"] = args ? args.resourceType : undefined; resourceInputs["targets"] = args ? args.targets : undefined; resourceInputs["windowId"] = args ? args.windowId : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(MaintenanceWindowTarget.__pulumiType, name, resourceInputs, opts); } } exports.MaintenanceWindowTarget = MaintenanceWindowTarget; /** @internal */ MaintenanceWindowTarget.__pulumiType = 'aws:ssm/maintenanceWindowTarget:MaintenanceWindowTarget'; //# sourceMappingURL=maintenanceWindowTarget.js.map