Properties to configure NatAsgProvider
.
import { NatAsgProviderProps } from 'cdk-nat-asg-provider'
const natAsgProviderProps: NatAsgProviderProps = { ... }
Name | Type | Description |
---|---|---|
instanceType |
aws-cdk-lib.aws_ec2.InstanceType |
The EC2 instance type of the NAT instances. |
keyPair |
string |
The name of the SSH key pair granting access to the NAT instances. |
securityGroup |
aws-cdk-lib.aws_ec2.ISecurityGroup |
The security group associated with the NAT instances. |
trafficDirection |
aws-cdk-lib.aws_ec2.NatTrafficDirection |
The allowed traffic directions through the NAT instances. |
public readonly instanceType: InstanceType;
- Type: aws-cdk-lib.aws_ec2.InstanceType
- Default: t2.micro
The EC2 instance type of the NAT instances.
https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.InstanceType.html
public readonly keyPair: string;
- Type: string
The name of the SSH key pair granting access to the NAT instances.
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html
public readonly securityGroup: ISecurityGroup;
- Type: aws-cdk-lib.aws_ec2.ISecurityGroup
- Default: A security group will be created.
The security group associated with the NAT instances.
https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.ISecurityGroup.html
public readonly trafficDirection: NatTrafficDirection;
- Type: aws-cdk-lib.aws_ec2.NatTrafficDirection
- Default:
aws-cdk-lib.aws_ec2.NatTrafficDirection.INBOUND_AND_OUTBOUND
The allowed traffic directions through the NAT instances.
If you set this to a value other than
ec2.NatTrafficDirection.INBOUND_AND_OUTBOUND
, you must
configure the security group for the NAT instances either by providing
a fully configured security group through the securityGroup
property
or by using the NatAsgProvider
object's securityGroup
or
connections
properties after passing the NatAsgProvider
object to a
Vpc
object.
https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.NatTrafficDirection.html
- Implements: aws-cdk-lib.aws_ec2.IConnectable
NatAsgProvider
is a NAT provider that places each NAT instance in its own auto scaling group to improve fault tolerance and availability.
NatAsgProvider
extends NatProvider
:
https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.NatProvider.html
import { NatAsgProvider } from 'cdk-nat-asg-provider'
new NatAsgProvider(props: NatAsgProviderProps)
Name | Type | Description |
---|---|---|
props |
NatAsgProviderProps |
Configuration properties. |
- Type: NatAsgProviderProps
Configuration properties.
Name | Description |
---|---|
configureNat |
Called by the VPC to configure NAT. |
configureSubnet |
Configures subnet with the gateway. |
public configureNat(opts: ConfigureNatOptions): void
Called by the VPC to configure NAT.
Don't call this directly, the VPC will call it automatically.
- Type: aws-cdk-lib.aws_ec2.ConfigureNatOptions
public configureSubnet(subnet: PrivateSubnet): void
Configures subnet with the gateway.
Don't call this directly, the VPC will call it automatically.
- Type: aws-cdk-lib.aws_ec2.PrivateSubnet
Name | Description |
---|---|
gateway |
Use NAT Gateways to provide NAT services for your VPC. |
instance |
Use NAT instances to provide NAT services for your VPC. |
import { NatAsgProvider } from 'cdk-nat-asg-provider'
NatAsgProvider.gateway(props?: NatGatewayProps)
Use NAT Gateways to provide NAT services for your VPC.
NAT gateways are managed by AWS.
https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html
- Type: aws-cdk-lib.aws_ec2.NatGatewayProps
import { NatAsgProvider } from 'cdk-nat-asg-provider'
NatAsgProvider.instance(props: NatInstanceProps)
Use NAT instances to provide NAT services for your VPC.
NAT instances are managed by you, but in return allow more configuration.
Be aware that instances created using this provider will not be automatically replaced if they are stopped for any reason. You should implement your own NatProvider based on AutoScaling groups if you need that.
https://docs.aws.amazon.com/vpc/latest/userguide/VPC_NAT_Instance.html
- Type: aws-cdk-lib.aws_ec2.NatInstanceProps
Name | Type | Description |
---|---|---|
configuredGateways |
aws-cdk-lib.aws_ec2.GatewayConfig[] |
Return list of gateways spawned by the provider. |
connections |
aws-cdk-lib.aws_ec2.Connections |
The network connections associated with the security group of the NAT instances. |
securityGroup |
aws-cdk-lib.aws_ec2.ISecurityGroup |
The security group associated with the NAT instances. |
public readonly configuredGateways: GatewayConfig[];
- Type: aws-cdk-lib.aws_ec2.GatewayConfig[]
Return list of gateways spawned by the provider.
public readonly connections: Connections;
- Type: aws-cdk-lib.aws_ec2.Connections
The network connections associated with the security group of the NAT instances.
https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.Connections.html
public readonly securityGroup: ISecurityGroup;
- Type: aws-cdk-lib.aws_ec2.ISecurityGroup
The security group associated with the NAT instances.
https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.ISecurityGroup.html