aws-samples / aws-samples/lza-validator
Include list of environment variables that are read by the LZA config validator
- Dominant language
- Shell
- Stars
- 27
- Forks
- 13
- PR merge metrics
- No merged PRs in 30d
Description
There are several environment variables that can be set to customize the behavior of the config validator. It would be helpful to have them documented to support non-standard use cases. In my case, I had to set the `PARTITION` environment variable to run the config for a GovCloud organization.
The list of environment variables includes:
- `ACCELERATOR_ENABLE_SINGLE_ACCOUNT_MODE`
- `PARTITION`
- `AWS_REGION`
- `ACCOUNT_ID`
- `ACCELERATOR_STAGE`
[Source](https://github.com/awslabs/landing-zone-accelerator-on-aws/blob/25c9817276fbdb2ecb96f375c3164a7cba5569cc/source/packages/%40aws-accelerator/accelerator/lib/config-validator.ts#L60-L75)
With the exception of `ACCELERATOR_ENABLE_SINGLE_ACCOUNT_MODE`, all of these have [documented CLI arguments](https://awslabs.github.io/landing-zone-accelerator-on-aws/latest/developer-guide/scripts/#core-cli), but the way the Dockerfile is implemented, there is no way to pass these arguments down to `validate-config`, so environment variables are currently the best way to set these values.
Example:
```bash
docker run --rm \
-e AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" \
-e AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" \
-e AWS_SESSION_TOKEN="$AWS_SESSION_TOKEN" \
-e PARTITION='aws-us-gov' \
--volume ./config:/lza/config lza-validator:v1.14.2
Contributor guide
Assessment
This issue has not been assessed yet.