Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.



Question
In terraform, if you have some values that repeat all over the place in the configs and you want an easy way to set their value in one place you can use local values/variables. With that in mind write code to setup the following local values/variables in your *.tf file:

default_name_prefix = "${var.project_name}-web"
name_prefix = "something"
Answer
locals {
  default_name_prefix = "${var.project_name}-web"
  name_prefix         = "something"
}

^^ note the use of the locals block type (un-named block) to decalre and assign all the local variables.

^^^ note that these values can be accessed in the rest of the *.tf configs, using the local.* syntax (e.x. "${local.name_prefix}")


Question
In terraform, if you have some values that repeat all over the place in the configs and you want an easy way to set their value in one place you can use local values/variables. With that in mind write code to setup the following local values/variables in your *.tf file:

default_name_prefix = "${var.project_name}-web"
name_prefix = "something"
Answer
?

Question
In terraform, if you have some values that repeat all over the place in the configs and you want an easy way to set their value in one place you can use local values/variables. With that in mind write code to setup the following local values/variables in your *.tf file:

default_name_prefix = "${var.project_name}-web"
name_prefix = "something"
Answer
locals {
  default_name_prefix = "${var.project_name}-web"
  name_prefix         = "something"
}

^^ note the use of the locals block type (un-named block) to decalre and assign all the local variables.

^^^ note that these values can be accessed in the rest of the *.tf configs, using the local.* syntax (e.x. "${local.name_prefix}")


Summary

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Details

No repetitions


Discussion

Do you want to join discussion? Click here to log in or create user.