How nix-tkobayashi/apprunner-global-loadbalancer works
Project Type and Purpose
• This is an infrastructure-as-code project designed to provision global load balancing for applications deployed using AWS App Runner.
• The repository provides Terraform scripts (in the terraform directory) to set up AWS resources and a Docker-based configuration (in the apps directory) for an Nginx server that acts as part of the load balancing or upstream backend.
File Structure
• The top-level provides configuration and metadata files (.gitignore, LICENSE, README.md).
• The “apps” folder contains:
• Dockerfile – This indicates that a Docker container is built, likely to run the Nginx server.
• nginx.conf – Custom Nginx configuration file, probably tailored to handle upstream backend requests.
• The “terraform” folder has several .tf files (main.tf, provider.tf, variables.tf, data.tf, locals.tf, output.tf) which collectively define the infrastructure and the global load balancing resources on AWS.
Insights from the README
• The README clarifies that the repository’s purpose is to handle global load balancing for AWS App Runner applications.
• It specifies using Terraform to deploy AWS resources and Docker for running the nginx server.
• The update “server” portion seen in the instructions (editing nginx.conf) implies that the Nginx container will serve as a critical element in routing or load balancing traffic.
a. Main Components to Illustrate:
• AWS App Runner Applications: Represent the target applications that will be load balanced.
• Global Load Balancer (Terraform Provisioned): Represent the AWS resources created via Terraform that manage global routing.
• Infrastructure Provisioning Layer: Include Terraform modules and configuration that provision the AWS resources.
b. Relationships and Data Flow:
• From the Global Load Balancer, illustrate routing to an Nginx server (the Dockerized component) which may further forward requests to AWS App Runner instances.
• Terraform’s role as automating AWS resource creation and configuration – you might note “Terraform applies configuration ➔ AWS Infrastructure Updated.”
c. Architectural Patterns and Design Principles:
• Infrastructure as Code (IaC): Emphasize how Terraform scripts define and provision cloud resources.
• Containerization: Highlight the use of Docker to deploy and manage the Nginx load balancing component.
• Separation of Concerns: Clearly separate the infrastructure code (Terraform) from the application configuration (Docker, Nginx).
d. Technologies & Frameworks:
• AWS App Runner (target deployment service)
• Terraform (for AWS provisioning)
• Docker (for containerizing the Nginx server)
• Nginx (for load balancing)