Terraform and Flask
Last updated
Last updated
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.
Fork awesome-release/release-terraform-flask-redis
on GitHub using the account you have authenticated with Release.
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!
Release will build and deploy your application. Open the infrastructure runner step to see output from Terraform.
View the environment detail page and click on the web URL.
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.
Get started with Terraform – Release documentation about using Terraform
Infrastructure as code (IaC) – Release documentation about IaC