Terraform CLI and Provider Versions
Terraform v1.8.3
hashicorp/archive version 2.6.0
Terraform Configuration
data "archive_file" "create_tar" {
type = "tar.gz"
output_path = "mytar.tgz"
output_file_mode = 0644
source {
content = local_file.bundle_json.content
filename = local.bundle
}
source {
content = data.local_file.main_js.content
filename = local.main_js
}
}
Expected Behavior
Files inside tar should have correct file permissions and retain last modified timestamps.
Actual Behavior
If output_file_mode is set, random file perms and incorrect last modified timestamps are shown:
$ tar -xvf mytar.tgz
bundle.json
main.js
$ ls -l
total 32
--w----r-- 1 daniel users 83 Jan 1 1970 bundle.json
--w----r-- 1 daniel users 12746 Jan 1 1970 main.js
-rw-r--r-- 1 daniel users 3929 Sep 18 14:05 mytar.tgz
If no output_file_mode is set no file perms are set and incorrect last modified timestamps are shown:
$ tar -xvf mytar.tgz
bundle.json
main.js
$ ls -l
total 32
---------- 1 daniel users 83 Jan 1 1970 bundle.json
---------- 1 daniel users 12746 Jan 1 1970 main.js
-rw-r--r-- 1 daniel users 3922 Sep 18 14:03 mytar.tgz
Steps to Reproduce
terraform apply
How much impact is this issue causing?
High
Logs
No response
Additional Information
No response
Code of Conduct
Terraform CLI and Provider Versions
Terraform v1.8.3
hashicorp/archive version 2.6.0
Terraform Configuration
Expected Behavior
Files inside tar should have correct file permissions and retain last modified timestamps.
Actual Behavior
If
output_file_modeis set, random file perms and incorrect last modified timestamps are shown:If no
output_file_modeis set no file perms are set and incorrect last modified timestamps are shown:Steps to Reproduce
terraform applyHow much impact is this issue causing?
High
Logs
No response
Additional Information
No response
Code of Conduct