aws-lambda

How to mount EFS on a Lambda function?

谁都会走 提交于 2020-06-27 07:00:18
问题 I need to run a periodic cleanup on my EFS drive (which is being shared by multiple autoscaling EC2 instances). The cleanup involves deleting files/folders that meet a certain criterion (date/size etc.). I imagined AWS Lambda to be the perfect solution for this task. Just trigger the function periodically, which should mount the Shared drive and run the cleanup. But it seems that Lambda only supports Creating/polling the disk for it's type and modifying its mountpoint etc. Is there any

Cannot load file mysql2 on AWS Lambda

五迷三道 提交于 2020-06-26 08:38:07
问题 Trying to have a Lambda connect to an RDS database but can't get the mysql2 gem to load. Tried the pristine instruction but that didn't resolve the issue. I've got the built mysql2 gem in the vendor directory. Did this using bundle install --deployment . Presumably this is a problem because of the compiled extensions used by mysql2. Not sure how I can sort this for AWS Lambda though. Thoughts? Here's the log output: START RequestId: 62f35c49-039f-11e9-be04-1fd1111df42b Version: $LATEST

Inaccessible DynamoDB host when running amplify mock

我是研究僧i 提交于 2020-06-26 06:32:09
问题 I am using AWS Amplify to set up an AppSync GraphQL API. I have a schema with an @model annotation and I am trying to write a lambda resolver that will read/write to the DynamoDB table that @model generates. However, when I attempt to test locally using amplify mock my JS function throws error { UnknownEndpoint: Inaccessible host: `dynamodb.us-east-1-fake.amazonaws.com'. This service may not be available in the `us-east-1-fake' region. I can't seem to find much documentation around this use

Reference function from within serverless.yml

感情迁移 提交于 2020-06-26 03:55:10
问题 I have several AWS lambdas running, supported by the Serverless Framework . I need one lambda (called lambdaOne ) which will call a second lambda (called lambdaTwo ) using AWS' javascript sdk. The issue is that I am getting an AccessDenied Exception when I attempt this: UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): AccessDeniedException: User: arn:aws:sts::12345678909876:assumed-role/test-dev-us-west-2-lambdaRole/test-dev-lambdaOne is not authorized to

The final policy size (20539) is bigger than the limit (20480)

眉间皱痕 提交于 2020-06-25 18:07:30
问题 I have a lambda function, I am creating triggers for aws lambda function, I created 54 triggers using rules , I have to create more triggers but when I am adding 1 more triggers , I am getting this error message The final policy size (20539) is bigger than the limit (20480) . How can I increase policy size? Policy size means the size of the json ? 回答1: I had the same issue. You can see the relevant file (that its size exceeded) by opening the lambda console and then navigate to Permissions

The final policy size (20539) is bigger than the limit (20480)

时光怂恿深爱的人放手 提交于 2020-06-25 18:07:19
问题 I have a lambda function, I am creating triggers for aws lambda function, I created 54 triggers using rules , I have to create more triggers but when I am adding 1 more triggers , I am getting this error message The final policy size (20539) is bigger than the limit (20480) . How can I increase policy size? Policy size means the size of the json ? 回答1: I had the same issue. You can see the relevant file (that its size exceeded) by opening the lambda console and then navigate to Permissions

Lambda function timeout on external call

心不动则不痛 提交于 2020-06-25 09:49:26
问题 I have a Lambda function from which I need to make an external API call. I have added the Lambda function to a security group, a VPC, and 2 subnets, and it gives me this text: When you enable VPC, your Lambda function will lose default internet access. If you require external internet access for your function, ensure that your security group allows outbound connections and that your VPC has a NAT gateway. I go into VPC, create a NAT gateway (I let AWS create a EIP), attach it to one of the

AWS Lambda SQS Trigger Throttle/Limit

…衆ロ難τιáo~ 提交于 2020-06-25 08:01:05
问题 I have an AWS SQS queue that I'm going to setup with a Lambda function trigger to run the Lambda function for every item that gets added to the queue to do some processing work. One step of processing is going to be hitting an API endpoint to get some data back for every item added to the queue, then storing that away in an DynamoDB table. In order to manage costs, and stay in control of this process I'm wanting to throttle the amount of times this Lambda function gets called in a certain

How to pass parameters to serverless invoke local

六眼飞鱼酱① 提交于 2020-06-24 10:54:57
问题 I'm working on a aws serverless project and need to test the lambda functions locally. I am using serverless invoke local -f {function_name} command to test the API calls that does not request any path or query parameters. My question is how can I use this command to pass any path or query parameter to the function? Example serverless description getFoodDetails: handler: handler.getFoodDetails events: - http: method: get path: /foods/{food_id} cors: true request: parameters: paths: food_id:

AWS lambda read zip file perform validation and unzip to s3 bucket if validation is passed

走远了吗. 提交于 2020-06-23 14:53:06
问题 I have a requirement in which a zip files arrives on s3 bucket, I need to write a lambda using python to read the zip file perform some validation and unzip on another S3 bucket. Zip file contains below: a.csv b.csv c.csv trigger_file.txt trigger_file.txt -- contain names of files in zip and record count (example: a.csv:120 , b.csv:10 , c.csv:50 ) So using lambda I need to read trigger file check if number files in zip folder is equal to number of files mentioned in trigger file if pass the