Interface CfnLaunchTemplate.LaunchTemplateDataProperty

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
CfnLaunchTemplate.LaunchTemplateDataProperty.Jsii$Proxy
Enclosing class:
CfnLaunchTemplate

@Stability(Stable) public static interface CfnLaunchTemplate.LaunchTemplateDataProperty extends software.amazon.jsii.JsiiSerializable
The information to include in the launch template.

You must specify at least one parameter for the launch template data.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.ec2.*;
 LaunchTemplateDataProperty launchTemplateDataProperty = LaunchTemplateDataProperty.builder()
         .blockDeviceMappings(List.of(BlockDeviceMappingProperty.builder()
                 .deviceName("deviceName")
                 .ebs(EbsProperty.builder()
                         .deleteOnTermination(false)
                         .encrypted(false)
                         .iops(123)
                         .kmsKeyId("kmsKeyId")
                         .snapshotId("snapshotId")
                         .throughput(123)
                         .volumeSize(123)
                         .volumeType("volumeType")
                         .build())
                 .noDevice("noDevice")
                 .virtualName("virtualName")
                 .build()))
         .capacityReservationSpecification(CapacityReservationSpecificationProperty.builder()
                 .capacityReservationPreference("capacityReservationPreference")
                 .capacityReservationTarget(CapacityReservationTargetProperty.builder()
                         .capacityReservationId("capacityReservationId")
                         .capacityReservationResourceGroupArn("capacityReservationResourceGroupArn")
                         .build())
                 .build())
         .cpuOptions(CpuOptionsProperty.builder()
                 .amdSevSnp("amdSevSnp")
                 .coreCount(123)
                 .threadsPerCore(123)
                 .build())
         .creditSpecification(CreditSpecificationProperty.builder()
                 .cpuCredits("cpuCredits")
                 .build())
         .disableApiStop(false)
         .disableApiTermination(false)
         .ebsOptimized(false)
         .elasticGpuSpecifications(List.of(ElasticGpuSpecificationProperty.builder()
                 .type("type")
                 .build()))
         .elasticInferenceAccelerators(List.of(LaunchTemplateElasticInferenceAcceleratorProperty.builder()
                 .count(123)
                 .type("type")
                 .build()))
         .enclaveOptions(EnclaveOptionsProperty.builder()
                 .enabled(false)
                 .build())
         .hibernationOptions(HibernationOptionsProperty.builder()
                 .configured(false)
                 .build())
         .iamInstanceProfile(IamInstanceProfileProperty.builder()
                 .arn("arn")
                 .name("name")
                 .build())
         .imageId("imageId")
         .instanceInitiatedShutdownBehavior("instanceInitiatedShutdownBehavior")
         .instanceMarketOptions(InstanceMarketOptionsProperty.builder()
                 .marketType("marketType")
                 .spotOptions(SpotOptionsProperty.builder()
                         .blockDurationMinutes(123)
                         .instanceInterruptionBehavior("instanceInterruptionBehavior")
                         .maxPrice("maxPrice")
                         .spotInstanceType("spotInstanceType")
                         .validUntil("validUntil")
                         .build())
                 .build())
         .instanceRequirements(InstanceRequirementsProperty.builder()
                 .acceleratorCount(AcceleratorCountProperty.builder()
                         .max(123)
                         .min(123)
                         .build())
                 .acceleratorManufacturers(List.of("acceleratorManufacturers"))
                 .acceleratorNames(List.of("acceleratorNames"))
                 .acceleratorTotalMemoryMiB(AcceleratorTotalMemoryMiBProperty.builder()
                         .max(123)
                         .min(123)
                         .build())
                 .acceleratorTypes(List.of("acceleratorTypes"))
                 .allowedInstanceTypes(List.of("allowedInstanceTypes"))
                 .bareMetal("bareMetal")
                 .baselineEbsBandwidthMbps(BaselineEbsBandwidthMbpsProperty.builder()
                         .max(123)
                         .min(123)
                         .build())
                 .burstablePerformance("burstablePerformance")
                 .cpuManufacturers(List.of("cpuManufacturers"))
                 .excludedInstanceTypes(List.of("excludedInstanceTypes"))
                 .instanceGenerations(List.of("instanceGenerations"))
                 .localStorage("localStorage")
                 .localStorageTypes(List.of("localStorageTypes"))
                 .memoryGiBPerVCpu(MemoryGiBPerVCpuProperty.builder()
                         .max(123)
                         .min(123)
                         .build())
                 .memoryMiB(MemoryMiBProperty.builder()
                         .max(123)
                         .min(123)
                         .build())
                 .networkBandwidthGbps(NetworkBandwidthGbpsProperty.builder()
                         .max(123)
                         .min(123)
                         .build())
                 .networkInterfaceCount(NetworkInterfaceCountProperty.builder()
                         .max(123)
                         .min(123)
                         .build())
                 .onDemandMaxPricePercentageOverLowestPrice(123)
                 .requireHibernateSupport(false)
                 .spotMaxPricePercentageOverLowestPrice(123)
                 .totalLocalStorageGb(TotalLocalStorageGBProperty.builder()
                         .max(123)
                         .min(123)
                         .build())
                 .vCpuCount(VCpuCountProperty.builder()
                         .max(123)
                         .min(123)
                         .build())
                 .build())
         .instanceType("instanceType")
         .kernelId("kernelId")
         .keyName("keyName")
         .licenseSpecifications(List.of(LicenseSpecificationProperty.builder()
                 .licenseConfigurationArn("licenseConfigurationArn")
                 .build()))
         .maintenanceOptions(MaintenanceOptionsProperty.builder()
                 .autoRecovery("autoRecovery")
                 .build())
         .metadataOptions(MetadataOptionsProperty.builder()
                 .httpEndpoint("httpEndpoint")
                 .httpProtocolIpv6("httpProtocolIpv6")
                 .httpPutResponseHopLimit(123)
                 .httpTokens("httpTokens")
                 .instanceMetadataTags("instanceMetadataTags")
                 .build())
         .monitoring(MonitoringProperty.builder()
                 .enabled(false)
                 .build())
         .networkInterfaces(List.of(NetworkInterfaceProperty.builder()
                 .associateCarrierIpAddress(false)
                 .associatePublicIpAddress(false)
                 .deleteOnTermination(false)
                 .description("description")
                 .deviceIndex(123)
                 .groups(List.of("groups"))
                 .interfaceType("interfaceType")
                 .ipv4PrefixCount(123)
                 .ipv4Prefixes(List.of(Ipv4PrefixSpecificationProperty.builder()
                         .ipv4Prefix("ipv4Prefix")
                         .build()))
                 .ipv6AddressCount(123)
                 .ipv6Addresses(List.of(Ipv6AddProperty.builder()
                         .ipv6Address("ipv6Address")
                         .build()))
                 .ipv6PrefixCount(123)
                 .ipv6Prefixes(List.of(Ipv6PrefixSpecificationProperty.builder()
                         .ipv6Prefix("ipv6Prefix")
                         .build()))
                 .networkCardIndex(123)
                 .networkInterfaceId("networkInterfaceId")
                 .privateIpAddress("privateIpAddress")
                 .privateIpAddresses(List.of(PrivateIpAddProperty.builder()
                         .primary(false)
                         .privateIpAddress("privateIpAddress")
                         .build()))
                 .secondaryPrivateIpAddressCount(123)
                 .subnetId("subnetId")
                 .build()))
         .placement(PlacementProperty.builder()
                 .affinity("affinity")
                 .availabilityZone("availabilityZone")
                 .groupId("groupId")
                 .groupName("groupName")
                 .hostId("hostId")
                 .hostResourceGroupArn("hostResourceGroupArn")
                 .partitionNumber(123)
                 .spreadDomain("spreadDomain")
                 .tenancy("tenancy")
                 .build())
         .privateDnsNameOptions(PrivateDnsNameOptionsProperty.builder()
                 .enableResourceNameDnsAaaaRecord(false)
                 .enableResourceNameDnsARecord(false)
                 .hostnameType("hostnameType")
                 .build())
         .ramDiskId("ramDiskId")
         .securityGroupIds(List.of("securityGroupIds"))
         .securityGroups(List.of("securityGroups"))
         .tagSpecifications(List.of(TagSpecificationProperty.builder()
                 .resourceType("resourceType")
                 .tags(List.of(CfnTag.builder()
                         .key("key")
                         .value("value")
                         .build()))
                 .build()))
         .userData("userData")
         .build();
 
  • Method Details

    • getBlockDeviceMappings

      @Stability(Stable) @Nullable default Object getBlockDeviceMappings()
      The block device mapping.
    • getCapacityReservationSpecification

      @Stability(Stable) @Nullable default Object getCapacityReservationSpecification()
      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).

    • getCpuOptions

      @Stability(Stable) @Nullable default Object getCpuOptions()
      The CPU options for the instance.

      For more information, see Optimizing CPU Options in the Amazon Elastic Compute Cloud User Guide .

    • getCreditSpecification

      @Stability(Stable) @Nullable default Object getCreditSpecification()
      The credit option for CPU usage of the instance.

      Valid only for T instances.

    • getDisableApiStop

      @Stability(Stable) @Nullable default Object getDisableApiStop()
      Indicates whether to enable the instance for stop protection.

      For more information, see Stop protection in the Amazon Elastic Compute Cloud User Guide .

    • getDisableApiTermination

      @Stability(Stable) @Nullable default Object getDisableApiTermination()
      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 . Alternatively, if you set InstanceInitiatedShutdownBehavior to terminate , you can terminate the instance by running the shutdown command from the instance.

    • getEbsOptimized

      @Stability(Stable) @Nullable default Object getEbsOptimized()
      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.

    • getElasticGpuSpecifications

      @Stability(Stable) @Nullable default Object getElasticGpuSpecifications()
      An elastic GPU to associate with the instance.
    • getElasticInferenceAccelerators

      @Stability(Stable) @Nullable default Object getElasticInferenceAccelerators()
      The elastic inference accelerator for the instance.
    • getEnclaveOptions

      @Stability(Stable) @Nullable default Object getEnclaveOptions()
      Indicates whether the instance is enabled for AWS Nitro Enclaves.

      For more information, see What is AWS Nitro Enclaves? in the AWS Nitro Enclaves User Guide .

      You can't enable AWS Nitro Enclaves and hibernation on the same instance.

    • getHibernationOptions

      @Stability(Stable) @Nullable default Object getHibernationOptions()
      Indicates whether an instance is enabled for hibernation.

      This parameter is valid only if the instance meets the hibernation prerequisites . For more information, see Hibernate your instance in the Amazon Elastic Compute Cloud User Guide .

    • getIamInstanceProfile

      @Stability(Stable) @Nullable default Object getIamInstanceProfile()
      The name or Amazon Resource Name (ARN) of an IAM instance profile.
    • getImageId

      @Stability(Stable) @Nullable default String getImageId()
      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 in the Amazon Elastic Compute Cloud User Guide .

    • getInstanceInitiatedShutdownBehavior

      @Stability(Stable) @Nullable default String getInstanceInitiatedShutdownBehavior()
      Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).

      Default: stop

    • getInstanceMarketOptions

      @Stability(Stable) @Nullable default Object getInstanceMarketOptions()
      The market (purchasing) option for the instances.
    • getInstanceRequirements

      @Stability(Stable) @Nullable default Object getInstanceRequirements()
      The attributes for the instance types.

      When you specify instance attributes, Amazon EC2 will identify instance types with these attributes.

      If you specify InstanceRequirements , you can't specify InstanceType .

    • getInstanceType

      @Stability(Stable) @Nullable default String getInstanceType()
      The instance type. For more information, see Instance types in the Amazon Elastic Compute Cloud User Guide .

      If you specify InstanceType , you can't specify InstanceRequirements .

    • getKernelId

      @Stability(Stable) @Nullable default String getKernelId()
      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 in the Amazon EC2 User Guide .

    • getKeyName

      @Stability(Stable) @Nullable default String getKeyName()
      The name of the key pair. You can create a key pair using CreateKeyPair or ImportKeyPair .

      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.

    • getLicenseSpecifications

      @Stability(Stable) @Nullable default Object getLicenseSpecifications()
      The license configurations.
    • getMaintenanceOptions

      @Stability(Stable) @Nullable default Object getMaintenanceOptions()
      The maintenance options of your instance.
    • getMetadataOptions

      @Stability(Stable) @Nullable default Object getMetadataOptions()
      The metadata options for the instance.

      For more information, see Instance metadata and user data in the Amazon Elastic Compute Cloud User Guide .

    • getMonitoring

      @Stability(Stable) @Nullable default Object getMonitoring()
      The monitoring for the instance.
    • getNetworkInterfaces

      @Stability(Stable) @Nullable default Object getNetworkInterfaces()
      One or more network interfaces.

      If you specify a network interface, you must specify any security groups and subnets as part of the network interface.

    • getPlacement

      @Stability(Stable) @Nullable default Object getPlacement()
      The placement for the instance.
    • getPrivateDnsNameOptions

      @Stability(Stable) @Nullable default Object getPrivateDnsNameOptions()
      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 in the Amazon Elastic Compute Cloud User Guide .

    • getRamDiskId

      @Stability(Stable) @Nullable default String getRamDiskId()
      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 in the Amazon Elastic Compute Cloud User Guide .

    • getSecurityGroupIds

      @Stability(Stable) @Nullable default List<String> getSecurityGroupIds()
      The IDs of the security groups.

      You can specify the IDs of existing security groups and references to resources created by the stack template.

    • getSecurityGroups

      @Stability(Stable) @Nullable default List<String> getSecurityGroups()
      One or more security group names.

      For a nondefault VPC, you must use security group IDs instead. You cannot specify both a security group ID and security name in the same request.

    • getTagSpecifications

      @Stability(Stable) @Nullable default Object getTagSpecifications()
      The tags to apply to the resources that are created during instance launch.

      You can specify tags for the following resources only:

      • Instances
      • Volumes
      • Elastic graphics
      • Spot Instance requests
      • Network interfaces

      To tag a resource after it has been created, see CreateTags .

      To tag the launch template itself, you must use the TagSpecification parameter.

    • getUserData

      @Stability(Stable) @Nullable default String getUserData()
      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 Linux instance at launch (Linux) or Work with instance user data (Windows) in the Amazon Elastic Compute Cloud User Guide .

      If you are creating the launch template for use with AWS Batch , the user data must be provided in the MIME multi-part archive format . For more information, see Amazon EC2 user data in launch templates in the AWS Batch User Guide .

    • builder

      @Stability(Stable) static CfnLaunchTemplate.LaunchTemplateDataProperty.Builder builder()
      Returns:
      a CfnLaunchTemplate.LaunchTemplateDataProperty.Builder of CfnLaunchTemplate.LaunchTemplateDataProperty