github.com/hashicorp/packer@v1.14.3/datasource/hcp-packer-version/test-fixtures/template.pkr.hcl (about)

     1  source "null" "example" {
     2    communicator = "none"
     3  }
     4  
     5  data "hcp-packer-version" "hardened-source" {
     6    bucket_name = "simple"
     7    channel_name = "latest"
     8  }
     9  
    10  data "hcp-packer-artifact" "file" {
    11    bucket_name = "simple"
    12    version_fingerprint = "${data.hcp-packer-version.hardened-source.fingerprint}"
    13    platform = "packer.file"
    14    region = %q
    15  }
    16  
    17  locals {
    18    foo              = "${data.hcp-packer-version.hardened-source.id}"
    19    bar              = "${data.hcp-packer-artifact.file.external_identifier}"
    20  }
    21  
    22  build {
    23    name = "mybuild"
    24    sources = [
    25      "source.null.example"
    26    ]
    27    provisioner "shell-local" {
    28      inline = [
    29        "echo data is ${local.foo}",
    30        "echo data is ${local.bar}"
    31      ]
    32    }
    33  }