UNPKG

@pulumi/aws

Version:

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

109 lines 5.29 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.MaintenanceWindow = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides an SSM Maintenance Window resource * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const production = new aws.ssm.MaintenanceWindow("production", { * name: "maintenance-window-application", * schedule: "cron(0 16 ? * TUE *)", * duration: 3, * cutoff: 1, * }); * ``` * * ## Import * * Using `pulumi import`, import SSM Maintenance Windows using the maintenance window `id`. For example: * * ```sh * $ pulumi import aws:ssm/maintenanceWindow:MaintenanceWindow imported-window mw-0123456789 * ``` */ class MaintenanceWindow extends pulumi.CustomResource { /** * Get an existing MaintenanceWindow 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 MaintenanceWindow(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of MaintenanceWindow. 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'] === MaintenanceWindow.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["allowUnassociatedTargets"] = state ? state.allowUnassociatedTargets : undefined; resourceInputs["cutoff"] = state ? state.cutoff : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["duration"] = state ? state.duration : undefined; resourceInputs["enabled"] = state ? state.enabled : undefined; resourceInputs["endDate"] = state ? state.endDate : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["schedule"] = state ? state.schedule : undefined; resourceInputs["scheduleOffset"] = state ? state.scheduleOffset : undefined; resourceInputs["scheduleTimezone"] = state ? state.scheduleTimezone : undefined; resourceInputs["startDate"] = state ? state.startDate : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["tagsAll"] = state ? state.tagsAll : undefined; } else { const args = argsOrState; if ((!args || args.cutoff === undefined) && !opts.urn) { throw new Error("Missing required property 'cutoff'"); } if ((!args || args.duration === undefined) && !opts.urn) { throw new Error("Missing required property 'duration'"); } if ((!args || args.schedule === undefined) && !opts.urn) { throw new Error("Missing required property 'schedule'"); } resourceInputs["allowUnassociatedTargets"] = args ? args.allowUnassociatedTargets : undefined; resourceInputs["cutoff"] = args ? args.cutoff : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["duration"] = args ? args.duration : undefined; resourceInputs["enabled"] = args ? args.enabled : undefined; resourceInputs["endDate"] = args ? args.endDate : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["schedule"] = args ? args.schedule : undefined; resourceInputs["scheduleOffset"] = args ? args.scheduleOffset : undefined; resourceInputs["scheduleTimezone"] = args ? args.scheduleTimezone : undefined; resourceInputs["startDate"] = args ? args.startDate : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(MaintenanceWindow.__pulumiType, name, resourceInputs, opts); } } exports.MaintenanceWindow = MaintenanceWindow; /** @internal */ MaintenanceWindow.__pulumiType = 'aws:ssm/maintenanceWindow:MaintenanceWindow'; //# sourceMappingURL=maintenanceWindow.js.map