diff --git a/README.md b/README.md index 31573d9..a337ac7 100644 --- a/README.md +++ b/README.md @@ -24,17 +24,26 @@ Atmos requires the following file structure └── qa.tfvars ``` -The vars directory is scanned by atmos and matches the current workspace to the vars file. If the workspace is not found it defaults to the qa environment. This is to ensure qa branches are deployed similarily without having to create a var file for each new branch. +The vars directory is scanned by atmos and matches the current workspace to the vars file. If the workspace is not found it defaults to the qa environment. This is to ensure qa branches are deployed similarily without having to create a var file for each new branch. # AWS Credentials To get the most out of Terraform workspaces it is recommended that the AWS provider uses the profile attribute. ``` +# main.tf provider "aws" { region = "${var.region}" - profile = "${terraform.workspace}" + profile = "${var.workspace}" } ``` -This will make Terraform lookup AWS credentials from the `~/.aws/credentials` file using the workspace name as the stanza name. For example the credentials file would look like the shared-creds file in this repo. +``` +# variables.tf +variable "workspace" { + type = "string" + default = "default" +} +``` + +This will make Terraform lookup AWS credentials from the `~/.aws/credentials` file using the workspace name as the stanza name. For example the credentials file would look like the shared-creds file in this repo. \ No newline at end of file