All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.awsnative.stepfunctions.kotlin.StateMachine.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 1.24.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.stepfunctions.kotlin

import com.pulumi.awsnative.kotlin.outputs.Tag
import com.pulumi.awsnative.stepfunctions.kotlin.enums.StateMachineType
import com.pulumi.awsnative.stepfunctions.kotlin.outputs.StateMachineDefinition
import com.pulumi.awsnative.stepfunctions.kotlin.outputs.StateMachineEncryptionConfiguration
import com.pulumi.awsnative.stepfunctions.kotlin.outputs.StateMachineLoggingConfiguration
import com.pulumi.awsnative.stepfunctions.kotlin.outputs.StateMachineS3Location
import com.pulumi.awsnative.stepfunctions.kotlin.outputs.StateMachineTracingConfiguration
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Any
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin
import com.pulumi.awsnative.stepfunctions.kotlin.enums.StateMachineType.Companion.toKotlin as stateMachineTypeToKotlin
import com.pulumi.awsnative.stepfunctions.kotlin.outputs.StateMachineDefinition.Companion.toKotlin as stateMachineDefinitionToKotlin
import com.pulumi.awsnative.stepfunctions.kotlin.outputs.StateMachineEncryptionConfiguration.Companion.toKotlin as stateMachineEncryptionConfigurationToKotlin
import com.pulumi.awsnative.stepfunctions.kotlin.outputs.StateMachineLoggingConfiguration.Companion.toKotlin as stateMachineLoggingConfigurationToKotlin
import com.pulumi.awsnative.stepfunctions.kotlin.outputs.StateMachineS3Location.Companion.toKotlin as stateMachineS3LocationToKotlin
import com.pulumi.awsnative.stepfunctions.kotlin.outputs.StateMachineTracingConfiguration.Companion.toKotlin as stateMachineTracingConfigurationToKotlin

/**
 * Builder for [StateMachine].
 */
@PulumiTagMarker
public class StateMachineResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: StateMachineArgs = StateMachineArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend StateMachineArgsBuilder.() -> Unit) {
        val builder = StateMachineArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): StateMachine {
        val builtJavaResource = com.pulumi.awsnative.stepfunctions.StateMachine(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return StateMachine(builtJavaResource)
    }
}

/**
 * Resource schema for StateMachine
 * ## Example Usage
 * ### Example
 * No Java example available.
 * ### Example
 * No Java example available.
 * ### Example
 * No Java example available.
 * ### Example
 * No Java example available.
 */
public class StateMachine internal constructor(
    override val javaResource: com.pulumi.awsnative.stepfunctions.StateMachine,
) : KotlinCustomResource(javaResource, StateMachineMapper) {
    /**
     * Returns the ARN of the resource.
     */
    public val arn: Output
        get() = javaResource.arn().applyValue({ args0 -> args0 })

    /**
     * The Amazon States Language definition of the state machine. The state machine definition must be in JSON or YAML, and the format of the object must match the format of your CloudFormation template file. See [Amazon States Language](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html) .
     */
    public val definition: Output?
        get() = javaResource.definition().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    stateMachineDefinitionToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * The name of the S3 bucket where the state machine definition is stored. The state machine definition must be a JSON or YAML file.
     */
    public val definitionS3Location: Output?
        get() = javaResource.definitionS3Location().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> stateMachineS3LocationToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * The Amazon States Language definition of the state machine. The state machine definition must be in JSON. See [Amazon States Language](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html) .
     */
    public val definitionString: Output?
        get() = javaResource.definitionString().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * A map (string to string) that specifies the mappings for placeholder variables in the state machine definition. This enables the customer to inject values obtained at runtime, for example from intrinsic functions, in the state machine definition. Variables can be template parameter names, resource logical IDs, resource attributes, or a variable in a key-value map.
     * Substitutions must follow the syntax: `${key_name}` or `${variable_1,variable_2,...}` .
     */
    public val definitionSubstitutions: Output>?
        get() = javaResource.definitionSubstitutions().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0.key.to(args0.value) }).toMap()
            }).orElse(null)
        })

    public val encryptionConfiguration: Output?
        get() = javaResource.encryptionConfiguration().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> stateMachineEncryptionConfigurationToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * Defines what execution history events are logged and where they are logged.
     * > By default, the `level` is set to `OFF` . For more information see [Log Levels](https://docs.aws.amazon.com/step-functions/latest/dg/cloudwatch-log-level.html) in the AWS Step Functions User Guide.
     */
    public val loggingConfiguration: Output?
        get() = javaResource.loggingConfiguration().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> stateMachineLoggingConfigurationToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * Returns the name of the state machine. For example:
     * `{ "Fn::GetAtt": ["MyStateMachine", "Name"] }`
     * Returns the name of your state machine:
     * `HelloWorld-StateMachine`
     * If you did not specify the name it will be similar to the following:
     * `MyStateMachine-1234abcdefgh`
     * For more information about using `Fn::GetAtt` , see [Fn::GetAtt](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-getatt.html) .
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The Amazon Resource Name (ARN) of the IAM role to use for this state machine.
     */
    public val roleArn: Output
        get() = javaResource.roleArn().applyValue({ args0 -> args0 })

    /**
     * The name of the state machine.
     * A name must *not* contain:
     * - white space
     * - brackets `< > { } [ ]`
     * - wildcard characters `? *`
     * - special characters `" # % \ ^ | ~ ` $ & , ; : /`
     * - control characters ( `U+0000-001F` , `U+007F-009F` )
     * > If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.
     */
    public val stateMachineName: Output?
        get() = javaResource.stateMachineName().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Identifier for a state machine revision, which is an immutable, read-only snapshot of a state machine’s definition and configuration.
     */
    public val stateMachineRevisionId: Output
        get() = javaResource.stateMachineRevisionId().applyValue({ args0 -> args0 })

    /**
     * Determines whether a `STANDARD` or `EXPRESS` state machine is created. The default is `STANDARD` . You cannot update the `type` of a state machine once it has been created. For more information on `STANDARD` and `EXPRESS` workflows, see [Standard Versus Express Workflows](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-standard-vs-express.html) in the AWS Step Functions Developer Guide.
     */
    public val stateMachineType: Output?
        get() = javaResource.stateMachineType().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> stateMachineTypeToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * The list of tags to add to a resource.
     * Tags may only contain Unicode letters, digits, white space, or these symbols: `_ . : / = + - @` .
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> tagToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * Selects whether or not the state machine's AWS X-Ray tracing is enabled.
     */
    public val tracingConfiguration: Output?
        get() = javaResource.tracingConfiguration().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> stateMachineTracingConfigurationToKotlin(args0) })
            }).orElse(null)
        })
}

public object StateMachineMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.stepfunctions.StateMachine::class == javaResource::class

    override fun map(javaResource: Resource): StateMachine = StateMachine(
        javaResource as
            com.pulumi.awsnative.stepfunctions.StateMachine,
    )
}

/**
 * @see [StateMachine].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [StateMachine].
 */
public suspend fun stateMachine(
    name: String,
    block: suspend StateMachineResourceBuilder.() -> Unit,
): StateMachine {
    val builder = StateMachineResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [StateMachine].
 * @param name The _unique_ name of the resulting resource.
 */
public fun stateMachine(name: String): StateMachine {
    val builder = StateMachineResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy