A CDK construct to build Simple NAT instance on AWS.
Project description
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.
It supports routing to below services out of box,
- Github git servers
- Cloudflare
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 and API doc.
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
The deployment fails due to the routes in route table exceeds the limit
The default routes in route table is 50, the deployment will fail if adding routes more than the limit of your account. You can increase the limit up to 1000 routes per route table via service quota.
How to exclude IPv6 CIDR with built-in github/google/cloudflare routes
You can exclude IPv6 CIDR like below,
new SimpleNAT(this, 'SimpleNAT', {
vpc,
})
.withCloudflareRoute({
excludeIPv6: true,
});
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for zxkane_cdk_construct_simple_nat-0.2.734.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fdb89cc8fab1cda826701f464e0903a2f0aa158c3fbf93abfe093be54e014e69 |
|
MD5 | 2fbb854facab94b339870141cf404a66 |
|
BLAKE2b-256 | 6c0aba2e13aa8686cbfd1db6d409913b1194fe3ce6ae85a2bca2961bc3c6abcf |
Close
Hashes for zxkane.cdk_construct_simple_nat-0.2.734-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20a5dc7cf85eea6232c20ab1edbb822b1da556fefb070d233dd089510bd63435 |
|
MD5 | 03c638eddb685c548673fc12eef841bd |
|
BLAKE2b-256 | fac42e7488b2b0e0919619681746bef798a0fb5c343d0ab562b54c58bf2b3d7f |