Show / Hide Table of Contents

Class BastionHostLinux

This creates a linux bastion host you can use to connect to other instances or services in your VPC.

Inheritance
System.Object
Construct
Resource
BastionHostLinux
Implements
IInstance
IResource
IConstruct
Constructs.IConstruct
IDependable
IConnectable
IGrantable
Inherited Members
Resource.IsResource(IConstruct)
Resource.ApplyRemovalPolicy(RemovalPolicy)
Resource.GeneratePhysicalName()
Resource.GetResourceArnAttribute(String, IArnComponents)
Resource.GetResourceNameAttribute(String)
Resource.Env
Resource.PhysicalName
Construct.IsConstruct(Object)
Construct.OnPrepare()
Construct.OnSynthesize(ISynthesisSession)
Construct.OnValidate()
Construct.Prepare()
Construct.Synthesize(ISynthesisSession)
Construct.Validate()
Construct.Node
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.AWS.EC2.dll
Syntax (csharp)
public class BastionHostLinux : Resource, IInstance, IResource, IConstruct, IDependable, IConnectable, IGrantable
Syntax (vb)
Public Class BastionHostLinux
    Inherits Resource
    Implements IInstance, IResource, IConstruct, IDependable, IConnectable, IGrantable
Remarks

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

Resource: AWS::EC2::Instance

ExampleMetadata: fixture=with-vpc infused

Examples
var host = new BastionHostLinux(this, "BastionHost", new BastionHostLinuxProps {
    Vpc = vpc,
    BlockDevices = new [] { new BlockDevice {
        DeviceName = "EBSBastionHost",
        Volume = BlockDeviceVolume.Ebs(10, new EbsDeviceOptions {
            Encrypted = true
        })
    } }
});

Synopsis

Constructors

BastionHostLinux(ByRefValue)

Used by jsii to construct an instance of this class from a Javascript-owned object reference

BastionHostLinux(DeputyBase.DeputyProps)

Used by jsii to construct an instance of this class from DeputyProps

BastionHostLinux(Construct, String, IBastionHostLinuxProps)

Properties

Connections

Allows specify security group connections for the instance.

GrantPrincipal

The principal to grant permissions to.

Instance

The underlying instance resource.

InstanceAvailabilityZone

The availability zone the instance was launched in.

InstanceId

The instance's ID.

InstancePrivateDnsName

Private DNS name for this instance.

InstancePrivateIp

Private IP for this instance.

InstancePublicDnsName

Publicly-routable DNS name for this instance.

InstancePublicIp

Publicly-routable IP address for this instance.

Role

The IAM role assumed by the instance.

Stack

The stack in which this resource is defined.

Methods

AllowSshAccessFrom(IPeer[])

Allow SSH access from the given peer or peers.

Constructors

BastionHostLinux(ByRefValue)

Used by jsii to construct an instance of this class from a Javascript-owned object reference

protected BastionHostLinux(ByRefValue reference)
Parameters
reference Amazon.JSII.Runtime.Deputy.ByRefValue

The Javascript-owned object reference

BastionHostLinux(DeputyBase.DeputyProps)

Used by jsii to construct an instance of this class from DeputyProps

protected BastionHostLinux(DeputyBase.DeputyProps props)
Parameters
props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps

The deputy props

BastionHostLinux(Construct, String, IBastionHostLinuxProps)

public BastionHostLinux(Construct scope, string id, IBastionHostLinuxProps props)
Parameters
scope Constructs.Construct
id System.String
props IBastionHostLinuxProps

Properties

Connections

Allows specify security group connections for the instance.

public virtual Connections_ Connections { get; }
Property Value

Connections_

GrantPrincipal

The principal to grant permissions to.

public virtual IPrincipal GrantPrincipal { get; }
Property Value

IPrincipal

Instance

The underlying instance resource.

public virtual Instance_ Instance { get; }
Property Value

Instance_

InstanceAvailabilityZone

The availability zone the instance was launched in.

public virtual string InstanceAvailabilityZone { get; }
Property Value

System.String

Remarks

Attribute: true

InstanceId

The instance's ID.

public virtual string InstanceId { get; }
Property Value

System.String

Remarks

Attribute: true

InstancePrivateDnsName

Private DNS name for this instance.

public virtual string InstancePrivateDnsName { get; }
Property Value

System.String

Remarks

Attribute: true

InstancePrivateIp

Private IP for this instance.

public virtual string InstancePrivateIp { get; }
Property Value

System.String

Remarks

Attribute: true

InstancePublicDnsName

Publicly-routable DNS name for this instance.

public virtual string InstancePublicDnsName { get; }
Property Value

System.String

Remarks

(May be an empty string if the instance does not have a public name).

Attribute: true

InstancePublicIp

Publicly-routable IP address for this instance.

public virtual string InstancePublicIp { get; }
Property Value

System.String

Remarks

(May be an empty string if the instance does not have a public IP).

Attribute: true

Role

The IAM role assumed by the instance.

public virtual IRole Role { get; }
Property Value

IRole

Stack

The stack in which this resource is defined.

public override Stack Stack { get; }
Property Value

Stack

Overrides
Resource.Stack

Methods

AllowSshAccessFrom(IPeer[])

Allow SSH access from the given peer or peers.

public virtual void AllowSshAccessFrom(params IPeer[] peer)
Parameters
peer IPeer[]
Remarks

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.

Implements

IInstance
IResource
IConstruct
Constructs.IConstruct
IDependable
IConnectable
IGrantable
Back to top Generated by DocFX