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

com.pulumi.awsnative.greengrassv2.kotlin.Deployment.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.greengrassv2.kotlin

import com.pulumi.awsnative.greengrassv2.kotlin.outputs.DeploymentComponentDeploymentSpecification
import com.pulumi.awsnative.greengrassv2.kotlin.outputs.DeploymentIoTJobConfiguration
import com.pulumi.awsnative.greengrassv2.kotlin.outputs.DeploymentPolicies
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.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import com.pulumi.awsnative.greengrassv2.kotlin.outputs.DeploymentComponentDeploymentSpecification.Companion.toKotlin as deploymentComponentDeploymentSpecificationToKotlin
import com.pulumi.awsnative.greengrassv2.kotlin.outputs.DeploymentIoTJobConfiguration.Companion.toKotlin as deploymentIoTJobConfigurationToKotlin
import com.pulumi.awsnative.greengrassv2.kotlin.outputs.DeploymentPolicies.Companion.toKotlin as deploymentPoliciesToKotlin

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

    public var args: DeploymentArgs = DeploymentArgs()

    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 DeploymentArgsBuilder.() -> Unit) {
        val builder = DeploymentArgsBuilder()
        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(): Deployment {
        val builtJavaResource = com.pulumi.awsnative.greengrassv2.Deployment(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return Deployment(builtJavaResource)
    }
}

/**
 * Resource for Greengrass V2 deployment.
 */
public class Deployment internal constructor(
    override val javaResource: com.pulumi.awsnative.greengrassv2.Deployment,
) : KotlinCustomResource(javaResource, DeploymentMapper) {
    /**
     * The components to deploy. This is a dictionary, where each key is the name of a component, and each key's value is the version and configuration to deploy for that component.
     */
    public val components: Output>?
        get() = javaResource.components().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(
                        args0.value.let({ args0 ->
                            deploymentComponentDeploymentSpecificationToKotlin(args0)
                        }),
                    )
                }).toMap()
            }).orElse(null)
        })

    /**
     * The ID of the deployment.
     */
    public val deploymentId: Output
        get() = javaResource.deploymentId().applyValue({ args0 -> args0 })

    /**
     * The name of the deployment.
     */
    public val deploymentName: Output?
        get() = javaResource.deploymentName().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The deployment policies for the deployment. These policies define how the deployment updates components and handles failure.
     */
    public val deploymentPolicies: Output?
        get() = javaResource.deploymentPolicies().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> deploymentPoliciesToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * The job configuration for the deployment configuration. The job configuration specifies the rollout, timeout, and stop configurations for the deployment configuration.
     */
    public val iotJobConfiguration: Output?
        get() = javaResource.iotJobConfiguration().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> deploymentIoTJobConfigurationToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * The parent deployment's [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) for a subdeployment.
     */
    public val parentTargetArn: Output?
        get() = javaResource.parentTargetArn().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Application-specific metadata to attach to the deployment. You can use tags in IAM policies to control access to AWS IoT Greengrass resources. You can also use tags to categorize your resources. For more information, see [Tag your AWS IoT Greengrass Version 2 resources](https://docs.aws.amazon.com/greengrass/v2/developerguide/tag-resources.html) in the *AWS IoT Greengrass V2 Developer Guide* .
     * This `Json` property type is processed as a map of key-value pairs. It uses the following format, which is different from most `Tags` implementations in AWS CloudFormation templates.
     * ```json
     * "Tags": { "KeyName0": "value", "KeyName1": "value", "KeyName2": "value"
     * }
     * ```
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * The ARN of the target AWS IoT thing or thing group.
     */
    public val targetArn: Output
        get() = javaResource.targetArn().applyValue({ args0 -> args0 })
}

public object DeploymentMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.greengrassv2.Deployment::class == javaResource::class

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy