QuestionQ38

VerifiedTerraform configuration

You are developing a reusable Terraform configuration and want to add an optional billing_dept tag so that the Finance team can track team-specific resource spending.

Which of the following billing_dept variable declarations accomplishes this?

Explanation

Terraform makes an input variable optional when its default argument is set. An empty string provides a valid default tag value, allowing callers to omit billing_dept. The optional modifier applies to attributes in object type constraints, not to a top-level input variable declaration.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!