Skip to content

Commit

Permalink
bt: Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidGamba committed Dec 5, 2023
1 parent 1d8f54d commit a0c0bd3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 28 deletions.
3 changes: 3 additions & 0 deletions bt/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,11 @@ If pre-apply checks are enabled in the config file, they can be disabled for the

Multiple terraform config profiles can be defined.
By default, the `default` profile is used.
The default profile can be overriden with `config.default_terraform_profile` in the config file.

To use a different profile, use the `--profile` option or export the `BT_TERRAFORM_PROFILE` environment variable.
The environment variable can also be overridden to read an existing one in the environment.
For example, set `config.terraform_profile_env_var` to `AWS_PROFILE` and name your terraform profiles the same way you name your AWS profiles.

Each profile will have its own `TF_DATA_DIR` and the terraform data will be saved under `.terraform-<profile>/`.
This allows to work with multiple profiles pointing to different backends under the same workspace directory without conflicts.
29 changes: 1 addition & 28 deletions bt/changelog.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,7 @@

== v0.3.0: Breaking changes

* Terraform config has been updated to support multiple profiles.

Wrap the terraform config under the `default` profile to get similar behaviour.

[source, diff]
----
terraform: {
+ default: {
binary_name: "terraform"
init: {
backend_config: ["backend.tfvars"]
}
plan: {
var_file: ["~/auth.tfvars"]
}
workspaces: {
enabled: true
dir: "envs"
}
pre_apply_checks: {
enabled: true
commands: [
{name: "conftest", command: ["conftest", "test", "$TERRAFORM_JSON_PLAN"]},
]
}
+ }
}
----
Terraform config has been updated to support multiple profiles.

Additionally, the terraform data is no longer saved at the default `.terraform/` dir but has been changed to follow the format `.terraform-<profile>/`.

Expand Down

0 comments on commit a0c0bd3

Please sign in to comment.