github.com/hashicorp/packer@v1.14.3/hcl2template/testdata/variables/basic.pkr.hcl (about)

     1  
     2  variables {
     3      key = "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 = ["us-west-1a"]
    21    description = <<POTATO
    22  Describing is awesome ;D
    23  POTATO
    24  }
    25  
    26  variable "super_secret_password" {
    27    type     = string
    28    sensitive = true
    29  description = <<IMSENSIBLE
    30  Handle with care plz
    31  IMSENSIBLE
    32    default = null
    33  }
    34  
    35  locals {
    36    service_name = "forum"
    37    owner        = "Community Team"
    38  }
    39  
    40  local "supersecret" {
    41    sensitive = true
    42    expression = "secretvar"
    43  }
    44  
    45  source "null" "test" {
    46    communicator = "none"
    47  }
    48  
    49  build {
    50    sources = ["null.test"]
    51  }