AWS VPC to ECS – Day 2: Internet Gateway, Public Route Table, and ECR Repository

Step-by-step guide to connect an AWS VPC to the Internet with IGW and a public route, and create an ECR repository for Docker images with CloudFormation and ECS.

domingo, 17 de agosto de 2025 • 3 min read • Q2BSTUDIO Team

Artificial-Intelligence-

Welcome to the second installment of the AWS VPC to ECS Day 2 Internet Gateway Public Route Table and ECR Repository series, where we continue building the cloud infrastructure step by step

On Day 1, we created the VPC and the base subnets. Now we expand that foundation to allow internet access and prepare the storage for container images

Objectives of this hands-on guide

• Attach an Internet Gateway (IGW) to the VPC

• Create a public route table and associate it with the public subnets

• Provision an ECR repository to store Docker images

About the Internet Gateway

The Internet Gateway (IGW) acts as the main gateway that connects the VPC to the Internet. Without it, public resources cannot communicate outside the VPC. It is an essential piece for resources that require public access, such as NAT gateways and exposed services

How to implement the IGW with CloudFormation

Flow summary: Create an AWS EC2 InternetGateway resource, tag it with name, team, and environment. Attach the IGW to the VPC and optionally store the identifier in SSM Parameter Store for future references. When deploying, use aws cloudformation deploy with the corresponding template

Public route table

The Route Table defines where network traffic enters and exits. For a subnet to be public, there must be a route 0.0.0.0/0 pointing to the IGW. Additionally, you must associate the route table with the public subnets we defined on Day 1

Key steps: Create the RouteTable resource and associate it with the VPC. Add a route whose DestinationCidrBlock is 0.0.0.0/0 and GatewayId is the IGW. Associate the table with the public subnets using SubnetRouteTableAssociation. Then deploy with aws cloudformation deploy

Elastic Container Registry (ECR)

Before deploying containers in ECS, we need a secure place to store the images. Amazon ECR is a fully managed private container registry that integrates with ECS, IAM, and supports lifecycle policies to keep storage under control

Benefits of using ECR

• Private and secure storage for Docker images

• Native integration with ECS and access control with IAM

• Lifecycle policies and image versioning

Recommended implementation: Create an ECR repository with a representative name. Add a lifecycle policy that keeps only the necessary versions and tags to facilitate management and billing. Then deploy the corresponding CloudFormation template

Recap of what was done today

• We enabled internet access for public resources by creating an IGW and a public route table with a default route to the IGW

• We provisioned an ECR repository to store our application images before deploying them in ECS

How to keep moving forward

In the following installments, we will integrate ECS by creating clusters, tasks, and services, as well as configuring roles, policies, and continuous deployment pipelines with integration to ECR. Stay tuned to see how to connect everything and deploy your containerized application

About Q2BSTUDIO

Q2BSTUDIO is a software development company that creates custom applications and bespoke software for businesses of all sizes. We specialize in artificial intelligence, cybersecurity, cloud services (AWS and Azure), business intelligence services, and AI solutions for companies. We offer AI agents, custom developments, Power BI integration, and cybersecurity strategies to protect your digital assets

Why choose Q2BSTUDIO

• Experience in cloud architecture and deployment on AWS and Azure

• Custom application development focused on business results

• Implementation of artificial intelligence solutions and AI agents to automate processes

• Business intelligence and Power BI services to turn data into decisions

Contact us to take your project to production with security practices and industrializable automation

Keywords: custom applications, bespoke software, artificial intelligence, cybersecurity, cloud services (AWS and Azure), business intelligence services, AI for businesses, AI agents, Power BI

If you want us to prepare CloudFormation templates ready for your environments or deploy the complete solution in your account, contact Q2BSTUDIO and we will help you design a scalable, secure, and cost-optimized architecture

Thank you for following the series, and we hope to see you in the next installment where we will dive into ECS and container deployment

A BREAK?

Play for a moment before you go

OUR SERVICES

How we can help you

Do you have a project in mind?

Tell us your vision and we'll turn it into a software solution. Whatever the scope, we make your idea real.