Skip to main content

Simple NAT

Release NPM version pypi version coverage

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
  • Google
  • Cloudflare

Arch diagram

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,
});

Metadata

Release files for zxkane.cdk-construct-simple-nat 0.2.742

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zxkane.cdk-construct-simple-nat 0.2.742
File Size Uploaded
zxkane_cdk_construct_simple_nat-0.2.742.tar.gz 252.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for zxkane.cdk-construct-simple-nat 0.2.742
File Interpreter ABI Platform
zxkane.cdk_construct_simple_nat-0.2.742-py3-none-any.whl Python 3 none any Details

Total release size: 504.3 kB

Release files / zxkane_cdk_construct_simple_nat-0.2.742.tar.gz

Download URL zxkane_cdk_construct_simple_nat-0.2.742.tar.gz
Size 252.9 kB
Tags Source
SHA-256 checksum
How to use checksums
76631c47746e7d9ff611bdf2bf0da9e2e4db046bd55c877334ec471b4c08bc8d
BLAKE2b-256 checksum
How to use checksums
96b56ebf9f0be2ba43969f12fedfd0a23ffa422908370c6453d6e2103a1f8558
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.6

Release files / zxkane.cdk_construct_simple_nat-0.2.742-py3-none-any.whl

Download URL zxkane.cdk_construct_simple_nat-0.2.742-py3-none-any.whl
Size 251.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5ab19b9af5ea6179fd953247c2d0ca752e350f3ebf76fd81e89e1c77a1db07f2
BLAKE2b-256 checksum
How to use checksums
53ba4cce9cfbe3c60f1922b5df2ac035c1fa2008b99f950c1fa48d2a42c51751
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.6

Release history Release notifications | RSS feed

This release

0.2.742 This release

2 release files

0.2.99

2 release files

0.2.98

2 release files

0.2.97

2 release files

0.2.96

2 release files

0.2.95

2 release files

0.2.94

2 release files

0.2.93

2 release files

0.2.92

2 release files

0.2.91

2 release files

0.2.90

2 release files

0.2.89

2 release files

0.2.88

2 release files

0.2.78

2 release files

0.2.77

2 release files

0.2.76

2 release files

0.2.74

2 release files

0.2.73

2 release files

0.2.72

2 release files

0.2.71

2 release files

0.2.70

2 release files

0.2.69

2 release files

0.2.68

2 release files

0.2.67

2 release files

0.2.66

2 release files

0.2.65

2 release files

0.2.50

2 release files

0.2.49

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page