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

Error: in data "archive_file" "zip_file_for_lambda" #19

Open
salvadorcoronel opened this issue Nov 23, 2021 · 2 comments
Open

Error: in data "archive_file" "zip_file_for_lambda" #19

salvadorcoronel opened this issue Nov 23, 2021 · 2 comments

Comments

@salvadorcoronel
Copy link

salvadorcoronel commented Nov 23, 2021

terraform -version

Terraform v1.0.11
on darwin_amd64

  • provider registry.terraform.io/hashicorp/archive v2.2.0
  • provider registry.terraform.io/hashicorp/aws v3.66.0

I get this error when run this command:
terraform init
terraform apply

Error:
with module.redirect_externalurl_lambda.data.archive_file.zip_file_for_lambda, │ on .terraform/modules/redirect_externalurl_lambda/main.tf line 9, in data "archive_file" "zip_file_for_lambda": │ 9: data "archive_file" "zip_file_for_lambda" {

This is my main.tf file

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 3.65"
    }
  }

  required_version = ">= 0.14.9"
}

provider "aws" {
  profile = "default"
  region  = "us-east-1"
}

module "abcdef_lambda_edge_module" {
  source                 = "transcend-io/lambda-at-edge/aws"
  version                = "0.4.0"
  name                   = "abcdef_lambda_edge"
  description            = "Some description..."
  runtime                = "nodejs14.x"
  lambda_code_source_dir = "${path.module}"
  s3_artifact_bucket     = "abcdef.lambda.deploy"
}
@patryk-eco
Copy link

Same here. Unfortunately, the last commit was about half a year ago, so I don't think there will be immediate help.

Check out this blog post to build lambda@edge yourself, from the same authors as this module here: https://transcend.io/blog/lambda-edge-functions-in-terraform

@i-r-raccoon
Copy link

I also encountered this, but this was du to a misunderstanding how the variable lambda_code_source_dir works, or actually that there needs to be a certain structure.

If you check out variables.tf variable file_globs you might see what I mean.<br >
The module basically zips all files in lambda_code_source_dir that match the entries in file_globs. So you either rename your files accordingly or extend the file_globs in the module definition.

However, I'm not sure this module is actively cared for. There is a pull request pending for a while concerning the default runtime and deprecation warnings about the S3 resources are popping up.

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

3 participants