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?
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?
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.
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
A. Local values
A is correct
A is the correct option