A web application deployment using Terraform for AWS, Azure, and GCP.
MIT License
This sample application contains full Terraform deployments for the three major cloud platforms, namely: Amazon Web Services (AWS), Microsoft Azure (AZ), and Google Cloud Platform (GCP).
The goal of this project is to make those three deployments as homogeneous as possible to be able to compare the differences. Since not all cloud platforms offer the same features and work similarly, the resulting architectures differ slightly. Another aim was to make the deployments self-contained (they deploy the function code and frontend automatically), use only Serverless services as well as move all common parts out of the deployment (shared OpenAPI config and code).
The goals of the Terraform deployments in this project are:
The application itself is a simple text analysis service that comes with a web-based frontend:
The relevant parts of this repository are:
Folder/File | Description |
---|---|
.devcontainer/ | The vscode devcontainer for this project |
.github/ | Reamd resources |
.vscode/ | vscode settings |
aws/ | The AWS deployment |
azure/ | The Azure deployment |
common/ | Common parts of the deployments |
common/api/ | The OpenAPI config |
common/function/ | The code for the FaaS function |
common/website/ | The static website for the frontend |
common/mime-types.json | The MIME type definitions for uploads |
gcp/ | The GCP deployment |
justfile | The just configuration |
You can start up this project rather quickly using the vscode devcontainers, which are based on Docker.
Using the command runner just, apply the Terraform configuration using just apply <folder>
, with aws
, gcp
or azure
as the folder name.
The application requires a frontend (a static website) and backend (based on Function as a Service (FaaS) offerings). The frontend needs to be served using a Content Delivery Network (CDN) to improve stability and page speeds. The FaaS function of the backend should sit behind an API Gateway.
API-spec-converter --from=openapi_3 --to=swagger_2 --syntax=yaml openapi.yaml
).