cloudposse / cloudposse/atmos

Schema validation: For unrecognized keys, show warnings or throw an error

Open
#83 0 comments 0 reactions 0 assignees View on GitHub
enhancement
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/).

[![Slack Community](https://slack.cloudposse.com/badge.svg)](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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.