Skip to content
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

Terraform-Like Optional Attribute Support #13098

Open
sam-delap opened this issue Jul 3, 2024 · 0 comments
Open

Terraform-Like Optional Attribute Support #13098

sam-delap opened this issue Jul 3, 2024 · 0 comments

Comments

@sam-delap
Copy link

sam-delap commented Jul 3, 2024

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

A similar optional() keyword to Terraform (Note: I know this has been brought up previously in #12182, there's just not a commmunity-visible place where this is being tracked to my knowledge).

Use Case(s)

Any use case where it would be useful to make a field within a Packer object optional to configure and provide per-field defaults

Potential configuration

variable "some-object" {
    type = object({
        some-field = optional(string, 'some-value')
        required-field = bool
    })
}

Potential References

https://developer.hashicorp.com/terraform/language/expressions/type-constraints#optional-object-type-attributes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants