@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:38.453Z") @Stability(value=Stable) public interface InstanceProps extends software.amazon.jsii.JsiiSerializable
Example:
// Example automatically generated from non-compiling source. May contain errors.
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 Boolean |
getAllowAllOutbound()
Whether the instance could initiate connections to anywhere by default.
|
default String |
getAvailabilityZone()
In which AZ to place the instance within the VPC.
|
default List<BlockDevice> |
getBlockDevices()
Specifies how block devices are exposed to the instance.
|
default 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 String |
getInstanceName()
The name of the instance.
|
InstanceType |
getInstanceType()
Type of instance to launch.
|
default String |
getKeyName()
Name of SSH keypair to grant access to instance.
|
IMachineImage |
getMachineImage()
AMI to launch.
|
default String |
getPrivateIpAddress()
Defines a private IP address to associate with an instance.
|
default Boolean |
getPropagateTagsToVolumeOnCreation()
Propagate the EC2 instance tags to the EBS volumes.
|
default 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 Boolean |
getSourceDestCheck()
Specifies whether to enable an instance launched in a VPC to perform NAT.
|
default UserData |
getUserData()
Specific UserData to use.
|
default 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.
|
@Stability(value=Stable) @NotNull InstanceType getInstanceType()
@Stability(value=Stable) @NotNull IMachineImage getMachineImage()
@Stability(value=Stable) @NotNull IVpc getVpc()
@Stability(value=Stable) @Nullable default Boolean getAllowAllOutbound()
This property is only used when you do not provide a security group.
Default: true
@Stability(value=Stable) @Nullable default String getAvailabilityZone()
Default: - Random zone.
@Stability(value=Stable) @Nullable default 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
@Stability(value=Stable) @Nullable default Boolean getDetailedMonitoring()
Default: - false
@Stability(value=Stable) @Nullable default CloudFormationInit getInit()
Default: - no CloudFormation init
@Stability(value=Stable) @Nullable default ApplyCloudFormationInitOptions getInitOptions()
Describes the configsets to use and the timeout to wait
Default: - default options
@Stability(value=Stable) @Nullable default String getInstanceName()
Default: - CDK generated name
@Stability(value=Stable) @Nullable default String getKeyName()
Default: - No SSH access will be possible.
@Stability(value=Stable) @Nullable default String getPrivateIpAddress()
Private IP should be available within the VPC that the instance is build within.
Default: - no association
@Stability(value=Stable) @Nullable default Boolean getPropagateTagsToVolumeOnCreation()
Default: - false
@Stability(value=Stable) @Nullable default Boolean getRequireImdsv2()
Default: - false
@Stability(value=Stable) @Nullable default Duration getResourceSignalTimeout()
The maximum value is 43200 (12 hours).
Default: Duration.minutes(5)
@Stability(value=Stable) @Nullable 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:
// Example automatically generated from non-compiling source. May contain errors.
Role role = Role.Builder.create(this, "MyRole")
.assumedBy(new ServicePrincipal("ec2.amazonaws.com"))
.build();
@Stability(value=Stable) @Nullable default ISecurityGroup getSecurityGroup()
Default: - create new security group
@Stability(value=Stable) @Nullable default 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
@Stability(value=Stable) @Nullable default UserData getUserData()
The UserData may still be mutated after creation.
Default: - A UserData object appropriate for the MachineImage's Operating System is created.
@Stability(value=Stable) @Nullable default 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.
@Stability(value=Stable) @Nullable default SubnetSelection getVpcSubnets()
Default: - Private subnets.
@Stability(value=Stable) static InstanceProps.Builder builder()
InstanceProps.Builder of InstancePropsCopyright © 2022. All rights reserved.