Skip to content

Fabric Fast: why the distinction in the documentation of sometimes parsing in values to an optional default argument? #2662

Answered by juliocc
justinphebey asked this question in Q&A
Discussion options

You must be logged in to vote

I'm not sure what the question is but we generally prefer to use optional fields with default values for object-typed variables. This approach allows you to override individual fields without specifying values for every field.

For instance, consider this variable definition:

variable "locations" {
  description = "Optional locations for GCS, BigQuery, and logging buckets created here."
  type = object({
    bq      = string
    gcs     = string
    logging = string
    pubsub  = list(string)
  })
  nullable = false
  default  = {
    bq      = "EU"
    gcs     = "EU"
    logging = "global"
    pubsub  = []
  } 
}

In this case, changing only the gcs location requires specifying values for …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by justinphebey
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants