terraform-provider-archive icon indicating copy to clipboard operation
terraform-provider-archive copied to clipboard

source_dir zips folder contents rather than folder

Open joekendal opened this issue 3 years ago • 0 comments

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

  1. mkdir folder
  2. touch folder/file{1,2}
  3. terraform apply
  4. unzip folder

joekendal avatar Apr 28 '21 01:04 joekendal