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