terraform using a part of a variable code example
Example: terraform define variable
variable "image_id" {
type = string
description = "The id of the machine image (AMI) to use for the server."
}
resource "some_resource" "resource_name" {
image = var.image_id
}