diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a4d7932..6ecbf45a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `module_verion`: data source: change relation from latest-module-version to module-version ([#181](https://github.com/Scalr/terraform-provider-scalr/pull/181)) +### Fixed + +- panic when creating workspace with empty var file value ([#191](https://github.com/Scalr/terraform-provider-scalr/pull/191)) + ## [1.0.0-rc38] - 2022-10-20 ### Added diff --git a/docs/resources/scalr_workspace.md b/docs/resources/scalr_workspace.md index daf2d389..7401393c 100644 --- a/docs/resources/scalr_workspace.md +++ b/docs/resources/scalr_workspace.md @@ -107,7 +107,7 @@ resource "scalr_workspace" "cli-driven" { * `execution-mode` - (Optional) Which execution mode to use. Valid values are `remote` and `local`. When set to `local`, the workspace will be used for state storage only. Defaults to `remote` (not set, backend default is used). * `terraform_version` - (Optional) The version of Terraform to use for this workspace. Defaults to the latest available version. * `working_directory` - (Optional) A relative path that Terraform will be run in. Defaults to the root of the repository `""`. -var_files` - (Optional) A list of paths to the `.tfvars` file(s) to be used as part of the workspace configuration. +* `var_files` - (Optional) A list of paths to the `.tfvars` file(s) to be used as part of the workspace configuration. * `run_operation_timeout` - (Optional) The number of minutes run operation can be executed before termination. Defaults to `0` (not set, backend default is used). * `module_version_id` - (Optional) The identifier of a module version in the format `modver-`. This attribute conflicts with `vcs_provider_id` and `vcs_repo` attributes. * `agent_pool_id` - (Optional) The identifier of an agent pool in the format `apool-`. diff --git a/scalr/resource_scalr_workspace.go b/scalr/resource_scalr_workspace.go index 6c2d5dd7..f8c9499a 100644 --- a/scalr/resource_scalr_workspace.go +++ b/scalr/resource_scalr_workspace.go @@ -88,7 +88,10 @@ func resourceScalrWorkspace() *schema.Resource { "var_files": { Type: schema.TypeList, Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.NoZeroValues, + }, }, "operations": {