Interface LaunchTemplateProps

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
LaunchTemplateProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:39.443Z") @Stability(Stable) public interface LaunchTemplateProps extends software.amazon.jsii.JsiiSerializable
Properties of a LaunchTemplate.

Example:

 UserData bootHookConf = UserData.forLinux();
 bootHookConf.addCommands("cloud-init-per once docker_options echo 'OPTIONS=\"${OPTIONS} --storage-opt dm.basesize=40G\"' >> /etc/sysconfig/docker");
 UserData setupCommands = UserData.forLinux();
 setupCommands.addCommands("sudo yum install awscli && echo Packages installed らと > /var/tmp/setup");
 MultipartUserData multipartUserData = new MultipartUserData();
 // The docker has to be configured at early stage, so content type is overridden to boothook
 multipartUserData.addPart(MultipartBody.fromUserData(bootHookConf, "text/cloud-boothook; charset=\"us-ascii\""));
 // Execute the rest of setup
 multipartUserData.addPart(MultipartBody.fromUserData(setupCommands));
 LaunchTemplate.Builder.create(this, "")
         .userData(multipartUserData)
         .blockDevices(List.of())
         .build();
 
  • Method Details

    • getBlockDevices

      @Stability(Stable) @Nullable default List<BlockDevice> getBlockDevices()
      Specifies how block devices are exposed to the instance. You can specify virtual devices and EBS volumes.

      Each instance that is launched has an associated root device volume, either an Amazon EBS volume or an instance store volume. You can use block device mappings to specify additional EBS volumes or instance store volumes to attach to an instance when it is launched.

      Default: - Uses the block device mapping of the AMI

      See Also:
    • getCpuCredits

      @Stability(Stable) @Nullable default CpuCredits getCpuCredits()
      CPU credit type for burstable EC2 instance types.

      Default: - No credit type is specified in the Launch Template.

      See Also:
    • getDetailedMonitoring

      @Stability(Stable) @Nullable default Boolean getDetailedMonitoring()
      If set to true, then detailed monitoring will be enabled on instances created with this launch template.

      Default: False - Detailed monitoring is disabled.

      See Also:
    • getDisableApiTermination

      @Stability(Stable) @Nullable default Boolean getDisableApiTermination()
      If you set this parameter to true, you cannot terminate the instances launched with this launch template using the Amazon EC2 console, CLI, or API;

      otherwise, you can.

      Default: - The API termination setting is not specified in the Launch Template.

    • getEbsOptimized

      @Stability(Stable) @Nullable default Boolean getEbsOptimized()
      Indicates whether the instances are 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.

      Default: - EBS optimization is not specified in the launch template.

    • getHibernationConfigured

      @Stability(Stable) @Nullable default Boolean getHibernationConfigured()
      If you set this parameter to true, the instance is enabled for hibernation.

      Default: - Hibernation configuration is not specified in the launch template; defaulting to false.

    • getInstanceInitiatedShutdownBehavior

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

      Default: - Shutdown behavior is not specified in the launch template; defaults to STOP.

      See Also:
    • getInstanceType

      @Stability(Stable) @Nullable default InstanceType getInstanceType()
      Type of instance to launch.

      Default: - This Launch Template does not specify a default Instance Type.

    • getKeyName

      @Stability(Stable) @Nullable default String getKeyName()
      Name of SSH keypair to grant access to instance.

      Default: - No SSH access will be possible.

    • getLaunchTemplateName

      @Stability(Stable) @Nullable default String getLaunchTemplateName()
      Name for this launch template.

      Default: Automatically generated name

    • getMachineImage

      @Stability(Stable) @Nullable default IMachineImage getMachineImage()
      The AMI that will be used by instances.

      Default: - This Launch Template does not specify a default AMI.

    • getNitroEnclaveEnabled

      @Stability(Stable) @Nullable default Boolean getNitroEnclaveEnabled()
      If this parameter is set to true, the instance is enabled for AWS Nitro Enclaves;

      otherwise, it is not enabled for AWS Nitro Enclaves.

      Default: - Enablement of Nitro enclaves is not specified in the launch template; defaulting to false.

    • getRequireImdsv2

      @Stability(Stable) @Nullable default Boolean getRequireImdsv2()
      Whether IMDSv2 should be required on launched instances.

      Default: - false

    • getRole

      @Stability(Stable) @Nullable default IRole getRole()
      An IAM role to associate with the instance profile that is used by instances.

      The role must be assumable by the service principal ec2.amazonaws.com:

      Default: - No new role is created.

      Example:

       Role role = Role.Builder.create(this, "MyRole")
               .assumedBy(new ServicePrincipal("ec2.amazonaws.com"))
               .build();
       
    • getSecurityGroup

      @Stability(Stable) @Nullable default ISecurityGroup getSecurityGroup()
      Security group to assign to instances created with the launch template.

      Default: No security group is assigned.

    • getSpotOptions

      @Stability(Stable) @Nullable default LaunchTemplateSpotOptions getSpotOptions()
      If this property is defined, then the Launch Template's InstanceMarketOptions will be set to use Spot instances, and the options for the Spot instances will be as defined.

      Default: - Instance launched with this template will not be spot instances.

    • getUserData

      @Stability(Stable) @Nullable default UserData getUserData()
      The AMI that will be used by instances.

      Default: - This Launch Template creates a UserData based on the type of provided machineImage; no UserData is created if a machineImage is not provided

    • builder

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