I am using AWS Lambda to resize my image in s3 bucket into different size variants using node js when an image is put into the s3 bucket.
It was working till yesterd
It seems like your Lambda function has no access to your S3 bucket. Make sure that your function has an according IAM policy applied, e.g.:
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:PutObject"
],
"Resource": [
"arn:aws:s3:::*"
]
}]
}
Although your problem has nothing to do with graphicsmagick, please note that AWS Lambda only comes with imagemagick installed. So unless you provide the graphicsmagick executables yourself make sure to use the imagemagic sub class:
var gm = require("gm").subClass({ imageMagick: true });