Skip to main content

Overview

This example shows how to create multiple environments with different configurations using Terraform’s for_each loop.

Configuration

Variables

Outputs

Deployment

Features

Each environment has tailored resource allocations:
  • Development: Minimal resources (250 CPU, 256 MB RAM, 1 replica)
  • Staging: Medium resources (500 CPU, 512 MB RAM, 2 replicas)
  • Production: Full resources (1000 CPU, 1024 MB RAM, 3 replicas)
Environments deploy from different Git branches:
  • Development → develop branch
  • Staging → staging branch
  • Production → main branch
  • Development and Staging: Auto-deploy enabled
  • Production: Manual deployments only
  • Development & Staging: 10 GB storage
  • Production: 50 GB storage

Selective Deployment

Deploy to specific environments:

Alternative: Using Workspaces

You can also use Terraform workspaces for environment separation:

Next Steps

Airbyte Deployment

Complete real-world multi-service example

Advanced Patterns

Modules and advanced techniques

Environment Configuration

Learn more about environments

Provider Documentation

Complete provider reference