github.com/hashicorp/packer@v1.14.3/command/test-fixtures/hcl2_upgrade/escaping/expected.pkr.hcl (about)

     1  
     2  variable "conf" {
     3    type    = string
     4    default = "${env("ONE")}-${env("ANOTHER")}-${env("BACKTICKED")}"
     5  }
     6  
     7  variable "manyspaces" {
     8    type    = string
     9    default = "${env("ASDFASDF")}"
    10  }
    11  
    12  variable "nospaces" {
    13    type    = string
    14    default = "${env("SOMETHING")}"
    15  }
    16  
    17  locals { timestamp = regex_replace(timestamp(), "[- TZ:]", "") }
    18  # The "legacy_isotime" function has been provided for backwards compatability, but we recommend switching to the timestamp and formatdate functions.
    19  
    20  source "null" "autogenerated_1" {
    21    communicator = "none"
    22  }
    23  
    24  build {
    25    sources = ["source.null.autogenerated_1"]
    26  
    27    provisioner "shell-local" {
    28      inline = ["echo ${var.conf}-${local.timestamp}-${legacy_isotime("01-02-2006")}"]
    29    }
    30  
    31  
    32    # 1 error occurred upgrading the following block:
    33    # unhandled "split" call:
    34    # there is no way to automatically upgrade the "split" call.
    35    # Please manually upgrade to `split(separator, string)`
    36    # Visit https://www.packer.io/docs/templates/hcl_templates/functions/string/split for more infos.
    37    provisioner "shell-local" {
    38      inline = ["echo {{ split `some-string` `-` 0 }}"]
    39    }
    40  
    41  }