mirror of
https://github.com/3bbbeau/tfvars-atlantis-config.git
synced 2024-11-22 14:00:52 +00:00
docs: example config; multienv
This commit is contained in:
parent
d64e4b7183
commit
f3d3731057
30
README.md
30
README.md
@ -38,6 +38,7 @@ environment levels.
|
|||||||
my-terraform
|
my-terraform
|
||||||
├── main.tf
|
├── main.tf
|
||||||
├── dev.tfvars
|
├── dev.tfvars
|
||||||
|
├── prod.tfvars
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Generates the following Atlantis configuration:
|
#### Generates the following Atlantis configuration:
|
||||||
@ -73,7 +74,8 @@ workflows:
|
|||||||
extra_args:
|
extra_args:
|
||||||
- -var-file=dev.tfvars
|
- -var-file=dev.tfvars
|
||||||
apply:
|
apply:
|
||||||
- apply
|
steps:
|
||||||
|
- apply
|
||||||
my-terraform-prod:
|
my-terraform-prod:
|
||||||
plan:
|
plan:
|
||||||
steps:
|
steps:
|
||||||
@ -82,7 +84,8 @@ workflows:
|
|||||||
extra_args:
|
extra_args:
|
||||||
- -var-file=prod.tfvars
|
- -var-file=prod.tfvars
|
||||||
apply:
|
apply:
|
||||||
- apply
|
steps:
|
||||||
|
- apply
|
||||||
```
|
```
|
||||||
|
|
||||||
## Why you should use it?
|
## Why you should use it?
|
||||||
@ -103,8 +106,31 @@ runtime.
|
|||||||
| `--automerge` | Enable auto merge. | false |
|
| `--automerge` | Enable auto merge. | false |
|
||||||
| `--autoplan` | Enable auto plan. | false |
|
| `--autoplan` | Enable auto plan. | false |
|
||||||
| `--default-terraform-version` | Default terraform version to run for Atlantis. Default is determined by the Terraform version constraints. | "" |
|
| `--default-terraform-version` | Default terraform version to run for Atlantis. Default is determined by the Terraform version constraints. | "" |
|
||||||
|
| `--debug` | Enable debug logging. | false |
|
||||||
| `--multienv` | Enable injection of environment specific environment variables to each workflow. | false |
|
| `--multienv` | Enable injection of environment specific environment variables to each workflow. | false |
|
||||||
| `--output` | Path of the file where configuration will be generated, usually `atlantis.yaml`. Default is to write to `stdout` | `stdout` |
|
| `--output` | Path of the file where configuration will be generated, usually `atlantis.yaml`. Default is to write to `stdout` | `stdout` |
|
||||||
| `--parallel` | Enables plans and applys to happen in parallel. | false |
|
| `--parallel` | Enables plans and applys to happen in parallel. | false |
|
||||||
| `--root` | Path to the root directory of the git repo you want to build config for. Default is current dir. | `.` |
|
| `--root` | Path to the root directory of the git repo you want to build config for. Default is current dir. | `.` |
|
||||||
| `--use-workspaces` | Whether to use Terraform workspaces for projects. | false |
|
| `--use-workspaces` | Whether to use Terraform workspaces for projects. | false |
|
||||||
|
|
||||||
|
## Multienv
|
||||||
|
When `--multienv` is enabled, prefixed environment variables will be
|
||||||
|
stripped of their prefix and injected into each workflow for the duration
|
||||||
|
the workflow is run during plan/apply stages.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
_dev.tfvars_:
|
||||||
|
|
||||||
|
- `DEV_FOO_VAR="BAR"` -> `FOO_VAR="BAR"`
|
||||||
|
- `DEV_AWS_ACCESS_KEY="..."` -> `AWS_ACCESS_KEY="..."`
|
||||||
|
|
||||||
|
_stg.tfvars_:
|
||||||
|
|
||||||
|
- `STG_FOO_VAR="BAR"` -> `FOO_VAR="BAR"`
|
||||||
|
- `STG_AWS_ACCESS_KEY="..."` -> `AWS_ACCESS_KEY="..."`
|
||||||
|
|
||||||
|
..and so on.
|
||||||
|
|
||||||
|
Reference:
|
||||||
|
[Multienv](https://www.runatlantis.io/docs/custom-workflows.html#step)
|
||||||
|
Loading…
Reference in New Issue
Block a user