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

Terraform Archive Error #106

Open
niraj06 opened this issue Jul 7, 2021 · 0 comments
Open

Terraform Archive Error #106

niraj06 opened this issue Jul 7, 2021 · 0 comments

Comments

@niraj06
Copy link

niraj06 commented Jul 7, 2021

Hi

I am getting below error when trying archive and upload google cloud storage.

Failed to read source file "data.archive_file.main.output_path". Cannot compute md5 hash for it.: timestamp=2021-07-07T15:28:12.440Z
2021-07-07T15:28:12.442Z [WARN] Provider "registry.terraform.io/hashicorp/google" produced an invalid plan for google_storage_bucket_object.archive, but we are tolerating it because it is using the legacy plugin SDK.
The following problems may be the cause of any confusing errors from downstream operations:
- .detect_md5hash: planned value cty.StringVal("different hash") for a non-computed attribute

data "archive_file" "main" {
type = "zip"
source_dir = pathexpand("../function/ce-analytics-npd-trainer")
output_path = pathexpand("/tmp/trainer-0.1.zip")
}

resource "google_storage_bucket_object" "archive" {
name = "${data.archive_file.main.output_md5}-${basename(data.archive_file.main.output_path)}"
bucket = google_storage_bucket.cloud_functions.name
source = "data.archive_file.main.output_path"
content_disposition = "attachment"
content_encoding = "gzip"
content_type = "application/zip"
}

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

1 participant