Exam Terraform Associate All QuestionsBrowse all questions from this exam
Question 204

You want to tag multiple resources with a string that is a combination of a generated random_id and a variable.

How should you use the same value in all these resources without repeating the random_id and variable in each resource?

    Correct Answer: A

    To tag multiple resources with a string that combines a generated random_id and a variable without repeating the expression in each resource, you should use local values. Local values allow you to assign a name to an expression and reuse that name within the module, thereby ensuring consistency and reducing repetition.

Discussion
ArizonaClassicsOption: A

A is correct: Local values: A local value assigns a name to an expression, so you can use the name multiple times within a module instead of repeating the expression. https://developer.hashicorp.com/terraform/language/values/locals

campsOption: A

A. Local values

lezginoOption: A

A is correct

Darshan07Option: A

A is the correct option