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, 3 months agovitasac
Highly Voted 3 years, 3 months agoonewikigold
Most Recent 2 weeks, 1 day agokanika_sk
9 months agokanikachander
1 year agoCololand
1 year, 3 months agoenook
1 year, 7 months agoghostGuiggs
1 year, 9 months agoKizerfor
1 year, 11 months agoBere
2 years agoShane_C
2 years, 1 month agoNi33
2 years, 3 months agoBluemoon22
2 years, 3 months agoPower123
2 years, 4 months agothor7
2 years, 4 months agoPower123
2 years, 4 months agokartikjena31
2 years, 7 months ago