"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.StateMachine = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Resource schema for StateMachine
 *
 * ## Example Usage
 * ### Example
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws_native from "@pulumi/aws-native";
 *
 * const myStateMachine = new aws_native.stepfunctions.StateMachine("myStateMachine", {
 *     stateMachineName: "HelloWorld-StateMachine",
 *     stateMachineType: aws_native.stepfunctions.StateMachineType.Standard,
 *     definitionString: "{\"StartAt\": \"HelloWorld\",  \"States\": {\"HelloWorld\": {\"Type\": \"Task\", \"Resource\":  \"arn:aws:lambda:us-east-1:111122223333;:function:HelloFunction\", \"End\": true}}}",
 *     roleArn: "arn:aws:iam::111122223333:role/service-role/StatesExecutionRole-us-east-1;",
 * });
 *
 * ```
 * ### Example
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws_native from "@pulumi/aws-native";
 *
 * const myStateMachine = new aws_native.stepfunctions.StateMachine("myStateMachine", {
 *     stateMachineName: "HelloWorld-StateMachine",
 *     stateMachineType: aws_native.stepfunctions.StateMachineType.Standard,
 *     definitionString: `{
 *     "StartAt": "HelloWorld",
 *     "States" : {
 *         "HelloWorld" : {
 *             "Type" : "Task",
 *             "Resource" : "arn:aws:lambda:us-east-1:111122223333:function:HelloFunction",
 *             "End" : true
 *         }
 *     }
 * }`,
 *     roleArn: "arn:aws:iam::111122223333:role/service-role/StatesExecutionRole-us-east-1",
 *     tags: [
 *         {
 *             key: "keyname1",
 *             value: "value1",
 *         },
 *         {
 *             key: "keyname2",
 *             value: "value2",
 *         },
 *     ],
 * });
 *
 * ```
 * ### Example
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws_native from "@pulumi/aws-native";
 *
 * const myStateMachine = new aws_native.stepfunctions.StateMachine("myStateMachine", {
 *     stateMachineName: "HelloWorld-StateMachine",
 *     definitionString: `{
 *   "StartAt": "HelloWorld",
 *   "States": {
 *     "HelloWorld": {
 *       "Type": "Task",
 *       "Resource": "arn:aws:lambda:us-east-1:111122223333:function:HelloFunction",
 *       "End": true
 *     }
 *   }
 * }`,
 *     roleArn: "arn:aws:iam::111122223333:role/service-role/StatesExecutionRole-us-east-1",
 *     tags: [
 *         {
 *             key: "keyname1",
 *             value: "value1",
 *         },
 *         {
 *             key: "keyname2",
 *             value: "value2",
 *         },
 *     ],
 * });
 *
 * ```
 * ### Example
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws_native from "@pulumi/aws-native";
 *
 * const myStateMachine = new aws_native.stepfunctions.StateMachine("myStateMachine", {
 *     stateMachineName: "HelloWorld-StateMachine",
 *     definitionS3Location: {
 *         bucket: "example_bucket",
 *         key: "hello_world.json",
 *     },
 *     definitionSubstitutions: {
 *         helloFunction: "arn:aws:lambda:us-east-1:111122223333:function:HelloFunction",
 *     },
 *     roleArn: "arn:aws:iam::111122223333:role/service-role/StatesExecutionRole-us-east-1",
 * });
 *
 * ```
 */
class StateMachine extends pulumi.CustomResource {
    /**
     * Get an existing StateMachine 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 StateMachine(name, undefined, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of StateMachine.  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'] === StateMachine.__pulumiType;
    }
    /**
     * Create a StateMachine 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?.roleArn === undefined && !opts.urn) {
                throw new Error("Missing required property 'roleArn'");
            }
            resourceInputs["definition"] = args?.definition;
            resourceInputs["definitionS3Location"] = args?.definitionS3Location;
            resourceInputs["definitionString"] = args?.definitionString;
            resourceInputs["definitionSubstitutions"] = args?.definitionSubstitutions;
            resourceInputs["encryptionConfiguration"] = args?.encryptionConfiguration;
            resourceInputs["loggingConfiguration"] = args?.loggingConfiguration;
            resourceInputs["roleArn"] = args?.roleArn;
            resourceInputs["stateMachineName"] = args?.stateMachineName;
            resourceInputs["stateMachineType"] = args?.stateMachineType;
            resourceInputs["tags"] = args?.tags;
            resourceInputs["tracingConfiguration"] = args?.tracingConfiguration;
            resourceInputs["arn"] = undefined /*out*/;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["stateMachineRevisionId"] = undefined /*out*/;
        }
        else {
            resourceInputs["arn"] = undefined /*out*/;
            resourceInputs["definition"] = undefined /*out*/;
            resourceInputs["definitionS3Location"] = undefined /*out*/;
            resourceInputs["definitionString"] = undefined /*out*/;
            resourceInputs["definitionSubstitutions"] = undefined /*out*/;
            resourceInputs["encryptionConfiguration"] = undefined /*out*/;
            resourceInputs["loggingConfiguration"] = undefined /*out*/;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["roleArn"] = undefined /*out*/;
            resourceInputs["stateMachineName"] = undefined /*out*/;
            resourceInputs["stateMachineRevisionId"] = undefined /*out*/;
            resourceInputs["stateMachineType"] = undefined /*out*/;
            resourceInputs["tags"] = undefined /*out*/;
            resourceInputs["tracingConfiguration"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const replaceOnChanges = { replaceOnChanges: ["stateMachineName", "stateMachineType"] };
        opts = pulumi.mergeOptions(opts, replaceOnChanges);
        super(StateMachine.__pulumiType, name, resourceInputs, opts);
    }
}
exports.StateMachine = StateMachine;
/** @internal */
StateMachine.__pulumiType = 'aws-native:stepfunctions:StateMachine';
//# sourceMappingURL=stateMachine.js.map