variable terraform code example
Example 1: 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
}
Example 2: how many ways you can create the varible in terraform
terraform apply -var-file="assign.tfvars"