@Generated(value="jsii-pacmak/1.63.2 (build a8a8833)",
date="2022-08-09T19:16:37.494Z")
public interface InstanceProps
Example:
Vpc vpc; InstanceType instanceType; IMachineImage machineImage; Instance.Builder.create(this, "Instance") .vpc(vpc) .instanceType(instanceType) .machineImage(machineImage) // ... .blockDevices(List.of(BlockDevice.builder() .deviceName("/dev/sda1") .volume(BlockDeviceVolume.ebs(50)) .build(), BlockDevice.builder() .deviceName("/dev/sdm") .volume(BlockDeviceVolume.ebs(100)) .build())) .build();
Modifier and Type | Interface and Description |
---|---|
static class |
InstanceProps.Builder
A builder for
InstanceProps |
static class |
InstanceProps.Jsii$Proxy
An implementation for
InstanceProps |
Modifier and Type | Method and Description |
---|---|
static InstanceProps.Builder |
builder() |
default java.lang.Boolean |
getAllowAllOutbound()
Whether the instance could initiate connections to anywhere by default.
|
default java.lang.String |
getAvailabilityZone()
In which AZ to place the instance within the VPC.
|
default java.util.List<BlockDevice> |
getBlockDevices()
Specifies how block devices are exposed to the instance.
|
default java.lang.Boolean |
getDetailedMonitoring()
Whether "Detailed Monitoring" is enabled for this instance Keep in mind that Detailed Monitoring results in extra charges.
|
default CloudFormationInit |
getInit()
Apply the given CloudFormation Init configuration to the instance at startup.
|
default ApplyCloudFormationInitOptions |
getInitOptions()
Use the given options for applying CloudFormation Init.
|
default java.lang.String |
getInstanceName()
The name of the instance.
|
InstanceType |
getInstanceType()
Type of instance to launch.
|
default java.lang.String |
getKeyName()
Name of SSH keypair to grant access to instance.
|
IMachineImage |
getMachineImage()
AMI to launch.
|
default java.lang.String |
getPrivateIpAddress()
Defines a private IP address to associate with an instance.
|
default java.lang.Boolean |
getPropagateTagsToVolumeOnCreation()
Propagate the EC2 instance tags to the EBS volumes.
|
default java.lang.Boolean |
getRequireImdsv2()
Whether IMDSv2 should be required on this instance.
|
default Duration |
getResourceSignalTimeout()
The length of time to wait for the resourceSignalCount.
|
default IRole |
getRole()
An IAM role to associate with the instance profile assigned to this Auto Scaling Group.
|
default ISecurityGroup |
getSecurityGroup()
Security Group to assign to this instance.
|
default java.lang.Boolean |
getSourceDestCheck()
Specifies whether to enable an instance launched in a VPC to perform NAT.
|
default UserData |
getUserData()
Specific UserData to use.
|
default java.lang.Boolean |
getUserDataCausesReplacement()
Changes to the UserData force replacement.
|
IVpc |
getVpc()
VPC to launch the instance in.
|
default SubnetSelection |
getVpcSubnets()
Where to place the instance within the VPC.
|
InstanceType getInstanceType()
IMachineImage getMachineImage()
IVpc getVpc()
default java.lang.Boolean getAllowAllOutbound()
This property is only used when you do not provide a security group.
Default: true
default java.lang.String getAvailabilityZone()
Default: - Random zone.
default java.util.List<BlockDevice> getBlockDevices()
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
default java.lang.Boolean getDetailedMonitoring()
Default: - false
default CloudFormationInit getInit()
Default: - no CloudFormation init
default ApplyCloudFormationInitOptions getInitOptions()
Describes the configsets to use and the timeout to wait
Default: - default options
default java.lang.String getInstanceName()
Default: - CDK generated name
default java.lang.String getKeyName()
Default: - No SSH access will be possible.
default java.lang.String getPrivateIpAddress()
Private IP should be available within the VPC that the instance is build within.
Default: - no association
default java.lang.Boolean getPropagateTagsToVolumeOnCreation()
Default: - false
default java.lang.Boolean getRequireImdsv2()
Default: - false
default Duration getResourceSignalTimeout()
The maximum value is 43200 (12 hours).
Default: Duration.minutes(5)
default IRole getRole()
The role must be assumable by the service principal ec2.amazonaws.com
:
Default: - A role will automatically be created, it can be accessed via the `role` property
Example:
Role role = Role.Builder.create(this, "MyRole") .assumedBy(new ServicePrincipal("ec2.amazonaws.com")) .build();
default ISecurityGroup getSecurityGroup()
Default: - create new security group
default java.lang.Boolean getSourceDestCheck()
This controls whether source/destination checking is enabled on the instance. A value of true means that checking is enabled, and false means that checking is disabled. The value must be false for the instance to perform NAT.
Default: true
default UserData getUserData()
The UserData may still be mutated after creation.
Default: - A UserData object appropriate for the MachineImage's Operating System is created.
default java.lang.Boolean getUserDataCausesReplacement()
Depending the EC2 instance type, changing UserData either restarts the instance or replaces the instance.
By default, restarting does not execute the new UserData so you will need a different mechanism to ensure the instance is restarted.
Setting this to true
will make the instance's Logical ID depend on the
UserData, which will cause CloudFormation to replace it if the UserData
changes.
Default: - true iff `initOptions` is specified, false otherwise.
default SubnetSelection getVpcSubnets()
Default: - Private subnets.
static InstanceProps.Builder builder()
InstanceProps.Builder
of InstanceProps