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

Cannot deploy - .next-tf/lambdas\__NEXT_PAGE_LAMBDA_0.zip: no such file or directory #374

Closed
C0D3-BL00D3D opened this issue Nov 7, 2022 · 1 comment

Comments

@C0D3-BL00D3D
Copy link

C0D3-BL00D3D commented Nov 7, 2022

I'm trying to deploy using Terraform Cloud (just discovered Windows isn't supported) but I'm getting this error:

Error: Error in function call

on .terraform/modules/tf_next/main.tf line 67, in resource "aws_lambda_function" "this":
67: source_code_hash = filebase64sha256("${local.config_dir}/${lookup(each.value, "filename", "")}")
├────────────────
│ while calling filebase64sha256(path)
│ each.value is object with 4 attributes
│ local.config_dir is "./.next-tf"

Call to function "filebase64sha256" failed: open
.next-tf/lambdas\__NEXT_PAGE_LAMBDA_0.zip: no such file or directory.

The .next-tf folder is in the root of my project, and its lambdas subfolder does have __NEXT_PAGE_LAMBDA_0.zip.

I get this error whether I include !**/.next-tf/** in my .terraformignore or not.

The README says I should “upload the build output from the tf-next task”, but this instruction is unclear to me. I don't see where I can upload anything on Terraform Cloud.

I'm not using basePath, but I am using baseUrl, not sure if this matters.

Any guidance would be appreciated.

Local: Terraform v1.3.4 on windows_amd64
Terraform Cloud: Terraform v1.3.4 on linux_amd64
tf-next: ^0.13.2

@C0D3-BL00D3D C0D3-BL00D3D changed the title .next-tf/lambdas\__NEXT_PAGE_LAMBDA_0.zip: no such file or directory Cannot deploy - .next-tf/lambdas\__NEXT_PAGE_LAMBDA_0.zip: no such file or directory Nov 8, 2022
@C0D3-BL00D3D
Copy link
Author

filename for __NEXT_PAGE_LAMBDA_0 in .next-tf/lambdas/config.json was "lambdas\__NEXT_PAGE_LAMBDA_0.zip". The \ was causing the issue.

Manually changing filename to "lambdas/__NEXT_PAGE_LAMBDA_0.zip" fixed it.

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