"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.MaintenanceWindowTask = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Resource Type definition for AWS::SSM::MaintenanceWindowTask
 *
 * ## Example Usage
 * ### Example
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws_native from "@pulumi/aws-native";
 *
 * const maintenanceWindow = new aws_native.ssm.MaintenanceWindow("maintenanceWindow", {
 *     name: "MaintenanceWindow",
 *     allowUnassociatedTargets: true,
 *     cutoff: 0,
 *     description: "Maintenance window for instances",
 *     duration: 1,
 *     schedule: "cron(20 17 ? * MON-FRI *)",
 * });
 * const maintenanceWindowTarget = new aws_native.ssm.MaintenanceWindowTarget("maintenanceWindowTarget", {
 *     resourceType: "RESOURCE_GROUP",
 *     targets: [{
 *         key: "resource-groups:Name",
 *         values: ["TestResourceGroup"],
 *     }],
 *     windowId: maintenanceWindow.id,
 * });
 * const patchTask = new aws_native.ssm.MaintenanceWindowTask("patchTask", {
 *     description: "Apply OS patches on instances in target",
 *     maxConcurrency: "1",
 *     maxErrors: "1",
 *     priority: 0,
 *     taskType: "RUN_COMMAND",
 *     windowId: maintenanceWindow.id,
 *     taskArn: "AWS-RunPatchBaseline",
 *     taskInvocationParameters: {
 *         maintenanceWindowRunCommandParameters: {
 *             parameters: {
 *                 operation: ["Install"],
 *                 rebootOption: ["NoReboot"],
 *             },
 *         },
 *     },
 *     targets: [{
 *         key: "WindowTargetIds",
 *         values: [maintenanceWindowTarget.id],
 *     }],
 * });
 *
 * ```
 * ### Example
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws_native from "@pulumi/aws-native";
 *
 * const maintenanceWindow = new aws_native.ssm.MaintenanceWindow("maintenanceWindow", {
 *     name: "MaintenanceWindow",
 *     allowUnassociatedTargets: true,
 *     cutoff: 0,
 *     description: "Maintenance window for instances",
 *     duration: 1,
 *     schedule: "cron(20 17 ? * MON-FRI *)",
 * });
 * const maintenanceWindowTarget = new aws_native.ssm.MaintenanceWindowTarget("maintenanceWindowTarget", {
 *     resourceType: "RESOURCE_GROUP",
 *     targets: [{
 *         key: "resource-groups:Name",
 *         values: ["TestResourceGroup"],
 *     }],
 *     windowId: maintenanceWindow.id,
 * });
 * const patchTask = new aws_native.ssm.MaintenanceWindowTask("patchTask", {
 *     description: "Apply OS patches on instances in target",
 *     maxConcurrency: "1",
 *     maxErrors: "1",
 *     priority: 0,
 *     taskType: "RUN_COMMAND",
 *     windowId: maintenanceWindow.id,
 *     taskArn: "AWS-RunPatchBaseline",
 *     taskInvocationParameters: {
 *         maintenanceWindowRunCommandParameters: {
 *             parameters: {
 *                 operation: ["Install"],
 *                 rebootOption: ["NoReboot"],
 *             },
 *         },
 *     },
 *     targets: [{
 *         key: "WindowTargetIds",
 *         values: [maintenanceWindowTarget.id],
 *     }],
 * });
 *
 * ```
 * ### Example
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws_native from "@pulumi/aws-native";
 *
 * const lambdaTask = new aws_native.ssm.MaintenanceWindowTask("lambdaTask", {
 *     windowId: "mw-04fd6f19dfEXAMPLE",
 *     taskArn: "arn:aws:lambda:us-east-2:111222333444:function:MyLambdaTaskArn",
 *     serviceRoleArn: "arn:aws:iam::111222333444:role/aws-service-role/ssm.amazonaws.com/AWSServiceRoleForAmazonSSM",
 *     taskType: "LAMBDA",
 *     taskInvocationParameters: {
 *         maintenanceWindowLambdaParameters: {
 *             clientContext: "eyJ0ZXN0Q29udGV4dCI6Ik5vdGhp==trucated==EXAMPLE",
 *             qualifier: "$LATEST",
 *             payload: "eyJJbnN0YW5jZUlkIjoie3tSRVNPVVJDRV9JRH19IiwidGFyZ2V0VHlwZSI6Int7VEFSR0VUX1RZUEV9fSJ9",
 *         },
 *     },
 *     priority: 1,
 *     name: "UpdateLambdaTaskEXAMPLE",
 * });
 *
 * ```
 * ### Example
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws_native from "@pulumi/aws-native";
 *
 * const lambdaTask = new aws_native.ssm.MaintenanceWindowTask("lambdaTask", {
 *     windowId: "mw-04fd6f19dfEXAMPLE",
 *     taskArn: "arn:aws:lambda:us-east-2:111222333444:function:MyLambdaTaskArn",
 *     serviceRoleArn: "arn:aws:iam::111222333444:role/aws-service-role/ssm.amazonaws.com/AWSServiceRoleForAmazonSSM",
 *     taskType: "LAMBDA",
 *     taskInvocationParameters: {
 *         maintenanceWindowLambdaParameters: {
 *             clientContext: "eyJ0ZXN0Q29udGV4dCI6Ik5vdGhp==trucated==EXAMPLE",
 *             qualifier: "$LATEST",
 *             payload: "eyJJbnN0YW5jZUlkIjoie3tSRVNPVVJDRV9JRH19IiwidGFyZ2V0VHlwZSI6Int7VEFSR0VUX1RZUEV9fSJ9",
 *         },
 *     },
 *     priority: 1,
 *     name: "UpdateLambdaTaskEXAMPLE",
 * });
 *
 * ```
 */
class MaintenanceWindowTask extends pulumi.CustomResource {
    /**
     * Get an existing MaintenanceWindowTask 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 opts Optional settings to control the behavior of the CustomResource.
     */
    static get(name, id, opts) {
        return new MaintenanceWindowTask(name, undefined, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of MaintenanceWindowTask.  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'] === MaintenanceWindowTask.__pulumiType;
    }
    /**
     * Create a MaintenanceWindowTask resource with the given unique name, arguments, and options.
     *
     * @param name The _unique_ name of the resource.
     * @param args The arguments to use to populate this resource's properties.
     * @param opts A bag of options that control this resource's behavior.
     */
    constructor(name, args, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (!opts.id) {
            if (args?.priority === undefined && !opts.urn) {
                throw new Error("Missing required property 'priority'");
            }
            if (args?.taskArn === undefined && !opts.urn) {
                throw new Error("Missing required property 'taskArn'");
            }
            if (args?.taskType === undefined && !opts.urn) {
                throw new Error("Missing required property 'taskType'");
            }
            if (args?.windowId === undefined && !opts.urn) {
                throw new Error("Missing required property 'windowId'");
            }
            resourceInputs["cutoffBehavior"] = args?.cutoffBehavior;
            resourceInputs["description"] = args?.description;
            resourceInputs["loggingInfo"] = args?.loggingInfo;
            resourceInputs["maxConcurrency"] = args?.maxConcurrency;
            resourceInputs["maxErrors"] = args?.maxErrors;
            resourceInputs["name"] = args?.name;
            resourceInputs["priority"] = args?.priority;
            resourceInputs["serviceRoleArn"] = args?.serviceRoleArn;
            resourceInputs["targets"] = args?.targets;
            resourceInputs["taskArn"] = args?.taskArn;
            resourceInputs["taskInvocationParameters"] = args?.taskInvocationParameters;
            resourceInputs["taskParameters"] = args?.taskParameters;
            resourceInputs["taskType"] = args?.taskType;
            resourceInputs["windowId"] = args?.windowId;
            resourceInputs["windowTaskId"] = undefined /*out*/;
        }
        else {
            resourceInputs["cutoffBehavior"] = undefined /*out*/;
            resourceInputs["description"] = undefined /*out*/;
            resourceInputs["loggingInfo"] = undefined /*out*/;
            resourceInputs["maxConcurrency"] = undefined /*out*/;
            resourceInputs["maxErrors"] = undefined /*out*/;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["priority"] = undefined /*out*/;
            resourceInputs["serviceRoleArn"] = undefined /*out*/;
            resourceInputs["targets"] = undefined /*out*/;
            resourceInputs["taskArn"] = undefined /*out*/;
            resourceInputs["taskInvocationParameters"] = undefined /*out*/;
            resourceInputs["taskParameters"] = undefined /*out*/;
            resourceInputs["taskType"] = undefined /*out*/;
            resourceInputs["windowId"] = undefined /*out*/;
            resourceInputs["windowTaskId"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const replaceOnChanges = { replaceOnChanges: ["taskType", "windowId"] };
        opts = pulumi.mergeOptions(opts, replaceOnChanges);
        super(MaintenanceWindowTask.__pulumiType, name, resourceInputs, opts);
    }
}
exports.MaintenanceWindowTask = MaintenanceWindowTask;
/** @internal */
MaintenanceWindowTask.__pulumiType = 'aws-native:ssm:MaintenanceWindowTask';
//# sourceMappingURL=maintenanceWindowTask.js.map