humanmade / tachyon

Faster than light image resizing service that runs on AWS. Super simple to set up, highly available and very performant.

Home Page:https://engineering.hmn.md/projects/tachyon/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Trouble with `Invoke Error` and private S3 bucket

ironprogrammer opened this issue · comments

Hi,

I've set up private S3 buckets for the Tachyon source and storage (uploads), provisioned an EC2 instance with Node 10 to handle the Lambda execution environment requirements, installed the modules, zipped and sent to S3, and built out the CloudFormation stack without any apparent issues.

However, when testing the service, it 500s and I can't figure out where I went wrong:

2020-02-20T21:30:43.582Z	b45e3b76-4f85-4233-8eeb-b67d9eb16f6f	ERROR	Invoke Error	
{
    "errorType": "TypeError",
    "errorMessage": "Cannot read property 'params' of undefined",
    "stack": [
        "TypeError: Cannot read property 'params' of undefined",
        "    at makeRequest (/var/runtime/node_modules/aws-sdk/lib/service.js:188:21)",
        "    at Object.module.exports.s3 (/var/task/index.js:39:9)",
        "    at Runtime.exports.handler (/var/task/lambda-handler.js:13:17)",
        "    at Runtime.handleOnce (/var/runtime/Runtime.js:66:25)"
    ]
}

I've got PrivateS3Bucket set to true, and all public access blocked for the referenced UploadsS3Bucket. Looking at the IAM Role that the stack built out for the Lambda, it almost matches the documented policy here, with the exception that instead of the Resource ARN being the documented arn:aws:s3:::*, the stack built out arn:aws:s3:::tachyon-storage/*, which should be fine since I only have that one bucket -- but I updated the policy just in case, with no effect (as expected).

Does the above error ring any bells, or does anyone have ideas on what I could try next?

Thanks!

Using release lambda.zip instead of rolling my own.