github.com/hashicorp/packer@v1.14.3/command/test-fixtures/hcl2_upgrade/complete-variables-with-template-engine/expected.pkr.hcl (about)

     1  
     2  variable "env_test" {
     3    type    = string
     4    default = "${env("TEST_ENV")}"
     5  }
     6  
     7  locals { timestamp = regex_replace(timestamp(), "[- TZ:]", "") }
     8  # The "legacy_isotime" function has been provided for backwards compatability, but we recommend switching to the timestamp and formatdate functions.
     9  
    10  # 5 errors occurred upgrading the following block:
    11  # unhandled "lower" call:
    12  # there is no way to automatically upgrade the "lower" call.
    13  # Please manually upgrade to `lower(var.example)`
    14  # Visit https://www.packer.io/docs/templates/hcl_templates/functions/string/lower for more infos.
    15  
    16  # unhandled "replace" call:
    17  # there is no way to automatically upgrade the "replace" call.
    18  # Please manually upgrade to `replace(string, substring, replacement)` or `regex_replace(string, substring, replacement)`
    19  # Visit https://www.packer.io/docs/templates/hcl_templates/functions/string/replace or https://www.packer.io/docs/templates/hcl_templates/functions/string/regex_replace for more infos.
    20  
    21  # unhandled "replace_all" call:
    22  # there is no way to automatically upgrade the "replace_all" call.
    23  # Please manually upgrade to `replace(string, substring, replacement)` or `regex_replace(string, substring, replacement)`
    24  # Visit https://www.packer.io/docs/templates/hcl_templates/functions/string/replace or https://www.packer.io/docs/templates/hcl_templates/functions/string/regex_replace for more infos.
    25  
    26  # unhandled "split" call:
    27  # there is no way to automatically upgrade the "split" call.
    28  # Please manually upgrade to `split(separator, string)`
    29  # Visit https://www.packer.io/docs/templates/hcl_templates/functions/string/split for more infos.
    30  
    31  # unhandled "upper" call:
    32  # there is no way to automatically upgrade the "upper" call.
    33  # Please manually upgrade to `upper(var.example)`
    34  # Visit https://www.packer.io/docs/templates/hcl_templates/functions/string/upper for more infos.
    35  locals {
    36    build_timestamp = "${local.timestamp}"
    37    iso_datetime    = "${legacy_isotime("2006-01-02T15:04:05Z07:00")}"
    38    lower           = "{{ lower `HELLO` }}"
    39    pwd             = "${path.cwd}"
    40    replace         = "{{ replace `b` `c` `ababa` 2 }}"
    41    replace_all     = "{{ replace_all `b` `c` `ababa` }}"
    42    split           = "{{ split `aba` `b` 1 }}"
    43    temp_directory  = "${path.root}"
    44    upper           = "{{ upper `hello` }}"
    45    uuid            = "${uuidv4()}"
    46  }
    47  
    48  source "null" "autogenerated_1" {
    49    communicator = "none"
    50  }
    51  
    52  build {
    53    sources = ["source.null.autogenerated_1"]
    54  
    55    provisioner "shell-local" {
    56      inline = ["echo ${local.build_timestamp}", "echo ${local.temp_directory}", "echo ${local.iso_datetime}", "echo ${local.uuid}", "echo ${var.env_test}", "echo ${local.lower}", "echo ${local.upper}", "echo ${local.pwd}", "echo ${local.replace}", "echo ${local.replace_all}", "echo ${local.split}"]
    57    }
    58  
    59  }