terraform-provider-archive
terraform-provider-archive copied to clipboard
source_dir zips folder contents rather than folder
Terraform Version
v0.14.8
Affected Data
- archive_file
Terraform Configuration Files
// Zips the mappings folder into mappings.zip
data "archive_file" "lib" {
type = "zip"
source_file = "${path.module}/folder"
output_path = "${path.module}/folder.zip"
}
Expected Behavior
folder.zip deflates to folder
$ unzip folder.zip
$ tree
.
└── folder
Actual Behavior
folder.zip deflates to the contents of folder not the folder itself
$ unzip folder.zip
$ tree
.
├── file1
└── file2
Steps to Reproduce
-
mkdir folder
-
touch folder/file{1,2}
-
terraform apply
-
unzip folder