Skip to content

Initialize environment

Step 1: Create environment directory

Navigate to the directory where you checked out the repository:

# Replace <~/projects/repo-iac> with your repository location
cd ~/projects/repo-iac

Create a directory for environments (it will contain dev, qa, prod, etc.):

repo-iac/
mkdir environments
cd environments/

Create a directory for your first environment (using dev as example):

repo-iac/environments
mkdir dev
cd dev/

Step 2: Create configuration file

Create common-config.yml in the dev/ directory:

repo-iac/environments/dev/common-config.yml
AccountId: "1234567890"
Region: "eu-west-1"
Team: "pirates"
Environment: "pirates-dev"
Parameter Description Validation
AccountId AWS account ID where the environment will be created. How do I find my account ID?.
Region AWS region where the environment will be created. Typically: eu-west-1.
Team Team name. Used as part of AWS resource names. Alpha-numeric and dashes
Environment Environment name. Used as part of AWS resource names, for example the S3 bucket created to store the remote_state. Note: Recommended to contain the environment (dev/prod/staging). Alpha-numeric and dashes

This file will be used for all templates in the dev stack.

Next step

Set up remote state to create the S3 bucket and DynamoDB table for storing Terraform state remotely.