"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.ExperimentTemplate = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Resource schema for AWS::FIS::ExperimentTemplate
 *
 * ## Example Usage
 * ### Example
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws_native from "@pulumi/aws-native";
 *
 * const fisRole = new aws_native.iam.Role("fisRole", {
 *     assumeRolePolicyDocument: {
 *         version: "2012-10-17",
 *         statement: [{
 *             effect: "Allow",
 *             principal: {
 *                 service: "fis.amazonaws.com",
 *             },
 *             action: "sts:AssumeRole",
 *         }],
 *     },
 *     policies: [{
 *         policyName: "FISRoleEC2Actions",
 *         policyDocument: {
 *             version: "2012-10-17",
 *             statement: [{
 *                 effect: "Allow",
 *                 action: [
 *                     "ec2:RebootInstances",
 *                     "ec2:StopInstances",
 *                     "ec2:StartInstances",
 *                     "ec2:TerminateInstances",
 *                 ],
 *                 resource: "arn:aws:ec2:*:*:instance/*",
 *             }],
 *         },
 *     }],
 * });
 * const experimentTemplate = new aws_native.fis.ExperimentTemplate("experimentTemplate", {
 *     description: "stop an instance based on a tag",
 *     actions: {
 *         stopInstances: {
 *             actionId: "aws:ec2:stop-instances",
 *             parameters: {
 *                 startInstancesAfterDuration: "PT2M",
 *             },
 *             targets: {
 *                 instances: "oneRandomInstance",
 *             },
 *         },
 *     },
 *     targets: {
 *         oneRandomInstance: {
 *             resourceTags: {
 *                 env: "prod",
 *             },
 *             resourceType: "aws:ec2:instance",
 *             selectionMode: "COUNT(1)",
 *         },
 *     },
 *     stopConditions: [{
 *         source: "none",
 *     }],
 *     tags: {
 *         name: "fisStopInstances",
 *     },
 *     roleArn: fisRole.arn,
 * });
 *
 * ```
 */
class ExperimentTemplate extends pulumi.CustomResource {
    /**
     * Get an existing ExperimentTemplate 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 ExperimentTemplate(name, undefined, Object.assign(Object.assign({}, opts), { id: id }));
    }
    /**
     * Returns true if the given object is an instance of ExperimentTemplate.  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'] === ExperimentTemplate.__pulumiType;
    }
    /**
     * Create a ExperimentTemplate 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 || args.description === undefined) && !opts.urn) {
                throw new Error("Missing required property 'description'");
            }
            if ((!args || args.roleArn === undefined) && !opts.urn) {
                throw new Error("Missing required property 'roleArn'");
            }
            if ((!args || args.stopConditions === undefined) && !opts.urn) {
                throw new Error("Missing required property 'stopConditions'");
            }
            if ((!args || args.targets === undefined) && !opts.urn) {
                throw new Error("Missing required property 'targets'");
            }
            resourceInputs["actions"] = args ? args.actions : undefined;
            resourceInputs["description"] = args ? args.description : undefined;
            resourceInputs["experimentOptions"] = args ? args.experimentOptions : undefined;
            resourceInputs["experimentReportConfiguration"] = args ? args.experimentReportConfiguration : undefined;
            resourceInputs["logConfiguration"] = args ? args.logConfiguration : undefined;
            resourceInputs["roleArn"] = args ? args.roleArn : undefined;
            resourceInputs["stopConditions"] = args ? args.stopConditions : undefined;
            resourceInputs["tags"] = args ? args.tags : undefined;
            resourceInputs["targets"] = args ? args.targets : undefined;
            resourceInputs["awsId"] = undefined /*out*/;
        }
        else {
            resourceInputs["actions"] = undefined /*out*/;
            resourceInputs["awsId"] = undefined /*out*/;
            resourceInputs["description"] = undefined /*out*/;
            resourceInputs["experimentOptions"] = undefined /*out*/;
            resourceInputs["experimentReportConfiguration"] = undefined /*out*/;
            resourceInputs["logConfiguration"] = undefined /*out*/;
            resourceInputs["roleArn"] = undefined /*out*/;
            resourceInputs["stopConditions"] = undefined /*out*/;
            resourceInputs["tags"] = undefined /*out*/;
            resourceInputs["targets"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const replaceOnChanges = { replaceOnChanges: ["experimentOptions.accountTargeting"] };
        opts = pulumi.mergeOptions(opts, replaceOnChanges);
        super(ExperimentTemplate.__pulumiType, name, resourceInputs, opts);
    }
}
exports.ExperimentTemplate = ExperimentTemplate;
/** @internal */
ExperimentTemplate.__pulumiType = 'aws-native:fis:ExperimentTemplate';
//# sourceMappingURL=experimentTemplate.js.map