@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:38.451Z") @Stability(value=Stable) public class Instance extends Resource implements IInstance
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 | Class and Description |
|---|---|
static class |
Instance.Builder
A fluent builder for
Instance. |
software.amazon.jsii.JsiiObject.InitializationModeIInstance.Jsii$Default, IInstance.Jsii$Proxy| Modifier | Constructor and Description |
|---|---|
|
Instance(software.constructs.Construct scope,
String id,
InstanceProps props) |
protected |
Instance(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Instance(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
void |
addSecurityGroup(ISecurityGroup securityGroup)
Add the security group to the instance.
|
void |
addToRolePolicy(PolicyStatement statement)
Adds a statement to the IAM role assumed by the instance.
|
void |
addUserData(String... commands)
Add command to the startup script of the instance.
|
Connections |
getConnections()
Allows specify security group connections for the instance.
|
IPrincipal |
getGrantPrincipal()
The principal to grant permissions to.
|
CfnInstance |
getInstance()
the underlying instance resource.
|
String |
getInstanceAvailabilityZone()
The availability zone the instance was launched in.
|
String |
getInstanceId()
The instance's ID.
|
String |
getInstancePrivateDnsName()
Private DNS name for this instance.
|
String |
getInstancePrivateIp()
Private IP for this instance.
|
String |
getInstancePublicDnsName()
Publicly-routable DNS name for this instance.
|
String |
getInstancePublicIp()
Publicly-routable IP address for this instance.
|
OperatingSystemType |
getOsType()
The type of OS the instance is running.
|
IRole |
getRole()
The IAM role assumed by the instance.
|
UserData |
getUserData()
UserData for the instance.
|
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourcejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitapplyRemovalPolicy, getEnv, getStackprotected Instance(software.amazon.jsii.JsiiObjectRef objRef)
protected Instance(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public Instance(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
InstanceProps props)
scope - This parameter is required.id - This parameter is required.props - This parameter is required.@Stability(value=Stable)
public void addSecurityGroup(@NotNull
ISecurityGroup securityGroup)
securityGroup - : The security group to add. This parameter is required.@Stability(value=Stable)
public void addToRolePolicy(@NotNull
PolicyStatement statement)
statement - This parameter is required.@Stability(value=Stable)
public void addUserData(@NotNull
String... commands)
The command must be in the scripting language supported by the instance's OS (i.e. Linux/Windows).
commands - This parameter is required.@Stability(value=Stable) @NotNull public Connections getConnections()
getConnections in interface IConnectable@Stability(value=Stable) @NotNull public IPrincipal getGrantPrincipal()
getGrantPrincipal in interface IGrantable@Stability(value=Stable) @NotNull public CfnInstance getInstance()
@Stability(value=Stable) @NotNull public String getInstanceAvailabilityZone()
getInstanceAvailabilityZone in interface IInstance@Stability(value=Stable) @NotNull public String getInstanceId()
getInstanceId in interface IInstance@Stability(value=Stable) @NotNull public String getInstancePrivateDnsName()
getInstancePrivateDnsName in interface IInstance@Stability(value=Stable) @NotNull public String getInstancePrivateIp()
getInstancePrivateIp in interface IInstance@Stability(value=Stable) @NotNull public String getInstancePublicDnsName()
(May be an empty string if the instance does not have a public name).
getInstancePublicDnsName in interface IInstance@Stability(value=Stable) @NotNull public String getInstancePublicIp()
(May be an empty string if the instance does not have a public IP).
getInstancePublicIp in interface IInstance@Stability(value=Stable) @NotNull public OperatingSystemType getOsType()
@Stability(value=Stable) @NotNull public IRole getRole()
@Stability(value=Stable) @NotNull public UserData getUserData()
Copyright © 2022. All rights reserved.