Skip to content

Latest commit

 

History

History
414 lines (256 loc) · 14 KB

API.md

File metadata and controls

414 lines (256 loc) · 14 KB

API Reference

Constructs

AlterNat

Initializers

import { AlterNat } from 'alternat'

new AlterNat(scope: Construct, id: string, props: AlterNatProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props AlterNatProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

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 { AlterNat } from 'alternat'

AlterNat.isConstruct(x: any)

Checks if x is a construct.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.

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

The tree node.


Structs

AlterNatProps

Initializer

import { AlterNatProps } from 'alternat'

const alterNatProps: AlterNatProps = { ... }

Properties

Name Type Description
alterNatLambdaImageRepo aws-cdk-lib.aws_ecr.IRepository An ECR repository containing the alterNAT container image.
alterNatLambdaImageTag string The tag of the alterNAT Lambda container image.
vpc aws-cdk-lib.aws_ec2.IVpc The vpc in which to provision the alterNAT instances and related resources.
ami aws-cdk-lib.aws_ec2.IMachineImage The ami to use for the NAT instances.
connectivityCheckUrls string[] A list of URLs to use for checking connectivity through the NAT instances.
createEc2Endpoint boolean Whether to create a VPC Endpoint to EC2.
createLambdaEndpoint boolean Whether to create a VPC Endpoint to Lambda.
enableSsm boolean Whether to enable SSM on the NAT instances by attaching the AmazonSSMManagedInstanceCore managed policy.
gatewayEips aws-cdk-lib.aws_ec2.CfnEIP[] A list of NAT Gateway EIPs.
iamRole aws-cdk-lib.aws_iam.IRole The IAM Role to associate with the NAT instances.
ingressCidrRanges string[] A list of CIDR ranges to allow in the NAT instance security group.
ingressSecurityGroups aws-cdk-lib.aws_ec2.ISecurityGroup[] A list of security groups to allow in the NAT instance security group.
instanceEips aws-cdk-lib.aws_ec2.CfnEIP[] A list of EIPs for the NAT instances to use.
instanceType aws-cdk-lib.aws_ec2.InstanceType The EC2 instance type to use for the NAT instances.
lifecycleHeartbeatTimeout aws-cdk-lib.Duration The amount of time to wait in the EC2 instance terminating state (e.g. in between NAT instance termination and a new NAT instance in the Auto Scaling Group).
maxInstanceLifetime aws-cdk-lib.Duration The maximum lifetime to set for instances in the NAT instances Auto Scaling Groups.
natGateways aws-cdk-lib.aws_ec2.CfnNatGateway[] A list of NAT gateways to use on standby.
privateSubnetsSelection aws-cdk-lib.aws_ec2.SubnetSelection The private subnets that should route through the NAT instances.
publicSubnetsSelection aws-cdk-lib.aws_ec2.SubnetSelection The public subnets in which the NAT instances should be placed.
securityGroup aws-cdk-lib.aws_ec2.ISecurityGroup The Security Group in which to place the NAT instances.

alterNatLambdaImageRepoRequired
public readonly alterNatLambdaImageRepo: IRepository;
  • Type: aws-cdk-lib.aws_ecr.IRepository

An ECR repository containing the alterNAT container image.


alterNatLambdaImageTagRequired
public readonly alterNatLambdaImageTag: string;
  • Type: string

The tag of the alterNAT Lambda container image.


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

The vpc in which to provision the alterNAT instances and related resources.


amiOptional
public readonly ami: IMachineImage;
  • Type: aws-cdk-lib.aws_ec2.IMachineImage
  • Default: Amazon Linux latest.

The ami to use for the NAT instances.


connectivityCheckUrlsOptional
public readonly connectivityCheckUrls: string[];

A list of URLs to use for checking connectivity through the NAT instances.


createEc2EndpointOptional
public readonly createEc2Endpoint: boolean;
  • Type: boolean
  • Default: Create an EC2 VPC endpoint.

Whether to create a VPC Endpoint to EC2.

If false, you must create the VPC endpoint separately.


createLambdaEndpointOptional
public readonly createLambdaEndpoint: boolean;
  • Type: boolean
  • Default: Create a Lambda VPC endpoint.

Whether to create a VPC Endpoint to Lambda.

If false, you must create the VPC endpoint separately.


enableSsmOptional
public readonly enableSsm: boolean;
  • Type: boolean
  • Default: False.

Whether to enable SSM on the NAT instances by attaching the AmazonSSMManagedInstanceCore managed policy.


gatewayEipsOptional
public readonly gatewayEips: CfnEIP[];
  • Type: aws-cdk-lib.aws_ec2.CfnEIP[]
  • Default: Create new EIPs for the standby NAT Gateways.

A list of NAT Gateway EIPs.

Only used if the natGateways property is an empty list.


iamRoleOptional
public readonly iamRole: IRole;
  • Type: aws-cdk-lib.aws_iam.IRole
  • Default: Creates a new IAM role.

The IAM Role to associate with the NAT instances.


ingressCidrRangesOptional
public readonly ingressCidrRanges: string[];
  • Type: string[]

A list of CIDR ranges to allow in the NAT instance security group.


ingressSecurityGroupsOptional
public readonly ingressSecurityGroups: ISecurityGroup[];
  • Type: aws-cdk-lib.aws_ec2.ISecurityGroup[]

A list of security groups to allow in the NAT instance security group.


instanceEipsOptional
public readonly instanceEips: CfnEIP[];
  • Type: aws-cdk-lib.aws_ec2.CfnEIP[]
  • Default: Create new EIPs for the NAT instances.

A list of EIPs for the NAT instances to use.


instanceTypeOptional
public readonly instanceType: InstanceType;
  • Type: aws-cdk-lib.aws_ec2.InstanceType
  • Default: c6gn.8xlarge

The EC2 instance type to use for the NAT instances.


lifecycleHeartbeatTimeoutOptional
public readonly lifecycleHeartbeatTimeout: Duration;
  • Type: aws-cdk-lib.Duration
  • Default: 3 minutes.

The amount of time to wait in the EC2 instance terminating state (e.g. in between NAT instance termination and a new NAT instance in the Auto Scaling Group).


maxInstanceLifetimeOptional
public readonly maxInstanceLifetime: Duration;
  • Type: aws-cdk-lib.Duration
  • Default: 14 days.

The maximum lifetime to set for instances in the NAT instances Auto Scaling Groups.

When this value is reached, the instance will be terminated, a lifecycle hook will fire to swap the route to the standby NAT Gateway, and a new instance will boot and provision itself.

https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-max-instance-lifetime.html


natGatewaysOptional
public readonly natGateways: CfnNatGateway[];
  • Type: aws-cdk-lib.aws_ec2.CfnNatGateway[]
  • Default: Create new NAT gateways.

A list of NAT gateways to use on standby.


privateSubnetsSelectionOptional
public readonly privateSubnetsSelection: SubnetSelection;
  • Type: aws-cdk-lib.aws_ec2.SubnetSelection
  • Default: Discover all private subnets in the VPC.

The private subnets that should route through the NAT instances.


publicSubnetsSelectionOptional
public readonly publicSubnetsSelection: SubnetSelection;
  • Type: aws-cdk-lib.aws_ec2.SubnetSelection
  • Default: Discover the public subnets in the VPC.

The public subnets in which the NAT instances should be placed.


securityGroupOptional
public readonly securityGroup: ISecurityGroup;
  • Type: aws-cdk-lib.aws_ec2.ISecurityGroup
  • Default: Create a new security group with all outbound traffic allowed and no inbound traffic allowed. See the ingressSecurityGroups and ingressCidrRanges properties.

The Security Group in which to place the NAT instances.