You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 30, 2024. It is now read-only.
I have a situation where I have multiple lambda functions within our API Gateway's API.
I'm new to AWS and learning as much as I can.
I am wondering, how would I change the template yaml (sam.yaml) so that we can deploy to any number of lambda functions and not just one as is the case in this lab.
Would you create multiple index.js file per lambda function?
so index1.js -> will map to first lambda function
index2.js -> second lambda function;
etc....
And how do I update the sam.yaml file to reflect this change?
Here's a snippet code of what I'm trying to accomplish:
Resources:
HelloWorld:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs4.3
Role:
Fn::ImportValue:
!Join ['-', [!Ref 'ProjectId', !Ref 'AWS::Region', 'LambdaTrustRole']]
Events:
GetEvent:
Type: Api
Properties:
Path: /
Method: get
PostEvent:
Type: Api
Properties:
Path: /
Method: post
.... and more endpoints here to hit more lambda functions? So do I create multiple index.js to map to each individual lambda function?
icodealone, marexv, pwalvarado, hangingman, The-Edgar and 8 more