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 the following local values/variables are setup in your *.tf file:

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

How do you access these values in the rest of your *.tf config file, for example finish this code snippet:

resource "aws_s3_bucket" "files" {
  bucket = "[...OCCULSION IS HERE...]-files"
  # ...
}
Answer
resource "aws_s3_bucket" "files" {
  bucket = "${local.name_prefix}-files"
  # ...
}

^^ note the use of the "local" keyword

^^^ note the outer double quote enclosure to denote string value

^^^^ note the inner ${} enclosure to denote derived value.


Question

In terraform, if the following local values/variables are setup in your *.tf file:

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

How do you access these values in the rest of your *.tf config file, for example finish this code snippet:

resource "aws_s3_bucket" "files" {
  bucket = "[...OCCULSION IS HERE...]-files"
  # ...
}
Answer
?

Question

In terraform, if the following local values/variables are setup in your *.tf file:

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

How do you access these values in the rest of your *.tf config file, for example finish this code snippet:

resource "aws_s3_bucket" "files" {
  bucket = "[...OCCULSION IS HERE...]-files"
  # ...
}
Answer
resource "aws_s3_bucket" "files" {
  bucket = "${local.name_prefix}-files"
  # ...
}

^^ note the use of the "local" keyword

^^^ note the outer double quote enclosure to denote string value

^^^^ note the inner ${} enclosure to denote derived value.


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.