Schema validation: For unrecognized keys, show warnings or throw an error
- Dominant language
- Go
- Stars
- 1.4k
- Forks
- 175
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 134
Description
Have a question? Please checkout our [Slack Community](https://slack.cloudposse.com) or visit our [Slack Archive](https://archive.sweetops.com/).
[](https://slack.cloudposse.com)
## Describe the Feature
To the untrained eye, this may look good
```yaml
components:
terraform:
eks:
enabled: true
availability_zones: [ "us-east-2a" ]
```
However, atmos will gladly use this config and pass it along to terraform but will omit the vars because the `vars` key is not used above.
To prevent the above, atmos could look for keys like `settings`, `backend`, and `vars` after `components.terraform.xyz`. Since `enabled` doesn't match any of those, it would be nice if `atmos` threw an error or showed a warning to describe the unrecognized inputs.
## Describe Ideal Solution
```
Warning: unrecognized input `enabled` in `components.terraform.eks` in `stacks/catalog/eks.yaml`. Current location allows for the following keys: `settings`, `backend`, or `vars`.
```
or
```
Error: unrecognized input `enabled` in `components.terraform.eks` in `stacks/catalog/eks.yaml`. Current location allows for the following keys: `settings`, `backend`, or `vars`.
```
Contributor guide
Assessment
This issue has not been assessed yet.