Terraform and Flask
In this tutorial, we'll learn how to deploy a Python Flask application that queries a Redis database hosted by AWS ElastiCache.
Instead of manually configuring Redis on ElastiCache, we'll use Terraform with Release's infrastructure runners to provision a Redis cluster.
We'll start with the awesome-release/release-terraform-flask-redis
application.
Step 1: Fork the GitHub repo
Fork awesome-release/release-terraform-flask-redis
on GitHub using the account you have authenticated with Release.
Step 2: Create a new Release application
Enter a unique name for your application.
Select the fork you created in step 1.
Click Next Step.
Select the
main
branch.Select
compose.yaml
.Click Start Analysis.
Click Next Step.
Select the
main
branch.Select
.release/application_template.yaml
.Make sure the application's context and domain are correct.
Click Next Step.
Select
.release/environment_variables.yaml
.Click Next Step.
Click Deploy your app!
Step 3: Follow the deployment
Release will build and deploy your application. Open the infrastructure runner step to see output from Terraform.
Step 4: View the environment
View the environment detail page and click on the web URL.
Result
You should see HTML output showing the number of times this application has been viewed.
If the resulting view count is more than you anticipated, keep in mind that Release's health checker makes an HTTP request, which counts as a page view in our example.
Further reading
Get started with Terraform – Release documentation about using Terraform
Infrastructure as code (IaC) – Release documentation about IaC
Last updated