🔥 3-day streak
HashiCorp Certified: Terraform Associate (004)144 / 150
Question 144 of 150
You are writing a module that reads an optional nested attribute from a variable named var.config, which may or may not contain a 'network' key with a 'subnet_id' sub-key. If the attribute path does not exist, evaluating it directly would raise an error. You want the local value to fall back to the string "default-subnet" whenever the lookup fails. Which expression should you use in the locals block?
Reviewed for accuracy · Report an issueNext question