# Set up environment

## Step 1: Create environment directory

Navigate to the directory where you checked out the repository:

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

Create a directory to hold your environments (`dev`, `qa`, `prod`, etc.):

```bash title="repo-iac/"
mkdir environments
cd environments/
```

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

```bash title="repo-iac/environments/"
mkdir dev
cd dev/
```

## Step 2: Create configuration file

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

```yaml title="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 is created. [How to find your account ID?](../aws-account/find-my-aws-account-id.md).                                                                |                          |
| `Region`      | AWS region where the environment is 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 applies to all templates in the `dev` stack.

## Next step

Set up [remote state](set-up-remote-state.md) to create the S3 bucket and DynamoDB table for storing Terraform state remotely.
