Class BastionHostLinux
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.ec2.BastionHostLinux
- All Implemented Interfaces:
IResource
,IConnectable
,IInstance
,IGrantable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2024-12-06T14:43:17.416Z")
@Stability(Stable)
public class BastionHostLinux
extends Resource
implements IInstance
This creates a linux bastion host you can use to connect to other instances or services in your VPC.
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("/dev/sdh") .volume(BlockDeviceVolume.ebs(10, EbsDeviceOptions.builder() .encrypted(true) .build())) .build())) .build();
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.ec2.IInstance
IInstance.Jsii$Default, IInstance.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default
-
Constructor Summary
ModifierConstructorDescriptionprotected
BastionHostLinux
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
BastionHostLinux
(software.amazon.jsii.JsiiObjectRef objRef) BastionHostLinux
(software.constructs.Construct scope, String id, BastionHostLinuxProps props) -
Method Summary
Modifier and TypeMethodDescriptionvoid
allowSshAccessFrom
(@NotNull IPeer... peer) Allow SSH access from the given peer or peers.Allows specify security group connections for the instance.The principal to grant permissions to.The underlying instance resource.The availability zone the instance was launched in.The instance's ID.Private DNS name for this instance.Private IP for this instance.Publicly-routable DNS name for this instance.Publicly-routable IP address for this instance.getRole()
The IAM role assumed by the instance.getStack()
The stack in which this resource is defined.Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, isOwnedResource, isResource
Methods inherited from class software.constructs.Construct
getNode, isConstruct, toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.constructs.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getEnv
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
BastionHostLinux
protected BastionHostLinux(software.amazon.jsii.JsiiObjectRef objRef) -
BastionHostLinux
protected BastionHostLinux(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
BastionHostLinux
@Stability(Stable) public BastionHostLinux(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull BastionHostLinuxProps props) - Parameters:
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.
-
-
Method Details
-
allowSshAccessFrom
Allow SSH access from the given peer or peers.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.
- Parameters:
peer
- This parameter is required.
-
getConnections
Allows specify security group connections for the instance.- Specified by:
getConnections
in interfaceIConnectable
-
getGrantPrincipal
The principal to grant permissions to.- Specified by:
getGrantPrincipal
in interfaceIGrantable
-
getInstance
The underlying instance resource. -
getInstanceAvailabilityZone
The availability zone the instance was launched in.- Specified by:
getInstanceAvailabilityZone
in interfaceIInstance
-
getInstanceId
The instance's ID.- Specified by:
getInstanceId
in interfaceIInstance
-
getInstancePrivateDnsName
Private DNS name for this instance.- Specified by:
getInstancePrivateDnsName
in interfaceIInstance
-
getInstancePrivateIp
Private IP for this instance.- Specified by:
getInstancePrivateIp
in interfaceIInstance
-
getInstancePublicDnsName
Publicly-routable DNS name for this instance.(May be an empty string if the instance does not have a public name).
- Specified by:
getInstancePublicDnsName
in interfaceIInstance
-
getInstancePublicIp
Publicly-routable IP address for this instance.(May be an empty string if the instance does not have a public IP).
- Specified by:
getInstancePublicIp
in interfaceIInstance
-
getRole
The IAM role assumed by the instance. -
getStack
The stack in which this resource is defined.
-