packer/hcl2template/testdata/variables/foo-string.variable.pkr.hcl
Lucas Bajolet c0e7e7bd3c hcl2: report error on build without sources
When a template describes a build block without a source reference, the
build should be considered invalid as we won't have a CoreBuild produced
as a result of the need to have both.

In current versions of Packer, this will produce an error message
hinting that nothing will happen because of the lack of either build or
source block.

This commit takes the defined block, and points out to it as missing a
source block as being the reason why nothing is happening, making it
clearer what is required for an HCL2 build to be processed.
2022-09-30 15:39:27 -04:00

12 lines
148 B
HCL

variable "foo" {
type = string
default = "bar"
}
source "null" "test" {
communicator = "none"
}
build {
sources = ["null.test"]
}