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

com.pulumi.aws.ec2.kotlin.AmiArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.aws.ec2.kotlin

import com.pulumi.aws.ec2.AmiArgs.builder
import com.pulumi.aws.ec2.kotlin.inputs.AmiEbsBlockDeviceArgs
import com.pulumi.aws.ec2.kotlin.inputs.AmiEbsBlockDeviceArgsBuilder
import com.pulumi.aws.ec2.kotlin.inputs.AmiEphemeralBlockDeviceArgs
import com.pulumi.aws.ec2.kotlin.inputs.AmiEphemeralBlockDeviceArgsBuilder
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.Boolean
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * The AMI resource allows the creation and management of a completely-custom
 * *Amazon Machine Image* (AMI).
 * If you just want to duplicate an existing AMI, possibly copying it to another
 * region, it's better to use `aws.ec2.AmiCopy` instead.
 * If you just want to share an existing AMI with another AWS account,
 * it's better to use `aws.ec2.AmiLaunchPermission` instead.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * // Create an AMI that will start a machine whose root device is backed by
 * // an EBS volume populated from a snapshot. We assume that such a snapshot
 * // already exists with the id "snap-xxxxxxxx".
 * const example = new aws.ec2.Ami("example", {
 *     name: "example",
 *     virtualizationType: "hvm",
 *     rootDeviceName: "/dev/xvda",
 *     imdsSupport: "v2.0",
 *     ebsBlockDevices: [{
 *         deviceName: "/dev/xvda",
 *         snapshotId: "snap-xxxxxxxx",
 *         volumeSize: 8,
 *     }],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * # Create an AMI that will start a machine whose root device is backed by
 * # an EBS volume populated from a snapshot. We assume that such a snapshot
 * # already exists with the id "snap-xxxxxxxx".
 * example = aws.ec2.Ami("example",
 *     name="example",
 *     virtualization_type="hvm",
 *     root_device_name="/dev/xvda",
 *     imds_support="v2.0",
 *     ebs_block_devices=[{
 *         "device_name": "/dev/xvda",
 *         "snapshot_id": "snap-xxxxxxxx",
 *         "volume_size": 8,
 *     }])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     // Create an AMI that will start a machine whose root device is backed by
 *     // an EBS volume populated from a snapshot. We assume that such a snapshot
 *     // already exists with the id "snap-xxxxxxxx".
 *     var example = new Aws.Ec2.Ami("example", new()
 *     {
 *         Name = "example",
 *         VirtualizationType = "hvm",
 *         RootDeviceName = "/dev/xvda",
 *         ImdsSupport = "v2.0",
 *         EbsBlockDevices = new[]
 *         {
 *             new Aws.Ec2.Inputs.AmiEbsBlockDeviceArgs
 *             {
 *                 DeviceName = "/dev/xvda",
 *                 SnapshotId = "snap-xxxxxxxx",
 *                 VolumeSize = 8,
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		// Create an AMI that will start a machine whose root device is backed by
 * 		// an EBS volume populated from a snapshot. We assume that such a snapshot
 * 		// already exists with the id "snap-xxxxxxxx".
 * 		_, err := ec2.NewAmi(ctx, "example", &ec2.AmiArgs{
 * 			Name:               pulumi.String("example"),
 * 			VirtualizationType: pulumi.String("hvm"),
 * 			RootDeviceName:     pulumi.String("/dev/xvda"),
 * 			ImdsSupport:        pulumi.String("v2.0"),
 * 			EbsBlockDevices: ec2.AmiEbsBlockDeviceArray{
 * 				&ec2.AmiEbsBlockDeviceArgs{
 * 					DeviceName: pulumi.String("/dev/xvda"),
 * 					SnapshotId: pulumi.String("snap-xxxxxxxx"),
 * 					VolumeSize: pulumi.Int(8),
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.aws.ec2.Ami;
 * import com.pulumi.aws.ec2.AmiArgs;
 * import com.pulumi.aws.ec2.inputs.AmiEbsBlockDeviceArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         // Create an AMI that will start a machine whose root device is backed by
 *         // an EBS volume populated from a snapshot. We assume that such a snapshot
 *         // already exists with the id "snap-xxxxxxxx".
 *         var example = new Ami("example", AmiArgs.builder()
 *             .name("example")
 *             .virtualizationType("hvm")
 *             .rootDeviceName("/dev/xvda")
 *             .imdsSupport("v2.0")
 *             .ebsBlockDevices(AmiEbsBlockDeviceArgs.builder()
 *                 .deviceName("/dev/xvda")
 *                 .snapshotId("snap-xxxxxxxx")
 *                 .volumeSize(8)
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   # Create an AMI that will start a machine whose root device is backed by
 *   # an EBS volume populated from a snapshot. We assume that such a snapshot
 *   # already exists with the id "snap-xxxxxxxx".
 *   example:
 *     type: aws:ec2:Ami
 *     properties:
 *       name: example
 *       virtualizationType: hvm
 *       rootDeviceName: /dev/xvda
 *       imdsSupport: v2.0
 *       ebsBlockDevices:
 *         - deviceName: /dev/xvda
 *           snapshotId: snap-xxxxxxxx
 *           volumeSize: 8
 * ```
 * 
 * ## Import
 * Using `pulumi import`, import `aws_ami` using the ID of the AMI. For example:
 * ```sh
 * $ pulumi import aws:ec2/ami:Ami example ami-12345678
 * ```
 * @property architecture Machine architecture for created instances. Defaults to "x86_64".
 * @property bootMode Boot mode of the AMI. For more information, see [Boot modes](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-boot.html) in the Amazon Elastic Compute Cloud User Guide.
 * @property deprecationTime Date and time to deprecate the AMI. If you specified a value for seconds, Amazon EC2 rounds the seconds to the nearest minute. Valid values: [RFC3339 time string](https://tools.ietf.org/html/rfc3339#section-5.8) (`YYYY-MM-DDTHH:MM:SSZ`)
 * @property description Longer, human-readable description for the AMI.
 * @property ebsBlockDevices Nested block describing an EBS block device that should be
 * attached to created instances. The structure of this block is described below.
 * @property enaSupport Whether enhanced networking with ENA is enabled. Defaults to `false`.
 * @property ephemeralBlockDevices Nested block describing an ephemeral block device that
 * should be attached to created instances. The structure of this block is described below.
 * @property imageLocation
 * @property imdsSupport If EC2 instances started from this image should require the use of the Instance Metadata Service V2 (IMDSv2), set this argument to `v2.0`. For more information, see [Configure instance metadata options for new instances](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-IMDS-new-instances.html#configure-IMDS-new-instances-ami-configuration).
 * @property kernelId
 * @property name Region-unique name for the AMI.
 * @property ramdiskId
 * @property rootDeviceName Name of the root device (for example, `/dev/sda1`, or `/dev/xvda`).
 * @property sriovNetSupport
 * @property tags Map of tags to assign to the resource. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
 * @property tpmSupport If the image is configured for NitroTPM support, the value is `v2.0`. For more information, see [NitroTPM](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitrotpm.html) in the Amazon Elastic Compute Cloud User Guide.
 * @property virtualizationType Keyword to choose what virtualization mode created instances
 * will use. Can be either "paravirtual" (the default) or "hvm". The choice of virtualization type
 * changes the set of further arguments that are required, as described below.
 */
public data class AmiArgs(
    public val architecture: Output? = null,
    public val bootMode: Output? = null,
    public val deprecationTime: Output? = null,
    public val description: Output? = null,
    public val ebsBlockDevices: Output>? = null,
    public val enaSupport: Output? = null,
    public val ephemeralBlockDevices: Output>? = null,
    public val imageLocation: Output? = null,
    public val imdsSupport: Output? = null,
    public val kernelId: Output? = null,
    public val name: Output? = null,
    public val ramdiskId: Output? = null,
    public val rootDeviceName: Output? = null,
    public val sriovNetSupport: Output? = null,
    public val tags: Output>? = null,
    public val tpmSupport: Output? = null,
    public val virtualizationType: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.aws.ec2.AmiArgs = com.pulumi.aws.ec2.AmiArgs.builder()
        .architecture(architecture?.applyValue({ args0 -> args0 }))
        .bootMode(bootMode?.applyValue({ args0 -> args0 }))
        .deprecationTime(deprecationTime?.applyValue({ args0 -> args0 }))
        .description(description?.applyValue({ args0 -> args0 }))
        .ebsBlockDevices(
            ebsBlockDevices?.applyValue({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                })
            }),
        )
        .enaSupport(enaSupport?.applyValue({ args0 -> args0 }))
        .ephemeralBlockDevices(
            ephemeralBlockDevices?.applyValue({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> args0.toJava() })
                })
            }),
        )
        .imageLocation(imageLocation?.applyValue({ args0 -> args0 }))
        .imdsSupport(imdsSupport?.applyValue({ args0 -> args0 }))
        .kernelId(kernelId?.applyValue({ args0 -> args0 }))
        .name(name?.applyValue({ args0 -> args0 }))
        .ramdiskId(ramdiskId?.applyValue({ args0 -> args0 }))
        .rootDeviceName(rootDeviceName?.applyValue({ args0 -> args0 }))
        .sriovNetSupport(sriovNetSupport?.applyValue({ args0 -> args0 }))
        .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
        .tpmSupport(tpmSupport?.applyValue({ args0 -> args0 }))
        .virtualizationType(virtualizationType?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [AmiArgs].
 */
@PulumiTagMarker
public class AmiArgsBuilder internal constructor() {
    private var architecture: Output? = null

    private var bootMode: Output? = null

    private var deprecationTime: Output? = null

    private var description: Output? = null

    private var ebsBlockDevices: Output>? = null

    private var enaSupport: Output? = null

    private var ephemeralBlockDevices: Output>? = null

    private var imageLocation: Output? = null

    private var imdsSupport: Output? = null

    private var kernelId: Output? = null

    private var name: Output? = null

    private var ramdiskId: Output? = null

    private var rootDeviceName: Output? = null

    private var sriovNetSupport: Output? = null

    private var tags: Output>? = null

    private var tpmSupport: Output? = null

    private var virtualizationType: Output? = null

    /**
     * @param value Machine architecture for created instances. Defaults to "x86_64".
     */
    @JvmName("vjunwjmtcederylx")
    public suspend fun architecture(`value`: Output) {
        this.architecture = value
    }

    /**
     * @param value Boot mode of the AMI. For more information, see [Boot modes](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-boot.html) in the Amazon Elastic Compute Cloud User Guide.
     */
    @JvmName("xdudekdvralgrphl")
    public suspend fun bootMode(`value`: Output) {
        this.bootMode = value
    }

    /**
     * @param value Date and time to deprecate the AMI. If you specified a value for seconds, Amazon EC2 rounds the seconds to the nearest minute. Valid values: [RFC3339 time string](https://tools.ietf.org/html/rfc3339#section-5.8) (`YYYY-MM-DDTHH:MM:SSZ`)
     */
    @JvmName("xfdbconwcoodbifh")
    public suspend fun deprecationTime(`value`: Output) {
        this.deprecationTime = value
    }

    /**
     * @param value Longer, human-readable description for the AMI.
     */
    @JvmName("jyjoskopqjajlgsn")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value Nested block describing an EBS block device that should be
     * attached to created instances. The structure of this block is described below.
     */
    @JvmName("uuvboaalninwjhsi")
    public suspend fun ebsBlockDevices(`value`: Output>) {
        this.ebsBlockDevices = value
    }

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

    /**
     * @param values Nested block describing an EBS block device that should be
     * attached to created instances. The structure of this block is described below.
     */
    @JvmName("mwiqlirjpseugotm")
    public suspend fun ebsBlockDevices(values: List>) {
        this.ebsBlockDevices = Output.all(values)
    }

    /**
     * @param value Whether enhanced networking with ENA is enabled. Defaults to `false`.
     */
    @JvmName("sopohvaewxmlndeg")
    public suspend fun enaSupport(`value`: Output) {
        this.enaSupport = value
    }

    /**
     * @param value Nested block describing an ephemeral block device that
     * should be attached to created instances. The structure of this block is described below.
     */
    @JvmName("sfruqaajkeltpbns")
    public suspend fun ephemeralBlockDevices(`value`: Output>) {
        this.ephemeralBlockDevices = value
    }

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

    /**
     * @param values Nested block describing an ephemeral block device that
     * should be attached to created instances. The structure of this block is described below.
     */
    @JvmName("xqslwmvreaudtgvg")
    public suspend fun ephemeralBlockDevices(values: List>) {
        this.ephemeralBlockDevices = Output.all(values)
    }

    /**
     * @param value
     */
    @JvmName("xpmxhmovtstisbdn")
    public suspend fun imageLocation(`value`: Output) {
        this.imageLocation = value
    }

    /**
     * @param value If EC2 instances started from this image should require the use of the Instance Metadata Service V2 (IMDSv2), set this argument to `v2.0`. For more information, see [Configure instance metadata options for new instances](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-IMDS-new-instances.html#configure-IMDS-new-instances-ami-configuration).
     */
    @JvmName("lnbrgsrwijhxocnw")
    public suspend fun imdsSupport(`value`: Output) {
        this.imdsSupport = value
    }

    /**
     * @param value
     */
    @JvmName("ybkjicsqtcatpqfq")
    public suspend fun kernelId(`value`: Output) {
        this.kernelId = value
    }

    /**
     * @param value Region-unique name for the AMI.
     */
    @JvmName("luvglneyqdxycxrs")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value
     */
    @JvmName("wslstgkpyrkydnmg")
    public suspend fun ramdiskId(`value`: Output) {
        this.ramdiskId = value
    }

    /**
     * @param value Name of the root device (for example, `/dev/sda1`, or `/dev/xvda`).
     */
    @JvmName("kbovlchkjbqmqhml")
    public suspend fun rootDeviceName(`value`: Output) {
        this.rootDeviceName = value
    }

    /**
     * @param value
     */
    @JvmName("dvbfxpeibcvyvmhq")
    public suspend fun sriovNetSupport(`value`: Output) {
        this.sriovNetSupport = value
    }

    /**
     * @param value Map of tags to assign to the resource. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
     */
    @JvmName("ipxyaxysfmditojp")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value If the image is configured for NitroTPM support, the value is `v2.0`. For more information, see [NitroTPM](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitrotpm.html) in the Amazon Elastic Compute Cloud User Guide.
     */
    @JvmName("ghtxcwvwuexleewx")
    public suspend fun tpmSupport(`value`: Output) {
        this.tpmSupport = value
    }

    /**
     * @param value Keyword to choose what virtualization mode created instances
     * will use. Can be either "paravirtual" (the default) or "hvm". The choice of virtualization type
     * changes the set of further arguments that are required, as described below.
     */
    @JvmName("qnhpewpgbvicdxig")
    public suspend fun virtualizationType(`value`: Output) {
        this.virtualizationType = value
    }

    /**
     * @param value Machine architecture for created instances. Defaults to "x86_64".
     */
    @JvmName("pprhekhqppjbqmij")
    public suspend fun architecture(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.architecture = mapped
    }

    /**
     * @param value Boot mode of the AMI. For more information, see [Boot modes](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-boot.html) in the Amazon Elastic Compute Cloud User Guide.
     */
    @JvmName("qhohjnwslebddbkj")
    public suspend fun bootMode(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.bootMode = mapped
    }

    /**
     * @param value Date and time to deprecate the AMI. If you specified a value for seconds, Amazon EC2 rounds the seconds to the nearest minute. Valid values: [RFC3339 time string](https://tools.ietf.org/html/rfc3339#section-5.8) (`YYYY-MM-DDTHH:MM:SSZ`)
     */
    @JvmName("urdcptylubjhbtbd")
    public suspend fun deprecationTime(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.deprecationTime = mapped
    }

    /**
     * @param value Longer, human-readable description for the AMI.
     */
    @JvmName("aycvyeyjkpgptvwg")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value Nested block describing an EBS block device that should be
     * attached to created instances. The structure of this block is described below.
     */
    @JvmName("bbodxjlowlxggsie")
    public suspend fun ebsBlockDevices(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ebsBlockDevices = mapped
    }

    /**
     * @param argument Nested block describing an EBS block device that should be
     * attached to created instances. The structure of this block is described below.
     */
    @JvmName("ihwfrrkklyrvcuqi")
    public suspend fun ebsBlockDevices(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            AmiEbsBlockDeviceArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.ebsBlockDevices = mapped
    }

    /**
     * @param argument Nested block describing an EBS block device that should be
     * attached to created instances. The structure of this block is described below.
     */
    @JvmName("bjoqbtmwisxdbrve")
    public suspend fun ebsBlockDevices(vararg argument: suspend AmiEbsBlockDeviceArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            AmiEbsBlockDeviceArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.ebsBlockDevices = mapped
    }

    /**
     * @param argument Nested block describing an EBS block device that should be
     * attached to created instances. The structure of this block is described below.
     */
    @JvmName("rkelmauuottterlm")
    public suspend fun ebsBlockDevices(argument: suspend AmiEbsBlockDeviceArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(AmiEbsBlockDeviceArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.ebsBlockDevices = mapped
    }

    /**
     * @param values Nested block describing an EBS block device that should be
     * attached to created instances. The structure of this block is described below.
     */
    @JvmName("qwevqrgbljsdahmf")
    public suspend fun ebsBlockDevices(vararg values: AmiEbsBlockDeviceArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.ebsBlockDevices = mapped
    }

    /**
     * @param value Whether enhanced networking with ENA is enabled. Defaults to `false`.
     */
    @JvmName("lwfveljwtuxjfddr")
    public suspend fun enaSupport(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enaSupport = mapped
    }

    /**
     * @param value Nested block describing an ephemeral block device that
     * should be attached to created instances. The structure of this block is described below.
     */
    @JvmName("vahitvpotmlvghto")
    public suspend fun ephemeralBlockDevices(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ephemeralBlockDevices = mapped
    }

    /**
     * @param argument Nested block describing an ephemeral block device that
     * should be attached to created instances. The structure of this block is described below.
     */
    @JvmName("pduyiiakjfhblgjw")
    public suspend fun ephemeralBlockDevices(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            AmiEphemeralBlockDeviceArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.ephemeralBlockDevices = mapped
    }

    /**
     * @param argument Nested block describing an ephemeral block device that
     * should be attached to created instances. The structure of this block is described below.
     */
    @JvmName("dlyhcsuuknmaandq")
    public suspend fun ephemeralBlockDevices(vararg argument: suspend AmiEphemeralBlockDeviceArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            AmiEphemeralBlockDeviceArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.ephemeralBlockDevices = mapped
    }

    /**
     * @param argument Nested block describing an ephemeral block device that
     * should be attached to created instances. The structure of this block is described below.
     */
    @JvmName("imffpqpavvrccujb")
    public suspend fun ephemeralBlockDevices(argument: suspend AmiEphemeralBlockDeviceArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            AmiEphemeralBlockDeviceArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.ephemeralBlockDevices = mapped
    }

    /**
     * @param values Nested block describing an ephemeral block device that
     * should be attached to created instances. The structure of this block is described below.
     */
    @JvmName("jydfnlsxdqbodton")
    public suspend fun ephemeralBlockDevices(vararg values: AmiEphemeralBlockDeviceArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.ephemeralBlockDevices = mapped
    }

    /**
     * @param value
     */
    @JvmName("mjudjfjunrjentuy")
    public suspend fun imageLocation(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.imageLocation = mapped
    }

    /**
     * @param value If EC2 instances started from this image should require the use of the Instance Metadata Service V2 (IMDSv2), set this argument to `v2.0`. For more information, see [Configure instance metadata options for new instances](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-IMDS-new-instances.html#configure-IMDS-new-instances-ami-configuration).
     */
    @JvmName("aryfqocevxthsuxy")
    public suspend fun imdsSupport(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.imdsSupport = mapped
    }

    /**
     * @param value
     */
    @JvmName("lchdrtgmkfyuarnb")
    public suspend fun kernelId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.kernelId = mapped
    }

    /**
     * @param value Region-unique name for the AMI.
     */
    @JvmName("emokqwtbbgehxwhq")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value
     */
    @JvmName("utkyesxwtqwmtfss")
    public suspend fun ramdiskId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ramdiskId = mapped
    }

    /**
     * @param value Name of the root device (for example, `/dev/sda1`, or `/dev/xvda`).
     */
    @JvmName("phtvyfrfkxmmaohc")
    public suspend fun rootDeviceName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.rootDeviceName = mapped
    }

    /**
     * @param value
     */
    @JvmName("kumocjtwsvrcmcgq")
    public suspend fun sriovNetSupport(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sriovNetSupport = mapped
    }

    /**
     * @param value Map of tags to assign to the resource. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
     */
    @JvmName("hkwrbwebhfqsoxar")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values Map of tags to assign to the resource. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
     */
    @JvmName("nhdffkeymwjohskg")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param value If the image is configured for NitroTPM support, the value is `v2.0`. For more information, see [NitroTPM](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitrotpm.html) in the Amazon Elastic Compute Cloud User Guide.
     */
    @JvmName("qleifkwkixeyskqr")
    public suspend fun tpmSupport(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tpmSupport = mapped
    }

    /**
     * @param value Keyword to choose what virtualization mode created instances
     * will use. Can be either "paravirtual" (the default) or "hvm". The choice of virtualization type
     * changes the set of further arguments that are required, as described below.
     */
    @JvmName("usmssctadqlrrgxx")
    public suspend fun virtualizationType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.virtualizationType = mapped
    }

    internal fun build(): AmiArgs = AmiArgs(
        architecture = architecture,
        bootMode = bootMode,
        deprecationTime = deprecationTime,
        description = description,
        ebsBlockDevices = ebsBlockDevices,
        enaSupport = enaSupport,
        ephemeralBlockDevices = ephemeralBlockDevices,
        imageLocation = imageLocation,
        imdsSupport = imdsSupport,
        kernelId = kernelId,
        name = name,
        ramdiskId = ramdiskId,
        rootDeviceName = rootDeviceName,
        sriovNetSupport = sriovNetSupport,
        tags = tags,
        tpmSupport = tpmSupport,
        virtualizationType = virtualizationType,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy