live/
What does the live/ folder contain?
This template uses Terragrunt for streamlined deployment and is designed to be deployed either locally or via GitHub CI.
In the live/
directory, you will find Terragrunt configurations for each environment.
Terragrunt is a powerful tool for managing Terraform configurations across multiple modules and environments from a single source of truth. It helps keep infrastructure code DRY (Don't Repeat Yourself) through modular configuration and dependency management.
The template consists of three core Terraform modules:
base/aws
base/snowflake
pipelines/
This structure is replicated in the live/
directory, where each module has its own terragrunt.hcl
file containing:
Input values
Terraform provider configuration
Terraform backend configuration
Dependencies on other modules
Note that all terragrunt.hcl
files reference the root.hcl
file, where common configurations are defined.
There are three ways to deploy the project:
Local deployment with local state
Local deployment with remote state
GitHub deployment with remote state
Option 1 is ideal for quickly getting started but is not recommended for production deployments.
The deploy command will:
Run
terragrunt run-all apply
to deploy all Terraform modules in the correct orderBuild and push all Docker images found in the
pipelines/ingest
andpipelines/transform
folders
Why Separate Terraform and Docker Processes?
The infrastructure deployment and container build processes must be separated due to dependencies between resources.
For example, when Terraform creates an AWS Lambda function with an associated ECR repository, the ECR repository must exist before the container image can be built and pushed to it. However, the container image must be built and pushed to ECR before the Lambda function can be fully functional.
This circular dependency is resolved by:
First, deploying the infrastructure (ECR, Lambda, etc.) via Terraform/Terragrunt
Then, building and pushing container images in a separate process
This two-step approach ensures that all required infrastructure exists before building and deploying containers.
Local Deployment with Remote State
Do not store the Terraform state on your local machine. Instead, store the state in a remote backend such as AWS S3.
GitHub Deployment with Remote State
Last updated