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

com.pulumi.awsnative.imagebuilder.kotlin.ImageRecipe.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.imagebuilder.kotlin

import com.pulumi.awsnative.imagebuilder.kotlin.outputs.ImageRecipeAdditionalInstanceConfiguration
import com.pulumi.awsnative.imagebuilder.kotlin.outputs.ImageRecipeComponentConfiguration
import com.pulumi.awsnative.imagebuilder.kotlin.outputs.ImageRecipeInstanceBlockDeviceMapping
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.List
import kotlin.collections.Map
import com.pulumi.awsnative.imagebuilder.kotlin.outputs.ImageRecipeAdditionalInstanceConfiguration.Companion.toKotlin as imageRecipeAdditionalInstanceConfigurationToKotlin
import com.pulumi.awsnative.imagebuilder.kotlin.outputs.ImageRecipeComponentConfiguration.Companion.toKotlin as imageRecipeComponentConfigurationToKotlin
import com.pulumi.awsnative.imagebuilder.kotlin.outputs.ImageRecipeInstanceBlockDeviceMapping.Companion.toKotlin as imageRecipeInstanceBlockDeviceMappingToKotlin

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

    public var args: ImageRecipeArgs = ImageRecipeArgs()

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

/**
 * Resource schema for AWS::ImageBuilder::ImageRecipe
 */
public class ImageRecipe internal constructor(
    override val javaResource: com.pulumi.awsnative.imagebuilder.ImageRecipe,
) : KotlinCustomResource(javaResource, ImageRecipeMapper) {
    /**
     * Specify additional settings and launch scripts for your build instances.
     */
    public val additionalInstanceConfiguration: Output?
        get() = javaResource.additionalInstanceConfiguration().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    imageRecipeAdditionalInstanceConfigurationToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * The Amazon Resource Name (ARN) of the image recipe.
     */
    public val arn: Output
        get() = javaResource.arn().applyValue({ args0 -> args0 })

    /**
     * The block device mappings to apply when creating images from this recipe.
     */
    public val blockDeviceMappings: Output>?
        get() = javaResource.blockDeviceMappings().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 ->
                        imageRecipeInstanceBlockDeviceMappingToKotlin(args0)
                    })
                })
            }).orElse(null)
        })

    /**
     * The components of the image recipe.
     */
    public val components: Output>
        get() = javaResource.components().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    imageRecipeComponentConfigurationToKotlin(args0)
                })
            })
        })

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

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

    /**
     * The parent image of the image recipe.
     */
    public val parentImage: Output
        get() = javaResource.parentImage().applyValue({ args0 -> args0 })

    /**
     * The tags of the image recipe.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

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

    /**
     * The working directory to be used during build and test workflows.
     */
    public val workingDirectory: Output?
        get() = javaResource.workingDirectory().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })
}

public object ImageRecipeMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.imagebuilder.ImageRecipe::class == javaResource::class

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy