Skip to content

rich parameters: cannot specify default value with option blocks #6328

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bpmct opened this issue Feb 23, 2023 · 3 comments
Closed

rich parameters: cannot specify default value with option blocks #6328

bpmct opened this issue Feb 23, 2023 · 3 comments
Assignees

Comments

@bpmct
Copy link
Member

bpmct commented Feb 23, 2023

The following parameter does not work

data "coder_parameter" "region" {
  name        = "Region"
  icon        = "/icon/database.svg"
  description = "These are options."
  default     = "us-east1-a"
  option {
    name        = "US Central"
    description = "Select for central!"
    value       = "us-central1-a"
    icon        = "/icon/goland.svg"
  }
  option {
    name        = "US East"
    description = "Select for east!"
    value       = "us-east1-a"
    icon        = "/icon/folder.svg"
  }
  option {
    name        = "US West"
    description = "Select for west!"
    value       = "us-west2-a"
  }
}
"default": only one of `default,option` can be specified, but `default,option` were specified.
@bpmct
Copy link
Member Author

bpmct commented Feb 23, 2023

As a workaround, I just did an inline conditional to check if the region is empty

  region = data.coder_parameter.region.value != "" ? data.coder_parameter.region.value : "us-east1-a"

@mtojek
Copy link
Member

mtojek commented Feb 24, 2023

Hey @bpmct! I have merged all relevant PRs. Feel free to recheck if the problem still occurs, and if so, we can continue the investigation.

@matifali
Copy link
Member

Hey @bpmct! I have merged all relevant PRs. Feel free to recheck if the problem still occurs, and if so, we can continue the investigation.

I tested with 0.6.14 and it seems to be resolved.

@bpmct bpmct closed this as completed Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants