Skip to content

coder_parameter doesn't support monotonic for option values #11579

Closed
@mattlqx

Description

@mattlqx

Would it be possible to support monotonic validation on parameters that use options that have numeric values?

I have a 3 volume size options on my template. Sizes can't be effectively reduced. It would be nice if the setting could be validated so that selecting a smaller one than current would fail validation. e.g.

data "coder_parameter" "home_volume_size" {
  name        = "Home Volume Size"
  description = <<-EOF
  How large should your home volume be?
  EOF
  default     = "300"
  mutable     = true
  order       = 3

  option {
    name  = "300 GB (Default)"
    value = "300"
  }

  option {
    name  = "600 GB"
    value = "600"
  }

  option {
    name  = "1 TB"
    value = "1000"
  }
}

I would like it to also support the block:

validation {
  monotonic = "increasing"
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions