github.com/hashicorp/packer@v1.14.3/hcl2template/testdata/init/imports/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  }
    26  
    27  
    28  locals {
    29    standard_tags = {
    30      Component   = "user-service"
    31      Environment = "production"
    32    }
    33  
    34    abc_map = [
    35      {id = "a"},
    36      {id = "b"},
    37      {id = "c"},
    38    ]
    39  }