@Generated(value="jsii-pacmak/1.73.0 (build 6faeda3)", date="2023-01-31T18:36:53.422Z") public class LaunchTemplate extends Resource implements ILaunchTemplate, IGrantable, IConnectable
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();
Modifier and Type | Class and Description |
---|---|
static class |
LaunchTemplate.Builder
A fluent builder for
LaunchTemplate . |
ILaunchTemplate.Jsii$Default, ILaunchTemplate.Jsii$Proxy
IGrantable.Jsii$Default, IGrantable.Jsii$Proxy
IConnectable.Jsii$Default, IConnectable.Jsii$Proxy
Modifier | Constructor and Description |
---|---|
protected |
LaunchTemplate(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
LaunchTemplate(software.amazon.jsii.JsiiObjectRef objRef) |
|
LaunchTemplate(software.constructs.Construct scope,
java.lang.String id) |
|
LaunchTemplate(software.constructs.Construct scope,
java.lang.String id,
LaunchTemplateProps props) |
Modifier and Type | Method and Description |
---|---|
static ILaunchTemplate |
fromLaunchTemplateAttributes(software.constructs.Construct scope,
java.lang.String id,
LaunchTemplateAttributes attrs)
Import an existing LaunchTemplate.
|
Connections |
getConnections()
Allows specifying security group connections for the instance.
|
java.lang.String |
getDefaultVersionNumber()
The default version for the launch template.
|
IPrincipal |
getGrantPrincipal()
Principal to grant permissions to.
|
java.lang.String |
getImageId()
The AMI ID of the image to use.
|
InstanceType |
getInstanceType()
Type of instance to launch.
|
java.lang.String |
getLatestVersionNumber()
The latest version of the launch template.
|
java.lang.String |
getLaunchTemplateId()
The identifier of the Launch Template.
|
java.lang.String |
getLaunchTemplateName()
The name of the Launch Template.
|
OperatingSystemType |
getOsType()
The type of OS the instance is running.
|
IRole |
getRole()
IAM Role assumed by instances that are launched from this template.
|
protected TagManager |
getTags()
TagManager for tagging support.
|
UserData |
getUserData()
UserData executed by instances that are launched from this template.
|
java.lang.String |
getVersionNumber()
The version number of this launch template to use.
|
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applyRemovalPolicy, getEnv, getStack
getNode
protected LaunchTemplate(software.amazon.jsii.JsiiObjectRef objRef)
protected LaunchTemplate(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public LaunchTemplate(software.constructs.Construct scope, java.lang.String id, LaunchTemplateProps props)
scope
- This parameter is required.id
- This parameter is required.props
- public LaunchTemplate(software.constructs.Construct scope, java.lang.String id)
scope
- This parameter is required.id
- This parameter is required.public static ILaunchTemplate fromLaunchTemplateAttributes(software.constructs.Construct scope, java.lang.String id, LaunchTemplateAttributes attrs)
scope
- This parameter is required.id
- This parameter is required.attrs
- This parameter is required.public Connections getConnections()
getConnections
in interface IConnectable
public java.lang.String getDefaultVersionNumber()
public IPrincipal getGrantPrincipal()
getGrantPrincipal
in interface IGrantable
public java.lang.String getLatestVersionNumber()
protected TagManager getTags()
public java.lang.String getVersionNumber()
getVersionNumber
in interface ILaunchTemplate
public java.lang.String getImageId()
public InstanceType getInstanceType()
public java.lang.String getLaunchTemplateId()
Exactly one of launchTemplateId
and launchTemplateName
will be set.
getLaunchTemplateId
in interface ILaunchTemplate
public java.lang.String getLaunchTemplateName()
Exactly one of launchTemplateId
and launchTemplateName
will be set.
getLaunchTemplateName
in interface ILaunchTemplate
public OperatingSystemType getOsType()
public IRole getRole()
public UserData getUserData()