I have create a Lambda authorizor method (token based), with custom vpc and integrated with another lambda for api gateway authorization, when the authorization succeeds and when it wents to the destination lambda the path parameters and query parameters in event are coming as null.
in serverless.yml file authorizor function
authorizer:
handler: authorizerHandler.verifyUser
vpc: ${customvpc}
in serverless.yml file normal lambda
user:
handler: user.router
vpc: ${customvpc}
integration:lambda
events:
- http:
path:api/v1/user/{id}
cors: true
when user authorized, i am passing returning the object as
{
"principalId": "yyyyyyyy", // The principal user identification associated with the token sent by the client.
"policyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Action": "execute-api:Invoke",
"Effect": "Allow|Deny",
"Resource": "arn:aws:execute-api:{regionId}:{accountId}:{apiId}/{stage}/{httpVerb}/[{resource}/[{child-resources}]]"
}
]
}
}
but when i tried to use the id in event.pathParameter it is returning null, the same goes with queryStringParameters. any one can help?
thanks in advance :-)
I think you need to use curly braces {id} instead of colons :id
user:
handler: user.router
vpc: ${customvpc}
integration:lambda
events:
- http:
path:api/v1/user/{id}
cors: true
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With