Answer is correct : True
"The expressions in local values are not limited to literal constants; they can also reference other values in the module in order to transform or combine them, including variables, resource attributes, or other local values:"
https://www.terraform.io/language/values/locals#declaring-a-local-value
A
locals {
# Ids for multiple sets of EC2 instances, merged together
instance_ids = concat(aws_instance.blue.*.id, aws_instance.green.*.id)
}
locals {
# Common tags to be assigned to all resources
common_tags = {
Service = local.service_name
Owner = local.owner
}
}
A. True.
A Terraform local value can reference other Terraform local values. Local values in Terraform are used to create intermediate values that can be used to simplify complex expressions or avoid duplicating values in the code. They can reference other resources and values within the Terraform configuration.
True; Terraform local values can reference other Terraform local values. This is useful for sharing common values between resources, such as defining a common name or set of tags. When referencing other local values, Terraform will automatically look for the referenced value and substitute it in the configuration. This helps avoid repetition and makes Terraform configurations easier to maintain.
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Eltooth
Highly Voted 2 years, 4 months agoMolly1994
Most Recent 5 months, 2 weeks agoilmi70
9 months agodebabrata6983
1 year, 2 months agoRagque
1 year, 3 months agocamps
1 year, 7 months agoAbuu
1 year, 9 months agoeduvar4
2 years, 1 month ago