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

com.pulumi.awsnative.ec2.kotlin.LaunchTemplateArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.awsnative.ec2.kotlin

import com.pulumi.awsnative.ec2.LaunchTemplateArgs.builder
import com.pulumi.awsnative.ec2.kotlin.inputs.LaunchTemplateDataArgs
import com.pulumi.awsnative.ec2.kotlin.inputs.LaunchTemplateDataArgsBuilder
import com.pulumi.awsnative.ec2.kotlin.inputs.LaunchTemplateTagSpecificationArgs
import com.pulumi.awsnative.ec2.kotlin.inputs.LaunchTemplateTagSpecificationArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Specifies the properties for creating a launch template.
 *  The minimum required properties for specifying a launch template are as follows:
 *   +  You must specify at least one property for the launch template data.
 *   +  You can optionally specify a name for the launch template. If you do not specify a name, CFN creates a name for you.
 *  A launch template can contain some or all of the configuration information to launch an instance. When you launch an instance using a launch template, instance properties that are not specified in the launch template use default values, except the ``ImageId`` property, which has no default value. If you do not specify an AMI ID for the launch template ``ImageId`` property, you must specify an AMI ID for the instance ``ImageId`` property.
 *  For more information, see [Launch an instance from a launch template](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html) in the *Amazon EC2 User Guide*.
 * @property launchTemplateData The information for the launch template.
 * @property launchTemplateName A name for the launch template.
 * @property tagSpecifications The tags to apply to the launch template on creation. To tag the launch template, the resource type must be ``launch-template``.
 *  To specify the tags for the resources that are created when an instance is launched, you must use [TagSpecifications](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata.html#cfn-ec2-launchtemplate-launchtemplatedata-tagspecifications).
 * @property versionDescription A description for the first version of the launch template.
 */
public data class LaunchTemplateArgs(
    public val launchTemplateData: Output? = null,
    public val launchTemplateName: Output? = null,
    public val tagSpecifications: Output>? = null,
    public val versionDescription: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.awsnative.ec2.LaunchTemplateArgs =
        com.pulumi.awsnative.ec2.LaunchTemplateArgs.builder()
            .launchTemplateData(
                launchTemplateData?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .launchTemplateName(launchTemplateName?.applyValue({ args0 -> args0 }))
            .tagSpecifications(
                tagSpecifications?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .versionDescription(versionDescription?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [LaunchTemplateArgs].
 */
@PulumiTagMarker
public class LaunchTemplateArgsBuilder internal constructor() {
    private var launchTemplateData: Output? = null

    private var launchTemplateName: Output? = null

    private var tagSpecifications: Output>? = null

    private var versionDescription: Output? = null

    /**
     * @param value The information for the launch template.
     */
    @JvmName("haupcjplvlqqgrst")
    public suspend fun launchTemplateData(`value`: Output) {
        this.launchTemplateData = value
    }

    /**
     * @param value A name for the launch template.
     */
    @JvmName("jjasvvbbsjfawnqc")
    public suspend fun launchTemplateName(`value`: Output) {
        this.launchTemplateName = value
    }

    /**
     * @param value The tags to apply to the launch template on creation. To tag the launch template, the resource type must be ``launch-template``.
     *  To specify the tags for the resources that are created when an instance is launched, you must use [TagSpecifications](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata.html#cfn-ec2-launchtemplate-launchtemplatedata-tagspecifications).
     */
    @JvmName("qqcjossjirggtctc")
    public suspend fun tagSpecifications(`value`: Output>) {
        this.tagSpecifications = value
    }

    @JvmName("jylmwciddogkdxdn")
    public suspend fun tagSpecifications(vararg values: Output) {
        this.tagSpecifications = Output.all(values.asList())
    }

    /**
     * @param values The tags to apply to the launch template on creation. To tag the launch template, the resource type must be ``launch-template``.
     *  To specify the tags for the resources that are created when an instance is launched, you must use [TagSpecifications](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata.html#cfn-ec2-launchtemplate-launchtemplatedata-tagspecifications).
     */
    @JvmName("ligetwwckyxhfwgq")
    public suspend fun tagSpecifications(values: List>) {
        this.tagSpecifications = Output.all(values)
    }

    /**
     * @param value A description for the first version of the launch template.
     */
    @JvmName("wdrcyrnrrygpmmrv")
    public suspend fun versionDescription(`value`: Output) {
        this.versionDescription = value
    }

    /**
     * @param value The information for the launch template.
     */
    @JvmName("akiqdjvhxlypmpld")
    public suspend fun launchTemplateData(`value`: LaunchTemplateDataArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.launchTemplateData = mapped
    }

    /**
     * @param argument The information for the launch template.
     */
    @JvmName("nbhrsrmltlotwmcm")
    public suspend fun launchTemplateData(argument: suspend LaunchTemplateDataArgsBuilder.() -> Unit) {
        val toBeMapped = LaunchTemplateDataArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.launchTemplateData = mapped
    }

    /**
     * @param value A name for the launch template.
     */
    @JvmName("eijbvgoudoxcyhdc")
    public suspend fun launchTemplateName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.launchTemplateName = mapped
    }

    /**
     * @param value The tags to apply to the launch template on creation. To tag the launch template, the resource type must be ``launch-template``.
     *  To specify the tags for the resources that are created when an instance is launched, you must use [TagSpecifications](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata.html#cfn-ec2-launchtemplate-launchtemplatedata-tagspecifications).
     */
    @JvmName("uxuimixplxuvwaid")
    public suspend fun tagSpecifications(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tagSpecifications = mapped
    }

    /**
     * @param argument The tags to apply to the launch template on creation. To tag the launch template, the resource type must be ``launch-template``.
     *  To specify the tags for the resources that are created when an instance is launched, you must use [TagSpecifications](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata.html#cfn-ec2-launchtemplate-launchtemplatedata-tagspecifications).
     */
    @JvmName("sxurthqifqkpumue")
    public suspend fun tagSpecifications(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            LaunchTemplateTagSpecificationArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.tagSpecifications = mapped
    }

    /**
     * @param argument The tags to apply to the launch template on creation. To tag the launch template, the resource type must be ``launch-template``.
     *  To specify the tags for the resources that are created when an instance is launched, you must use [TagSpecifications](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata.html#cfn-ec2-launchtemplate-launchtemplatedata-tagspecifications).
     */
    @JvmName("jdmmqrdbtalijouf")
    public suspend fun tagSpecifications(vararg argument: suspend LaunchTemplateTagSpecificationArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            LaunchTemplateTagSpecificationArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.tagSpecifications = mapped
    }

    /**
     * @param argument The tags to apply to the launch template on creation. To tag the launch template, the resource type must be ``launch-template``.
     *  To specify the tags for the resources that are created when an instance is launched, you must use [TagSpecifications](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata.html#cfn-ec2-launchtemplate-launchtemplatedata-tagspecifications).
     */
    @JvmName("gipdecosvanpqykc")
    public suspend fun tagSpecifications(argument: suspend LaunchTemplateTagSpecificationArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            LaunchTemplateTagSpecificationArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.tagSpecifications = mapped
    }

    /**
     * @param values The tags to apply to the launch template on creation. To tag the launch template, the resource type must be ``launch-template``.
     *  To specify the tags for the resources that are created when an instance is launched, you must use [TagSpecifications](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata.html#cfn-ec2-launchtemplate-launchtemplatedata-tagspecifications).
     */
    @JvmName("vrkwljbrcdyvccrx")
    public suspend fun tagSpecifications(vararg values: LaunchTemplateTagSpecificationArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tagSpecifications = mapped
    }

    /**
     * @param value A description for the first version of the launch template.
     */
    @JvmName("csunboptqkhyhxer")
    public suspend fun versionDescription(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.versionDescription = mapped
    }

    internal fun build(): LaunchTemplateArgs = LaunchTemplateArgs(
        launchTemplateData = launchTemplateData,
        launchTemplateName = launchTemplateName,
        tagSpecifications = tagSpecifications,
        versionDescription = versionDescription,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy