Complete the code to interpolate the variable 'name' inside the string.
output "greeting" { value = "Hello, ${var.[1]!" }
The variable 'name' is referenced as var.name inside the interpolation syntax ${}.
Complete the code to concatenate the variable 'region' with a string using interpolation.
resource "aws_instance" "example" { tags = { Name = "web-server-[1]" } }
To interpolate a variable in Terraform, use ${var.variable_name}. Here, ${var.region} correctly inserts the region value.
Fix the error in the interpolation syntax to correctly reference the 'environment' variable.
output "env_name" { value = "Current environment is ${var.[1]" }
The interpolation syntax must be closed properly with a closing brace }. The correct reference is ${var.environment}.
Fill both blanks to create a tag that combines 'app' and 'version' variables with a dash.
resource "aws_s3_bucket" "bucket" { tags = { Name = "${var.[1]-${var.[2]" } }
The tag combines the 'app' and 'version' variables separated by a dash. Both variables must be referenced with var. inside interpolation.
Fill all three blanks to create an output that shows the full resource ID with region and environment.
output "resource_id" { value = "arn:aws:ec2:${var.[1]:${var.[2]:instance/${var.[3]" }
The ARN format requires region, account ID, and instance ID. Each variable is referenced with var. inside interpolation.