This ready to use example show you how to deploy a containerizes app (Strapi) with PostgreSQL on AWS in Production, Staging and Dev and make it accessible via HTTPS. All of that in just a few lines of Terraform file.
Behind the scene, Qovery:
- Creates 3 Kubernetes clusters (
Production
,Staging
,Dev
) on your AWS account (VPC, Security Groups, Subnet, EKS/Kubernetes...) - Creates Qovery resources:
- Organization
Terraform Demo
- Project
Strapi V4
- Environment
production
- Database
strapi db
(RDS) forProduction
- Application
strapi app
forProduction
- Environment
staging
- Database
strapi db
(RDS) forStaging
- Application
strapi app
forStaging
- Environment
dev
- Database
strapi db
(Container with EBS) forDev
- Application
strapi app
forDev
- Inject all the Secrets and Environment Variables used by the app for every environment
- Organization
- Build
strapi app
application forProduction
,Staging
andDev
environments in parallel - Pushes
strapi app
container image in your ECR registry forProduction
,Staging
andDev
environments in parallel - Deploys your PostgreSQL database for
Production
(AWS RDS),Staging
(AWS RDS) andDev
(Container) environments in parallel - Deploys
strapi app
on yourProduction
,Staging
andDev
EKS clusters - Creates an AWS Network Load Balancer for all your clusters and apps
- Generates a TLS certificate for your app for all your apps
- Exposes publicly via HTTPS your Strapi app from
Production
,Staging
andDev
through different endpoints
It will take approximately 20 minutes to create your infrastructure and less than 10 minutes to deploy your application for each environment.
- Clone this repository
- Sign in to Qovery
- Install the Qovery CLI and generate an API Token with this guide.
- Generate your AWS credentials (
Access Key ID
andSecret Access Key
) with this guide - Open you terminal and run the following command by changing the values:
export TF_VAR_aws_access_key_id=YOUR_AWS_ACCESS_KEY_ID \
TF_VAR_aws_secret_access_key=YOUR_AWS_SECRET_ACCESS_KEY \
TF_VAR_qovery_access_token=YOUR_QOVERY_API_TOKEN \
TF_VAR_qovery_organization_id=YOUR_QOVERY_ORG_ID
If you use this template in production, beware that you have some values to change in
variables.tf
- Clone my Strapi application
- Edit the
main.tf
file and changehttps://github.com/evoxmusic/strapi-v4.git
with yours - You can now run the Terraform commands
terraform init
terraform plan
terraform apply
- Open your Qovery console to find out the HTTPS URL of your deployed app.
- To tear down your infrastructure and avoid unnecessary cloud costs you can run
terraform destroy
.