terraform providor / lambdas created incorrectly
skaminski23 opened this issue · 1 comments
In the Terraform Provider, you are creating a package, however said package is not creating the file as other readable. This results in the function being unable to execute and spewing out an error message from the Lambda function:
START RequestId: x-x-x-x Version: $LATEST
module initialization error: [Errno 13] Permission denied: '/var/task/es-cleanup.py'
As per docs here, The file needs to be world readable as per the requirements:
https://docs.aws.amazon.com/lambda/latest/dg/deployment-package-v2.html
Further to this, this is actually a bug either with the data provider or lambda uploader in terraform:
hashicorp/terraform-provider-aws#3918
Zip info confirming permissions issue with world readable file:
$zipinfo es-cleanup.zip
Archive: es-cleanup.zip
Zip file size: 2346 bytes, number of entries: 1
-rwxrwx--- 2.0 unx 6485 bl defN 49-Jan-01 00:00 es-cleanup.py
1 file, 6485 bytes uncompressed, 2206 bytes compressed: 66.0%
Hi @skaminski23 I cannot reproduce this error.
can you provide me some additional info? like from which platform are you executing the terraform command, OS, terraform version etc...
using these providers everything works fine:
* provider.archive: version = "~> 1.2"
* provider.aws: version = "~> 2.12"
* provider.null: version = "~> 2.1"