* Allow locals to be delcared as individual blocks, and give them the Sensitive flag * add docs for new local block * linting * add tests * modified parsing to use schema, check for dupes properly * update comment fix wording a liiitle * add tests for duplicate variables definition in two different files * remove unnecessary slice initialisation * fix crash by returning when decode error is hit * parseLocalVariables: only treat a local vars if its not nil also return in case of error return locals in case of error too * fix duplicate_locals test for windows Co-authored-by: Adrien Delorme <azr@users.noreply.github.com>
44 lines
673 B
HCL
44 lines
673 B
HCL
|
|
variables {
|
|
key = "value"
|
|
my_secret = "foo"
|
|
image_name = "foo-image-{{user `my_secret`}}"
|
|
}
|
|
|
|
variable "image_id" {
|
|
type = string
|
|
default = "image-id-default"
|
|
}
|
|
|
|
variable "port" {
|
|
type = number
|
|
default = 42
|
|
}
|
|
|
|
variable "availability_zone_names" {
|
|
type = list(string)
|
|
default = ["us-west-1a"]
|
|
description = <<POTATO
|
|
Describing is awesome ;D
|
|
POTATO
|
|
}
|
|
|
|
variable "super_secret_password" {
|
|
type = string
|
|
sensitive = true
|
|
description = <<IMSENSIBLE
|
|
Handle with care plz
|
|
IMSENSIBLE
|
|
default = null
|
|
}
|
|
|
|
locals {
|
|
service_name = "forum"
|
|
owner = "Community Team"
|
|
}
|
|
|
|
local "supersecret" {
|
|
sensitive = true
|
|
expression = "secretvar"
|
|
}
|