Skip to content

Latest commit

 

History

History
352 lines (222 loc) · 11.5 KB

API.md

File metadata and controls

352 lines (222 loc) · 11.5 KB

API Reference

Constructs

JumpBox

JumpHost.

Initializers

import { JumpBox } from '@time-loop/cdk-jump-box'

new JumpBox(scope: Construct, id: Namer, props: JumpBoxProps)
Name Type Description
scope constructs.Construct No description.
id multi-convention-namer.Namer No description.
props JumpBoxProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: multi-convention-namer.Namer

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.

toString
public toString(): string

Returns a string representation of this construct.

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { JumpBox } from '@time-loop/cdk-jump-box'

JumpBox.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
asg aws-cdk-lib.aws_autoscaling.IAutoScalingGroup No description.
keyPair cdk-ec2-key-pair.KeyPair No description.
role aws-cdk-lib.aws_iam.IRole No description.
securityGroup aws-cdk-lib.aws_ec2.ISecurityGroup No description.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


asgRequired
public readonly asg: IAutoScalingGroup;
  • Type: aws-cdk-lib.aws_autoscaling.IAutoScalingGroup

keyPairRequired
public readonly keyPair: KeyPair;
  • Type: cdk-ec2-key-pair.KeyPair

roleRequired
public readonly role: IRole;
  • Type: aws-cdk-lib.aws_iam.IRole

securityGroupRequired
public readonly securityGroup: ISecurityGroup;
  • Type: aws-cdk-lib.aws_ec2.ISecurityGroup

Structs

JumpBoxProps

Initializer

import { JumpBoxProps } from '@time-loop/cdk-jump-box'

const jumpBoxProps: JumpBoxProps = { ... }

Properties

Name Type Description
vpc aws-cdk-lib.aws_ec2.IVpc Which VPC should the jumpbox be in?
desiredCapacity number the desired capacity of the auto scaling group.
instanceType aws-cdk-lib.aws_ec2.InstanceType No description.
keyPair cdk-ec2-key-pair.KeyPair You must provide either a keypair or a kmsKey.
kmsKey aws-cdk-lib.aws_kms.Key You must provide either a keypair or a kmsKey.
machineImage aws-cdk-lib.aws_ec2.IMachineImage Default to latest Amazon Linux 2022 AMI for ARM64.
maxCapacity number the maximum capacity of the auto scaling group.
minCapacity number the minimum capacity of the auto scaling group.
role aws-cdk-lib.aws_iam.IRole No description.
securityGroup aws-cdk-lib.aws_ec2.ISecurityGroup No description.
sshAccess boolean No description.
vpcSubnets aws-cdk-lib.aws_ec2.SubnetSelection No description.

vpcRequired
public readonly vpc: IVpc;
  • Type: aws-cdk-lib.aws_ec2.IVpc

Which VPC should the jumpbox be in?


desiredCapacityOptional
public readonly desiredCapacity: number;
  • Type: number
  • Default: undefined

the desired capacity of the auto scaling group.


instanceTypeOptional
public readonly instanceType: InstanceType;
  • Type: aws-cdk-lib.aws_ec2.InstanceType
  • Default: aws_ec2.InstanceType.of(aws_ec2.InstanceClass.T4A,aws_ec2.InstanceSize.NANO)

keyPairOptional
public readonly keyPair: KeyPair;
  • Type: cdk-ec2-key-pair.KeyPair

You must provide either a keypair or a kmsKey.

You must not provide both. If a keyPair is provided, it will simply be used.


kmsKeyOptional
public readonly kmsKey: Key;
  • Type: aws-cdk-lib.aws_kms.Key

You must provide either a keypair or a kmsKey.

You must not provide both. If a kmsKey is provided, a keyPair will be generated.

Why not auto-generate a key? Jumpboxes exist to provide a route to access secured resources. Those resources MUST be encrypted at rest for compliance reasons. That implies your service already is using a KMS key. These things aren't free. It makes sense to require re-using the key associated with the resource.


machineImageOptional
public readonly machineImage: IMachineImage;
  • Type: aws-cdk-lib.aws_ec2.IMachineImage
  • Default: MachineImage.latestAmazonLinux({generation:AmazonLinuxGeneration.AMAZON_LINUX_2022,edition:AmazonLinuxEdition.STANDARD,cpuType:AmazonLinuxCpuType.ARM_64})

Default to latest Amazon Linux 2022 AMI for ARM64.


maxCapacityOptional
public readonly maxCapacity: number;
  • Type: number
  • Default: 1

the maximum capacity of the auto scaling group.


minCapacityOptional
public readonly minCapacity: number;
  • Type: number
  • Default: 0

the minimum capacity of the auto scaling group.


roleOptional
public readonly role: IRole;
  • Type: aws-cdk-lib.aws_iam.IRole
  • Default: create a role

securityGroupOptional
public readonly securityGroup: ISecurityGroup;
  • Type: aws-cdk-lib.aws_ec2.ISecurityGroup
  • Default: create a security group

sshAccessOptional
public readonly sshAccess: boolean;
  • Type: boolean
  • Default: false implement SSH access

vpcSubnetsOptional
public readonly vpcSubnets: SubnetSelection;
  • Type: aws-cdk-lib.aws_ec2.SubnetSelection
  • Default: default subnet selection