You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We appear to be unable to depend on the output of this resource; we are trying to use this to generate a file from some content we pass in to create an AWS Lambda function. The Lambda resource is throwing errors that the file location does not exist on the disk, even after apparently data sourcing the local file resource:
│
│ on ../../modules/lambdacron/lambda_function.tf line 33, in resource "aws_lambda_function" "main":
│ 33: filebase64sha256(var.function_zip_base64 == null ? local.archive_path : data.local_file.archive[0].filename) :
│ ├────────────────
│ │ data.local_file.archive[0].filename is "./work/bjss-494849242700-eu-west-2-prod-granted-lambdacron-idp-sync/function.zip"
│ │ local.archive_path is "./work/bjss-494849242700-eu-west-2-prod-granted-lambdacron-idp-sync/function.zip"
│ │ var.function_zip_base64 is "UEsDBAoAAAAAAI97KFUQIvvVBQAAAAUAAAAIABwAaW5kZXguanNVVAkAAw78GWMO/BljdXgLAAEE6AMAAARkAAAAZXhpdApQSwECHgMKAAAAAACPeyhVECL71QUAAAAFAAAACAAYAAAAAAABAAAApIEAAAAAaW5kZXguanNVVAUAAw78GWN1eAsAAQToAwAABGQAAABQSwUGAAAAAAEAAQBOAAAARwAAAAAA"
│
│ Call to function "filebase64sha256" failed: open work/bjss-494849242700-eu-west-2-prod-granted-lambdacron-idp-sync/function.zip: no such file or directory.
╵
Proposal
Output an attribute of the generated file - the octal permissions perhaps, or a file hash - which would allow us to depend on the attribute without needing to duplicate the content of the file in the output.
How much impact is this issue causing?
Low
Additional Information
No response
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
Hi @jack-parsons-bjss 👋 Thank you for raising this. As @tristanmorgan mentions above, recent versions of the local_file data source and resource now include additional attributes containing hashes of file contents. This is the correct and expected method for getting those values. Built-in Terraform configuration functions, such as file handling ones, only operate during configuration parsing rather than participating in the graph.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Terraform CLI and Provider Versions
Use Cases or Problem Statement
We appear to be unable to depend on the output of this resource; we are trying to use this to generate a file from some content we pass in to create an AWS Lambda function. The Lambda resource is throwing errors that the file location does not exist on the disk, even after apparently data sourcing the local file resource:
Proposal
Output an attribute of the generated file - the octal permissions perhaps, or a file hash - which would allow us to depend on the attribute without needing to duplicate the content of the file in the output.
How much impact is this issue causing?
Low
Additional Information
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: