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

com.pulumi.awsnative.greengrassv2.kotlin.ComponentVersion.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.ComponentVersionLambdaFunctionRecipeSource
import com.pulumi.awsnative.greengrassv2.kotlin.outputs.ComponentVersionLambdaFunctionRecipeSource.Companion.toKotlin
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

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

    public var args: ComponentVersionArgs = ComponentVersionArgs()

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

/**
 * Resource for Greengrass component version.
 */
public class ComponentVersion internal constructor(
    override val javaResource: com.pulumi.awsnative.greengrassv2.ComponentVersion,
) : KotlinCustomResource(javaResource, ComponentVersionMapper) {
    /**
     * The ARN of the component version.
     */
    public val arn: Output
        get() = javaResource.arn().applyValue({ args0 -> args0 })

    /**
     * The name of the component.
     */
    public val componentName: Output
        get() = javaResource.componentName().applyValue({ args0 -> args0 })

    /**
     * The version of the component.
     */
    public val componentVersion: Output
        get() = javaResource.componentVersion().applyValue({ args0 -> args0 })

    /**
     * The recipe to use to create the component. The recipe defines the component's metadata, parameters, dependencies, lifecycle, artifacts, and platform compatibility.
     * You must specify either `InlineRecipe` or `LambdaFunction` .
     */
    public val inlineRecipe: Output?
        get() = javaResource.inlineRecipe().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The parameters to create a component from a Lambda function.
     * You must specify either `InlineRecipe` or `LambdaFunction` .
     */
    public val lambdaFunction: Output?
        get() = javaResource.lambdaFunction().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> toKotlin(args0) })
            }).orElse(null)
        })

    /**
     * Application-specific metadata to attach to the component version. 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)
        })
}

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

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy