Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

archive_file changes file timestamps #30

Open
ghost opened this issue Aug 31, 2018 · 2 comments
Open

archive_file changes file timestamps #30

ghost opened this issue Aug 31, 2018 · 2 comments

Comments

@ghost
Copy link

ghost commented Aug 31, 2018

This issue was originally opened by @rahulinux as hashicorp/terraform#18765. It was migrated here as a result of the provider split. The original body of the issue is below.


Hi there,

When using archive_file, file timestamp set to 00-00-1980. I would really
like to use Terraform to zip files but preserve the same permission but I can't.

Tested with Terraform v0.11.8

@haidangwa
Copy link

haidangwa commented Jan 9, 2019

From what I'm seeing, when I run terraform plan, archive_file will update the timestamp on the resulting zip file; however, it doesn't actually update the file contents. I verified this manually by running my own checksum comparisons, and each time, the manual checksums are identical. Only the timestamp on the zip file is updated.

Diving deeper, I think this is merely a cosmetic issue, as the file's created date doesn't appear to be changed; only the modified date is getting changed on every plan, which indicates to me that terraform is touching the file every run.

$ GetFileInfo lambda_function_payload.zip 
file: "/*********/lambda-chef-node-cleanup/terraform/lambda_function_payload.zip"
type: "\0\0\0\0"
creator: "\0\0\0\0"
attributes: avbstclinmedz
created: 01/08/2019 21:56:25
modified: 01/09/2019 13:53:06

I'm using terraform v0.11.7 and terraform-provider-archive_v1.1.0_x4 at the moment.

@dinvlad
Copy link

dinvlad commented Apr 23, 2020

Would it be possible to reset the zip file timestamp? Otherwise, we obtain a different md5 on it on every run, even though the contents (incl. the timestamps of the files inside the zip) don't change.

EDIT: Upon further analysis, the difference in my case was not due to the timestamp, but rather due to a file attribute difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants