Search
K
Links
Comment on page

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

Create a new Release application, step one
  1. 1.
    Enter a unique name for your application.
  2. 2.
    Select the fork you created in step 1.
  3. 3.
    Click Next Step.
Create a new Release application, step two
  1. 1.
    Select the main branch.
  2. 2.
    Select compose.yaml.
  3. 3.
    Click Start Analysis.
Create a new Release application, step three
  1. 1.
    Click Next Step.
Create a new Release application, step four
  1. 1.
    Select the main branch.
  2. 2.
    Select .release/application_template.yaml.
  3. 3.
    Make sure the application's context and domain are correct.
  4. 4.
    Click Next Step.
Create a new Release application, step five
  1. 1.
    Select .release/environment_variables.yaml.
  2. 2.
    Click Next Step.
Create a new Release application, step six
  1. 1.
    Click Deploy your app!

Step 3: Follow the deployment

Release deployment terraform
Release will build and deploy your application. Open the infrastructure runner step to see output from Terraform.

Step 4: View the environment

Release environment detail page
View the environment detail page and click on the web URL.

Result

Release 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