Main Infrastructure

📁 See the Main Infrastructure Folder →

VPC configuration

📃 See VPC Terraform configuration file →

The VPC allocates the address range 192.168.42.0/24

In order to make the VPC accessible from the Internet, it is necessary to create public Subnets, an Internet Gateway and a Route table.

Subnets

One of the key criteria of the project is high availability, so it is mandatory to create at least two subnets.

Each subnet takes up half of the address range: 192.168.42.0-63 for Subnet A, and 192.168.42.64-127 for Subnet B; 128 IP addresses are more than enough for the project. The other half of the address range is unallocated to make room for potential private Subnets that may emerge in the future of the project..

Internet Gateway

To install the Internet Gateway, all it needs is to link it to the VPC and associate a Route table which will manage the traffic between the Internet Gateway and the Subnets. Users will not yet have access to the VPC until until they are allowed to do so in the Route table.

Route table

The Route table manages the inbound and outbound traffic in the Subnets. Subnets are public, so all IPs (0.0.0.0/0) are allowed to access them. Access to the resources should therefore be controlled via their Security Groups.

ECR configuration

📃 See ECR Terraform configuration file →

Every AWS account comes with an Elastic Container Registry by default, so there is no need to create it. However, it is necessary to create repositories inside this registry that will contain the Docker images of the application.

Three repositories are created:

  • product-hunting-ecr-repository-postgres repository for the Docker images of the Postgres database;
  • product-hunting-ecr-repository-api repository for the Docker images of the Application API;
  • product-hunting-ecr-repository-client repository for the Docker images of the web Client.