Skip to content

Commit

Permalink
improvement(terraform): stricter validation and better error messages
Browse files Browse the repository at this point in the history
Print the list of available Terraform versions if validation fails.
  • Loading branch information
vvagaytsev committed Sep 29, 2022
1 parent 0a6b173 commit 351bfb8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/reference/providers/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ A map of variables to use when applying Terraform stacks. You can define these h

The version of Terraform to use. Set to `null` to use whichever version of `terraform` that is on your PATH.

| Type | Default | Required |
| -------- | --------- | -------- |
| `string` | `"1.2.9"` | No |
| Type | Allowed Values | Default | Required |
| -------- | ----------------------------------------------------- | --------- | -------- |
| `string` | "0.12.26", "0.13.3", "0.14.7", "1.0.5", "1.2.9", null | `"1.2.9"` | Yes |

### `providers[].workspace`

Expand Down
1 change: 1 addition & 0 deletions plugins/terraform/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const configSchema = providerConfigBaseSchema()
version: joi
.string()
.allow(...supportedVersions, null)
.only()
.default(defaultTerraformVersion).description(dedent`
The version of Terraform to use. Set to \`null\` to use whichever version of \`terraform\` that is on your PATH.
`),
Expand Down

0 comments on commit 351bfb8

Please sign in to comment.