Closed karelorigin closed 2 years ago
You can do this using the Terraform built-in function fileset
:
data "packer_files" "vm_image_files" {
file = "image.pkr.hcl"
file_dependencies = fileset(".", "assets/**")
}
Note that the file denoted by file
is already taken into account so you don't need to reference that one in file_dependencies
(although, you can).
Let me know if this solves your use case.
Actually, yes, I think that might solve it. Thank you! :D
You're welcome! :)
Is kind of the boilerplate for a simple image with one file dependency, but I have many files in subdirectories that require an image rebuild. Any chance that we can get an option for hashing directories (recursively)?