You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi.
I am using variables in the variable.tf file and trying to read the data of it. But even if I leave the variable without a default value, when "terraform plan" command is running, It has a value and seems not using of variables.tf file. what is the problem? I will appreciate. variables.tf file:
variable "ami_id" {}
variable "instance_type" {}
Hi. I am using variables in the variable.tf file and trying to read the data of it. But even if I leave the variable without a default value, when "terraform plan" command is running, It has a value and seems not using of variables.tf file. what is the problem? I will appreciate. variables.tf file: variable "ami_id" {} variable "instance_type" {}
you shouldn't hardcode value amount in variables.tf . you leave value empty there
then set value in terraform.tfvars variables.tf file:
variable "ami_id" {}
variable "instance_type" {}
Hi.
I am using variables in the variable.tf file and trying to read the data of it. But even if I leave the variable without a default value, when "terraform plan" command is running, It has a value and seems not using of variables.tf file. what is the problem? I will appreciate.
variables.tf file:
variable "ami_id" {}
variable "instance_type" {}
main.tf file:
resource "aws_instance" "Sahar" {
ami = var.ami_id
instance_type = var.instance_type
terraform apply result:
aws_instance.Sahar will be created
The text was updated successfully, but these errors were encountered: