Create a VPC endpoint for ECR with Terraform and save Nat Gateway $$$

Alex Hladun
Jun 11, 2021

Nat gateway is expensive, so here is some terraform code to set up a VPC endpoint for ECR (both com.amazonaws.region.ecr.dkr and com.amazonaws.region.ecr.dk)r. Note that ECR uses S3 under the hood, so you will need to set up an S3 endpoint as well, as well as endpoints for ECS telemetry and ECS agent.

Note: The full TF infrastructure is avilable here, along with a guide that you can follow along to deploy a sample websocket chat-app using Docker/Fargate, React, and theNAT gateway to AWS using Terraform: https://github.com/xerris/chat-app-socket-io.

--

--