Browse documentation
This Website
Infrastructure
How Terraform defines the AWS services that run and expose the application.
Overview
The AWS infrastructure for this portfolio is primarily defined using Terraform, allowing the environment to be recreated from version-controlled configuration. Infrastructure changes are reviewed, committed and applied in a repeatable manner, while runtime parameter values and selected bootstrap configuration are deliberately managed outside Terraform.
The current infrastructure focuses on providing a production-style deployment for the portfolio while remaining intentionally simple enough to understand and evolve over time. Where appropriate, the surrounding infrastructure has been designed with future expansion in mind rather than implementing unnecessary complexity from the outset.
Infrastructure Overview
The following diagram illustrates the major infrastructure components used to host the application.
flowchart TB
Internet[Internet]
Route53[Route 53]
Internet --> Route53
Route53 --> ALB
subgraph VPC
subgraph Public Subnets
ALB[Application Load Balancer]
ECS[ECS Service]
APP[Next.js Container]
ALB --> ECS
ECS --> APP
end
subgraph Private Subnets
Future[Reserved for Future Services]
end
end
GitHub[GitHub Actions] --> ECR[ECR Repository]
ECR --> ECSInfrastructure Components
| Component | Purpose |
|---|---|
| VPC | Provides an isolated network for the portfolio infrastructure. |
| Public Subnets | Host the internet-facing application and load balancer. |
| Private Subnets | Reserved for future backend services and internal workloads. |
| Application Load Balancer | Receives HTTPS traffic and routes requests to the application. |
| ECS Fargate | Runs the containerised Next.js application. |
| Amazon ECR | Stores Docker images produced by the deployment pipeline. |
| Route 53 | Provides authoritative DNS for the portfolio domain. |
| AWS Certificate Manager | Manages SSL/TLS certificates for HTTPS. |
| Systems Manager Parameter Store | Stores runtime configuration securely. |
Networking
The portfolio is deployed within a dedicated Amazon VPC spanning two Availability Zones. Public and private subnets have been provisioned from the outset, establishing a network topology that can support future services without requiring significant structural changes.
At present, the Next.js application runs within the public subnet configuration behind an Application Load Balancer. This keeps the initial deployment relatively straightforward while allowing the project to demonstrate container orchestration, infrastructure as code and automated deployments without introducing networking components that are not yet required.
Although the private subnets are not currently hosting application services, they have been provisioned as part of the initial infrastructure to support future backend APIs, background workers and other internal workloads.
Container Platform
The application is deployed as a Docker container running on Amazon ECS Fargate.
Using Fargate removes the need to provision or manage EC2 instances while still providing a deployment model commonly used for production container workloads. Application deployments replace running tasks with newly published container images, allowing updates to be performed with minimal operational overhead.
Image Registry
Application images are stored within Amazon Elastic Container Registry (ECR).
Each deployment publishes a uniquely tagged Docker image before updating the ECS service to use the new image. Separating image storage from application execution creates a repeatable deployment process while maintaining a clear history of deployed application versions.
Configuration
Application configuration is managed using AWS Systems Manager Parameter Store.
Runtime configuration is injected into the application container when it starts rather than being embedded into the Docker image. This allows environment-specific configuration to remain separate from application code while avoiding sensitive values being committed to source control.
Infrastructure as Code
Terraform manages the AWS resources that form the application platform, including networking, load balancing, ECS, ECR, Route 53 records, certificates and IAM configuration. Runtime parameter values are managed separately so sensitive values are not written into Terraform state.
Managing infrastructure alongside the application source code makes the environment reproducible, encourages incremental changes through version control and allows the complete platform to be recreated when required.
Future Infrastructure
While the current infrastructure consists primarily of a single frontend application, the surrounding platform has been designed to support future expansion without requiring significant architectural changes.
flowchart TB
Internet
Internet --> Route53
Route53 --> ALB
subgraph VPC
subgraph Public Subnets
ALB
end
subgraph Private Subnets
NextJS[Next.js]
FastAPI[Python API]
Workers[Background Workers]
ALB --> NextJS
NextJS --> FastAPI
FastAPI --> Workers
end
endPlanned enhancements include:
- Moving application services into the existing private subnet architecture.
- Introducing Python backend services and internal APIs.
- Adding background workers for asynchronous processing.
- Expanding monitoring and observability.
- Continuing to evolve the shared infrastructure as additional portfolio projects are introduced.