@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-14T16:25:27.858Z") public class BastionHostLinux extends Resource implements IInstance
The recommended way to connect to the bastion host is by using AWS Systems Manager Session Manager.
The operating system is Amazon Linux 2 with the latest SSM agent installed
You can also configure this bastion host to allow connections via SSH
Example:
BastionHostLinux host = BastionHostLinux.Builder.create(this, "BastionHost") .vpc(vpc) .blockDevices(List.of(BlockDevice.builder() .deviceName("EBSBastionHost") .volume(BlockDeviceVolume.ebs(10, EbsDeviceOptions.builder() .encrypted(true) .build())) .build())) .build();
Modifier and Type | Class and Description |
---|---|
static class |
BastionHostLinux.Builder
A fluent builder for
BastionHostLinux . |
IInstance.Jsii$Default, IInstance.Jsii$Proxy
Modifier | Constructor and Description |
---|---|
protected |
BastionHostLinux(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
BastionHostLinux(software.amazon.jsii.JsiiObjectRef objRef) |
|
BastionHostLinux(software.constructs.Construct scope,
java.lang.String id,
BastionHostLinuxProps props) |
Modifier and Type | Method and Description |
---|---|
void |
allowSshAccessFrom(IPeer... peer)
Allow SSH access from the given peer or peers.
|
Connections |
getConnections()
Allows specify security group connections for the instance.
|
IPrincipal |
getGrantPrincipal()
The principal to grant permissions to.
|
Instance |
getInstance()
The underlying instance resource.
|
java.lang.String |
getInstanceAvailabilityZone()
The availability zone the instance was launched in.
|
java.lang.String |
getInstanceId()
The instance's ID.
|
java.lang.String |
getInstancePrivateDnsName()
Private DNS name for this instance.
|
java.lang.String |
getInstancePrivateIp()
Private IP for this instance.
|
java.lang.String |
getInstancePublicDnsName()
Publicly-routable DNS name for this instance.
|
java.lang.String |
getInstancePublicIp()
Publicly-routable IP address for this instance.
|
IRole |
getRole()
The IAM role assumed by the instance.
|
Stack |
getStack()
The stack in which this resource is defined.
|
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, isResource
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applyRemovalPolicy, getEnv
getNode
protected BastionHostLinux(software.amazon.jsii.JsiiObjectRef objRef)
protected BastionHostLinux(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public BastionHostLinux(software.constructs.Construct scope, java.lang.String id, BastionHostLinuxProps props)
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.public void allowSshAccessFrom(IPeer... peer)
Necessary if you want to connect to the instance using ssh. If not called, you should use SSM Session Manager to connect to the instance.
peer
- This parameter is required.public Connections getConnections()
getConnections
in interface IConnectable
public IPrincipal getGrantPrincipal()
getGrantPrincipal
in interface IGrantable
public Instance getInstance()
public java.lang.String getInstanceAvailabilityZone()
getInstanceAvailabilityZone
in interface IInstance
public java.lang.String getInstanceId()
getInstanceId
in interface IInstance
public java.lang.String getInstancePrivateDnsName()
getInstancePrivateDnsName
in interface IInstance
public java.lang.String getInstancePrivateIp()
getInstancePrivateIp
in interface IInstance
public java.lang.String getInstancePublicDnsName()
(May be an empty string if the instance does not have a public name).
getInstancePublicDnsName
in interface IInstance
public java.lang.String getInstancePublicIp()
(May be an empty string if the instance does not have a public IP).
getInstancePublicIp
in interface IInstance
public IRole getRole()