serverless-framework

requestParameters returning “Invalid mapping expression specified: true”

时光总嘲笑我的痴心妄想 提交于 2020-02-03 08:28:54
问题 I'm configuring a lambda function's API gateway integration with the Serverless Framework version 0.4.2. My problem is with defining an endpoint's request parameters. The AWS docs for API gateway entry says: requestParameters Represents request parameters that can be accepted by Amazon API Gateway. Request parameters are represented as a key/value map, with a source as the key and a Boolean flag as the value. The Boolean flag is used to specify whether the parameter is required. A source must

How do I grant a rotation Lambda access to AWS Secrets Manager

非 Y 不嫁゛ 提交于 2020-01-24 13:04:06
问题 Using the serverless framework, I am trying to build a Lambda function that periodically rotates a secret stored in AWS Secrets Manager. I am having trouble configuring the roles needed for the Secret Manager to execute the Lambda. In my serverless.yml I have defined the following resources: resources: Resources: RotateKeysRole: Type: AWS::IAM::Role Properties: RoleName: rotate-keys-role ManagedPolicyArns: - arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole

AWS Lambda and IAM error on deploy: The role defined for the function cannot be assumed by Lambda

爱⌒轻易说出口 提交于 2020-01-23 13:24:48
问题 In my AWS project, I use the serverless framework to deploy lambda function and IAM roles. So I created 6 lambda functions, all using the same IAM Role below: functions: auto-delete-identity: handler: src/auto-delete-identity.handler role: arn:aws:iam::123456789012:role/lambdaIAMRole name: auto-delete-identity auto-move-to-user-group: handler: src/auto-move-to-user-group.handler role: arn:aws:iam::123456789012:role/lambdaIAMRole name: auto-move-to-user-group auto-validate-user-creation:

AWS Lambda and IAM error on deploy: The role defined for the function cannot be assumed by Lambda

青春壹個敷衍的年華 提交于 2020-01-23 13:23:45
问题 In my AWS project, I use the serverless framework to deploy lambda function and IAM roles. So I created 6 lambda functions, all using the same IAM Role below: functions: auto-delete-identity: handler: src/auto-delete-identity.handler role: arn:aws:iam::123456789012:role/lambdaIAMRole name: auto-delete-identity auto-move-to-user-group: handler: src/auto-move-to-user-group.handler role: arn:aws:iam::123456789012:role/lambdaIAMRole name: auto-move-to-user-group auto-validate-user-creation:

Use path params in serverless framework 1.0

岁酱吖の 提交于 2020-01-23 05:35:12
问题 I want to use the path param /customer/{customerId} of a GET request in order to query a customer using AWS Lambda: functions: createCustomer: handler: handler.createCustomer events: - http: path: customer method: post readCustomer: handler: handler.readCustomer events: - http: path: customer method: get How do I have to define the path param in order to pass it to my AWS Lambda function using serverless framework 1.0 ? 回答1: Define in serverless.yml readCustomer: handler: handler.readCustomer

How can I bypass the 10MB limit of AWS API gateway and POST large files to AWS lambda?

自古美人都是妖i 提交于 2020-01-22 00:43:34
问题 what I want An API which takes file and some parameters using POST and gives back a JSON response. curl -X POST www.endpoint.com \ -F file=@/myfile.txt \ -F foo=bar # other params I have this working with Lambda + API gateway using binary data but 10MB limit is the issue. I have considered a POST API which uploads file to S3. The event generated is then read by Lambda. But for this I have few questions- Where will my other parameters go? How will Lambda return back the response? 回答1: Your use

How can I bypass the 10MB limit of AWS API gateway and POST large files to AWS lambda?

只谈情不闲聊 提交于 2020-01-22 00:42:30
问题 what I want An API which takes file and some parameters using POST and gives back a JSON response. curl -X POST www.endpoint.com \ -F file=@/myfile.txt \ -F foo=bar # other params I have this working with Lambda + API gateway using binary data but 10MB limit is the issue. I have considered a POST API which uploads file to S3. The event generated is then read by Lambda. But for this I have few questions- Where will my other parameters go? How will Lambda return back the response? 回答1: Your use

Why is my Lambda unable to access the internet?

时光怂恿深爱的人放手 提交于 2020-01-15 17:51:25
问题 I have a Lambda function which can be triggered from an API gateway or ALB request. I also have an RDS Aurora PostgreSQL instance, both of which are running within a VPC. I'm able to connect to the RDS instance from the Lambda just fine, however I can't access the internet, e.g. attempting to fire off a request to https://jsonplaceholder.typicode.com/todos/1 will cause a timeout. I also can't connect to the remote database using a SQL client such as DBeaver. Here's some detail below but let

Why is my Lambda unable to access the internet?

守給你的承諾、 提交于 2020-01-15 17:51:16
问题 I have a Lambda function which can be triggered from an API gateway or ALB request. I also have an RDS Aurora PostgreSQL instance, both of which are running within a VPC. I'm able to connect to the RDS instance from the Lambda just fine, however I can't access the internet, e.g. attempting to fire off a request to https://jsonplaceholder.typicode.com/todos/1 will cause a timeout. I also can't connect to the remote database using a SQL client such as DBeaver. Here's some detail below but let

Serverless Framework Login From Behind a Proxy?

时光总嘲笑我的痴心妄想 提交于 2020-01-15 11:18:53
问题 I am trying to use the serverless framework from behind a proxy. I was able to install the framework after configuring npm to use my certs file: npm config set cafile C:\path\to\certs.pem npm install serverless --global However, when I try to login to serverless I get the following error: serverless login Fetch Error -------------------------------------------- FetchError: request to https://api.serverless.com/core/tokens failed, reason: unable to get local issuer certificate at ClientRequest