In Terraform, variables are referred to using the syntax var.<variable_name>. Here, var is a special namespace that contains all input variables.
For example, if you have a variable named num_servers in your configuration and you want to pass it to a module, you would do it like this:
variable "num_servers" {
description = "The number of servers to create"
default = 5
}
module "server_module" {
source = "app.terraform.io/example/server"
version = "1.0.0"
servers = var.num_servers
}
In the above example, the input variable num_servers is defined with a default value of 5. Then, the server_module is being called and the servers argument is being set to the value of var.num_servers, which is 5.
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.
tipzzz
Highly Voted 3 years, 2 months agovitasac
Highly Voted 3 years, 1 month agokanika_sk
Most Recent 7 months, 1 week agokanikachander
10 months, 4 weeks agoCololand
1 year, 1 month agoenook
1 year, 5 months agoghostGuiggs
1 year, 7 months agoKizerfor
1 year, 10 months agoBere
1 year, 11 months agoShane_C
1 year, 11 months agoNi33
2 years, 1 month agoBluemoon22
2 years, 2 months agoPower123
2 years, 2 months agothor7
2 years, 3 months agoPower123
2 years, 3 months agokartikjena31
2 years, 5 months agolalgebala
2 years, 7 months ago