Skip to content

Support optional object type attributes in Nomad HCL variables #25317

Open
@atavakoliyext

Description

@atavakoliyext

Proposal

Support optional(...) in object type attributes, similar to the equivalent feature from Terraform

Use-cases

Variables that use complex types (e.g. list(object({ ... })), where some fields are optional, currently have to be specified in full, or have to be defined as maps where the burden of type validation falls on the template author.

Attempted Solutions

  • Using a type = map(string) and checking each field for existence/type-correctness
  • Using a type = string, setting the value to some structured data format, like JSON or YAML, which is then (yaml|json)decoded and its contents' fields checked for existence/type-correctness

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Needs Roadmapping

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions