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

com.pulumi.awsnative.ec2.kotlin.outputs.LaunchTemplateData.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.ec2.kotlin.outputs

import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List

/**
 * The information to include in the launch template.
 *   You must specify at least one parameter for the launch template data.
 * @property blockDeviceMappings The block device mapping.
 * @property capacityReservationSpecification The Capacity Reservation targeting option. If you do not specify this parameter, the instance's Capacity Reservation preference defaults to ``open``, which enables it to run in any open Capacity Reservation that has matching attributes (instance type, platform, Availability Zone).
 * @property cpuOptions The CPU options for the instance. For more information, see [Optimize CPU options](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html) in the *Amazon EC2 User Guide*.
 * @property creditSpecification The credit option for CPU usage of the instance. Valid only for T instances.
 * @property disableApiStop Indicates whether to enable the instance for stop protection. For more information, see [Enable stop protection for your instance](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-stop-protection.html) in the *Amazon EC2 User Guide*.
 * @property disableApiTermination If you set this parameter to ``true``, you can't terminate the instance using the Amazon EC2 console, CLI, or API; otherwise, you can. To change this attribute after launch, use [ModifyInstanceAttribute](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyInstanceAttribute.html). Alternatively, if you set ``InstanceInitiatedShutdownBehavior`` to ``terminate``, you can terminate the instance by running the shutdown command from the instance.
 * @property ebsOptimized Indicates whether the instance is optimized for Amazon EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal Amazon EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS-optimized instance.
 * @property elasticGpuSpecifications Deprecated.
 *   Amazon Elastic Graphics reached end of life on January 8, 2024. For workloads that require graphics acceleration, we recommend that you use Amazon EC2 G4ad, G4dn, or G5 instances.
 * @property elasticInferenceAccelerators An elastic inference accelerator to associate with the instance. Elastic inference accelerators are a resource you can attach to your Amazon EC2 instances to accelerate your Deep Learning (DL) inference workloads.
 *  You cannot specify accelerators from different generations in the same request.
 *   Starting April 15, 2023, AWS will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performance. After April 15, 2023, new customers will not be able to launch instances with Amazon EI accelerators in Amazon SageMaker, Amazon ECS, or Amazon EC2. However, customers who have used Amazon EI at least once during the past 30-day period are considered current customers and will be able to continue using the service.
 * @property enclaveOptions Indicates whether the instance is enabled for AWS Nitro Enclaves. For more information, see [What is Nitro Enclaves?](https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave.html) in the *Nitro Enclaves User Guide*.
 *  You can't enable AWS Nitro Enclaves and hibernation on the same instance.
 * @property hibernationOptions Indicates whether an instance is enabled for hibernation. This parameter is valid only if the instance meets the [hibernation prerequisites](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hibernating-prerequisites.html). For more information, see [Hibernate your Amazon EC2 instance](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html) in the *Amazon EC2 User Guide*.
 * @property iamInstanceProfile The name or Amazon Resource Name (ARN) of an IAM instance profile.
 * @property imageId The ID of the AMI. Alternatively, you can specify a Systems Manager parameter, which will resolve to an AMI ID on launch.
 *  Valid formats:
 *   +   ``ami-17characters00000``
 *   +   ``resolve:ssm:parameter-name``
 *   +   ``resolve:ssm:parameter-name:version-number``
 *   +   ``resolve:ssm:parameter-name:label``
 *  For more information, see [Use a Systems Manager parameter to find an AMI](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/finding-an-ami.html#using-systems-manager-parameter-to-find-AMI) in the *Amazon Elastic Compute Cloud User Guide*.
 * @property instanceInitiatedShutdownBehavior Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).
 *  Default: ``stop``
 * @property instanceMarketOptions The market (purchasing) option for the instances.
 * @property instanceRequirements The attributes for the instance types. When you specify instance attributes, Amazon EC2 will identify instance types with these attributes.
 *  You must specify ``VCpuCount`` and ``MemoryMiB``. All other attributes are optional. Any unspecified optional attribute is set to its default.
 *  When you specify multiple attributes, you get instance types that satisfy all of the specified attributes. If you specify multiple values for an attribute, you get instance types that satisfy any of the specified values.
 *  To limit the list of instance types from which Amazon EC2 can identify matching instance types, you can use one of the following parameters, but not both in the same request:
 *   +   ``AllowedInstanceTypes`` - The instance types to include in the list. All other instance types are ignored, even if they match your specified attributes.
 *   +   ``ExcludedInstanceTypes`` - The instance types to exclude from the list, even if they match your specified attributes.
 *   If you specify ``InstanceRequirements``, you can't specify ``InstanceType``.
 *  Attribute-based instance type selection is only supported when using Auto Scaling groups, EC2 Fleet, and Spot Fleet to launch instances. If you plan to use the launch template in the [launch instance wizard](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-instance-wizard.html), or with the [RunInstances](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html) API or [AWS::EC2::Instance](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance.html) AWS CloudFormation resource, you can't specify ``InstanceRequirements``.
 *   For more information, see [Attribute-based instance type selection for EC2 Fleet](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-attribute-based-instance-type-selection.html), [Attribute-based instance type selection for Spot Fleet](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-attribute-based-instance-type-selection.html), and [Spot placement score](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-placement-score.html) in the *Amazon EC2 User Guide*.
 * @property instanceType The instance type. For more information, see [Amazon EC2 instance types](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) in the *Amazon EC2 User Guide*.
 *  If you specify ``InstanceType``, you can't specify ``InstanceRequirements``.
 * @property kernelId The ID of the kernel.
 *  We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see [User Provided Kernels](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html) in the *Amazon EC2 User Guide*.
 * @property keyName The name of the key pair. You can create a key pair using [CreateKeyPair](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateKeyPair.html) or [ImportKeyPair](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportKeyPair.html).
 *   If you do not specify a key pair, you can't connect to the instance unless you choose an AMI that is configured to allow users another way to log in.
 * @property licenseSpecifications The license configurations.
 * @property maintenanceOptions The maintenance options of your instance.
 * @property metadataOptions The metadata options for the instance. For more information, see [Instance metadata and user data](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) in the *Amazon EC2 User Guide*.
 * @property monitoring The monitoring for the instance.
 * @property networkInterfaces The network interfaces for the instance.
 * @property placement The placement for the instance.
 * @property privateDnsNameOptions The hostname type for EC2 instances launched into this subnet and how DNS A and AAAA record queries should be handled. For more information, see [Amazon EC2 instance hostname types](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-naming.html) in the *User Guide*.
 * @property ramDiskId The ID of the RAM disk.
 *   We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see [User provided kernels](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html) in the *Amazon EC2 User Guide*.
 * @property securityGroupIds The IDs of the security groups. You can specify the IDs of existing security groups and references to resources created by the stack template.
 *  If you specify a network interface, you must specify any security groups as part of the network interface instead.
 * @property securityGroups The names of the security groups. For a nondefault VPC, you must use security group IDs instead.
 *  If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.
 * @property tagSpecifications The tags to apply to the resources that are created during instance launch.
 *  To tag a resource after it has been created, see [CreateTags](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html).
 *  To tag the launch template itself, use [TagSpecifications](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html#cfn-ec2-launchtemplate-tagspecifications).
 * @property userData The user data to make available to the instance. You must provide base64-encoded text. User data is limited to 16 KB. For more information, see [Run commands on your Amazon EC2 instance at launch](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html) in the *Amazon EC2 User Guide*.
 *  If you are creating the launch template for use with BATCH, the user data must be provided in the [MIME multi-part archive format](https://docs.aws.amazon.com/https://cloudinit.readthedocs.io/en/latest/topics/format.html#mime-multi-part-archive). For more information, see [Amazon EC2 user data in launch templates](https://docs.aws.amazon.com/batch/latest/userguide/launch-templates.html) in the *User Guide*.
 */
public data class LaunchTemplateData(
    public val blockDeviceMappings: List? = null,
    public val capacityReservationSpecification: LaunchTemplateCapacityReservationSpecification? =
        null,
    public val cpuOptions: LaunchTemplateCpuOptions? = null,
    public val creditSpecification: LaunchTemplateCreditSpecification? = null,
    public val disableApiStop: Boolean? = null,
    public val disableApiTermination: Boolean? = null,
    public val ebsOptimized: Boolean? = null,
    public val elasticGpuSpecifications: List? = null,
    public val elasticInferenceAccelerators: List? = null,
    public val enclaveOptions: LaunchTemplateEnclaveOptions? = null,
    public val hibernationOptions: LaunchTemplateHibernationOptions? = null,
    public val iamInstanceProfile: LaunchTemplateIamInstanceProfile? = null,
    public val imageId: String? = null,
    public val instanceInitiatedShutdownBehavior: String? = null,
    public val instanceMarketOptions: LaunchTemplateInstanceMarketOptions? = null,
    public val instanceRequirements: LaunchTemplateInstanceRequirements? = null,
    public val instanceType: String? = null,
    public val kernelId: String? = null,
    public val keyName: String? = null,
    public val licenseSpecifications: List? = null,
    public val maintenanceOptions: LaunchTemplateMaintenanceOptions? = null,
    public val metadataOptions: LaunchTemplateMetadataOptions? = null,
    public val monitoring: LaunchTemplateMonitoring? = null,
    public val networkInterfaces: List? = null,
    public val placement: LaunchTemplatePlacement? = null,
    public val privateDnsNameOptions: LaunchTemplatePrivateDnsNameOptions? = null,
    public val ramDiskId: String? = null,
    public val securityGroupIds: List? = null,
    public val securityGroups: List? = null,
    public val tagSpecifications: List? = null,
    public val userData: String? = null,
) {
    public companion object {
        public fun toKotlin(javaType: com.pulumi.awsnative.ec2.outputs.LaunchTemplateData): LaunchTemplateData = LaunchTemplateData(
            blockDeviceMappings = javaType.blockDeviceMappings().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.awsnative.ec2.kotlin.outputs.LaunchTemplateBlockDeviceMapping.Companion.toKotlin(args0)
                })
            }),
            capacityReservationSpecification = javaType.capacityReservationSpecification().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.awsnative.ec2.kotlin.outputs.LaunchTemplateCapacityReservationSpecification.Companion.toKotlin(args0)
                })
            }).orElse(null),
            cpuOptions = javaType.cpuOptions().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.awsnative.ec2.kotlin.outputs.LaunchTemplateCpuOptions.Companion.toKotlin(args0)
                })
            }).orElse(null),
            creditSpecification = javaType.creditSpecification().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.awsnative.ec2.kotlin.outputs.LaunchTemplateCreditSpecification.Companion.toKotlin(args0)
                })
            }).orElse(null),
            disableApiStop = javaType.disableApiStop().map({ args0 -> args0 }).orElse(null),
            disableApiTermination = javaType.disableApiTermination().map({ args0 -> args0 }).orElse(null),
            ebsOptimized = javaType.ebsOptimized().map({ args0 -> args0 }).orElse(null),
            elasticGpuSpecifications = javaType.elasticGpuSpecifications().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.awsnative.ec2.kotlin.outputs.LaunchTemplateElasticGpuSpecification.Companion.toKotlin(args0)
                })
            }),
            elasticInferenceAccelerators = javaType.elasticInferenceAccelerators().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.awsnative.ec2.kotlin.outputs.LaunchTemplateElasticInferenceAccelerator.Companion.toKotlin(args0)
                })
            }),
            enclaveOptions = javaType.enclaveOptions().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.awsnative.ec2.kotlin.outputs.LaunchTemplateEnclaveOptions.Companion.toKotlin(args0)
                })
            }).orElse(null),
            hibernationOptions = javaType.hibernationOptions().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.awsnative.ec2.kotlin.outputs.LaunchTemplateHibernationOptions.Companion.toKotlin(args0)
                })
            }).orElse(null),
            iamInstanceProfile = javaType.iamInstanceProfile().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.awsnative.ec2.kotlin.outputs.LaunchTemplateIamInstanceProfile.Companion.toKotlin(args0)
                })
            }).orElse(null),
            imageId = javaType.imageId().map({ args0 -> args0 }).orElse(null),
            instanceInitiatedShutdownBehavior = javaType.instanceInitiatedShutdownBehavior().map({ args0 ->
                args0
            }).orElse(null),
            instanceMarketOptions = javaType.instanceMarketOptions().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.awsnative.ec2.kotlin.outputs.LaunchTemplateInstanceMarketOptions.Companion.toKotlin(args0)
                })
            }).orElse(null),
            instanceRequirements = javaType.instanceRequirements().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.awsnative.ec2.kotlin.outputs.LaunchTemplateInstanceRequirements.Companion.toKotlin(args0)
                })
            }).orElse(null),
            instanceType = javaType.instanceType().map({ args0 -> args0 }).orElse(null),
            kernelId = javaType.kernelId().map({ args0 -> args0 }).orElse(null),
            keyName = javaType.keyName().map({ args0 -> args0 }).orElse(null),
            licenseSpecifications = javaType.licenseSpecifications().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.awsnative.ec2.kotlin.outputs.LaunchTemplateLicenseSpecification.Companion.toKotlin(args0)
                })
            }),
            maintenanceOptions = javaType.maintenanceOptions().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.awsnative.ec2.kotlin.outputs.LaunchTemplateMaintenanceOptions.Companion.toKotlin(args0)
                })
            }).orElse(null),
            metadataOptions = javaType.metadataOptions().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.awsnative.ec2.kotlin.outputs.LaunchTemplateMetadataOptions.Companion.toKotlin(args0)
                })
            }).orElse(null),
            monitoring = javaType.monitoring().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.awsnative.ec2.kotlin.outputs.LaunchTemplateMonitoring.Companion.toKotlin(args0)
                })
            }).orElse(null),
            networkInterfaces = javaType.networkInterfaces().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.awsnative.ec2.kotlin.outputs.LaunchTemplateNetworkInterface.Companion.toKotlin(args0)
                })
            }),
            placement = javaType.placement().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.awsnative.ec2.kotlin.outputs.LaunchTemplatePlacement.Companion.toKotlin(args0)
                })
            }).orElse(null),
            privateDnsNameOptions = javaType.privateDnsNameOptions().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.awsnative.ec2.kotlin.outputs.LaunchTemplatePrivateDnsNameOptions.Companion.toKotlin(args0)
                })
            }).orElse(null),
            ramDiskId = javaType.ramDiskId().map({ args0 -> args0 }).orElse(null),
            securityGroupIds = javaType.securityGroupIds().map({ args0 -> args0 }),
            securityGroups = javaType.securityGroups().map({ args0 -> args0 }),
            tagSpecifications = javaType.tagSpecifications().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.awsnative.ec2.kotlin.outputs.TagSpecification.Companion.toKotlin(args0)
                })
            }),
            userData = javaType.userData().map({ args0 -> args0 }).orElse(null),
        )
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy