Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: clarify account usage, and document global case #258

Merged
merged 1 commit into from
Oct 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 23 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -484,22 +484,33 @@ $ tfwrapper plan

Terraform stacks are organized based on their:

- account: an account alias which may reference one or multiple providers accounts. `aws-production`, `azure-dev`, etc…
- environment: `production`, `preproduction`, `dev`, etc
- region: `eu-west-1`, `westeurope`, `global`, etc
- stack: defaults to `default`. `web`, `admin`, `tools`, etc
- `account`: an account alias which may refer to provider accounts or subscriptions, e.g. `project-a-prod`, `customer-b-dev`.
- `environment`: `production`, `preproduction`, `dev`, etc. With `global` as a special case eliminating the `region` part.
- `region`: `eu-west-1`, `westeurope`, etc.
- `stack`: defaults to `default`. `web`, `admin`, `tools`, etc.
Comment on lines +487 to +490
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This from #246 (comment)

does not contain / or _ characters.

actually is an undocumented requirement.
Being ANAL here: it is left to be deduced by a reader from the ${account}_${environment}_${region}_${stack}.yml and the fact that if _-s are used as separators, then likely those can't be used in names.


The following file structure is enforced:

The following file structure is then enforced:

```
# enforced file structure
# project root
└── account
│ └── environment
│ └── region
│ └── stack
└── account
└── environment
└── region
└── stack
└── _global
└── stack
```

# real-life example
A real-life example:

```
# project root
├── aws-account-1
│ ├── _global
│ │ └── default
│ │ └── main.tf
│ └── production
│ ├── eu-central-1
│ │ └── web
Expand Down Expand Up @@ -533,6 +544,8 @@ tfwrapper -a ${account} -e ${environment} -r ${region} -s ${stack} bootstrap aws
tfwrapper -a ${account} -e ${environment} -r ${region} -s ${stack} bootstrap mycustomer/dev/eu-west/run
```

In the special case of a global stack, the configuration file should instead be named as `conf/${account}_global_${stack}.yml`.

### Working on stacks

You can work on stacks from their directory or from the root of the project.
Expand Down
Loading