Skip to content

A runnable CDK snippet to create a simple private VPC with (some) VPC Endpoints configured

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

niko-dunixi/simple-private-vpc-template

Repository files navigation

Simple Private VPC

This is a simple private VPC written in the GoLang AWS CDK. It has only private subnets with egress, but it does not provision a NAT. Instead it provisions Gateway interfaces to lower cost while prototyping resources that must have a VPC (such as Fargate) but don't need to have egress to the internet at large.

Please note that VPC Endpoints are low cost but are NOT free

Dependencies

You will need to install the following for your machine

  • AWS Cli
    • You must configure your machine for development with AWS
  • GoLang
  • NodeJS
    • I personally find the fnm project to be reliable and portable node version manager
    • Alternatively nvm is popular
  • Just (optional)
    • A language agnostic command runner

Running, Testing, Deploying

The primary commands are straight forward

$ just bootstrap

  • This is necessary the first time you use the CDK with your AWS account
  • It is only needed once, you don't need to run it ever again

$ just deploy

  • Will synthesize the CloudFormation template and deploy it to your account

$ just destroy

  • Will tear down and delete all the resources created when you deployed
  • Be sure to do this when you no longer need your VPC, the VPC Endpoints will incur costs

$ just test

  • Validates a VPC will be created
  • Validates all subnets are private with egress

$ just synth

  • Useful if you are curious about or want to debug the rendered CloudFormation template.

Further Reading

About

A runnable CDK snippet to create a simple private VPC with (some) VPC Endpoints configured

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks