UNPKG

@pulumi/aws

Version:

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

121 lines 4.96 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 * * ### Identity Schema * * #### Required * * * `id` - (String) ID of the maintenance window. * * #### Optional * * * `account_id` (String) AWS Account where this resource is managed. * * * `region` (String) Region where this resource is managed. * * Using `pulumi import`, import SSM Maintenance Windows using the maintenance window `id`. For example: * * console * * % pulumi import aws_ssm_maintenance_window.example 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, { ...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?.allowUnassociatedTargets; resourceInputs["cutoff"] = state?.cutoff; resourceInputs["description"] = state?.description; resourceInputs["duration"] = state?.duration; resourceInputs["enabled"] = state?.enabled; resourceInputs["endDate"] = state?.endDate; resourceInputs["name"] = state?.name; resourceInputs["region"] = state?.region; resourceInputs["schedule"] = state?.schedule; resourceInputs["scheduleOffset"] = state?.scheduleOffset; resourceInputs["scheduleTimezone"] = state?.scheduleTimezone; resourceInputs["startDate"] = state?.startDate; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; } else { const args = argsOrState; if (args?.cutoff === undefined && !opts.urn) { throw new Error("Missing required property 'cutoff'"); } if (args?.duration === undefined && !opts.urn) { throw new Error("Missing required property 'duration'"); } if (args?.schedule === undefined && !opts.urn) { throw new Error("Missing required property 'schedule'"); } resourceInputs["allowUnassociatedTargets"] = args?.allowUnassociatedTargets; resourceInputs["cutoff"] = args?.cutoff; resourceInputs["description"] = args?.description; resourceInputs["duration"] = args?.duration; resourceInputs["enabled"] = args?.enabled; resourceInputs["endDate"] = args?.endDate; resourceInputs["name"] = args?.name; resourceInputs["region"] = args?.region; resourceInputs["schedule"] = args?.schedule; resourceInputs["scheduleOffset"] = args?.scheduleOffset; resourceInputs["scheduleTimezone"] = args?.scheduleTimezone; resourceInputs["startDate"] = args?.startDate; resourceInputs["tags"] = args?.tags; 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