»The locals block

The locals block, also called the local-variable block, defines locals within your Packer configuration.

# locals.pkr.hcl
locals {
    # locals can be bare values like:
    wee = local.baz
    # locals can also be set with other variables :
    baz = "Foo is '${var.foo}' but not '${local.wee}'"
}

»More on variables