github.com/hashicorp/packer@v1.14.3/hcl2template/testdata/complete/variables.pkr.hcl (about) 1 2 variables { 3 foo = "value" 4 // my_secret = "foo" 5 // image_name = "foo-image-{{user `my_secret`}}" 6 } 7 8 variable "image_id" { 9 type = string 10 default = "image-id-default" 11 } 12 13 variable "port" { 14 type = number 15 default = 42 16 } 17 18 variable "availability_zone_names" { 19 type = list(string) 20 default = ["A", "B", "C"] 21 } 22 23 locals { 24 feefoo = "${var.foo}_${var.image_id}" 25 data_source = data.amazon-ami.test.string 26 } 27 28 29 locals { 30 standard_tags = { 31 Component = "user-service" 32 Environment = "production" 33 } 34 35 abc_map = [ 36 {id = "a"}, 37 {id = "b"}, 38 {id = "c"}, 39 ] 40 } 41 42 local "supersecret" { 43 expression = "${var.image_id}-password" 44 sensitive = true 45 }