cdk-v1-construct-simple-nat
v0.0.0
Published
A CDK construct to build Simple NAT instance on AWS. Backport for AWS cdk v1
Downloads
30
Maintainers
Readme
Simple NAT
It's a CDK construct to create NAT instances on AWS.
It supports adding specific IP CIDRs to route tables of VPC, the network traffic to those IP CIDRs will be forwarded to the NAT instances.
Install
TypeScript/JavaScript:
yarn add cdk-construct-simple-nat
or
npm install cdk-construct-simple-nat
Usage
import { SimpleNAT } from 'cdk-construct-simple-nat';
new SimpleNAT(this, 'SimpleNAT', {
vpc,
natSubnetsSelection: {
subnetType: SubnetType.PUBLIC,
onePerAz: true,
},
})
.withGithubRoute();
See the complete example.
FAQ
What's the difference between EC2 NAT instances and NAT instances created by this construct
There are below differences,
- EC2 NAT instance will route all Internet traffic to itself by default
- NAT instance uses depracated Amazon Linux AMI, this construct always uses latest Amazon Linux 2 AMI
- NAT instances created by this construct can work with NAT gateways together, you can have multiple NAT instances in one VPC
- This construct can help when only routing specific traffic(for example, github/gist) to NAT instances which acts as transit proxy
What's the difference between CDK built-in NAT instances and NAT instances created by this construct
- CDK built-in NAT instances has to be created with VPC stack, this construct can add NAT instances to any existing VPC
- You can use this construct multiple NAT instances for different purposes
- This construct allows you customize the instances how to route the traffic