AWS SAM - Attach an already existing API gateway as a trigger to a lambda

Viewed 950

I have a lambda that is created by deploying an AWS SAM stack. Now I have mentioned in the Events section that the lambda is to be triggered by an API, but the issue being that this creates a new API, instead of re-using the existing one in the account.

I can not find much details on re-using an existing API, for this purpose. Any pointers are appreciated!


My code:

Resources:
 Lamdba:
  Type: AWS::Serverless::Function
  Properties:
   Handler: 'index.myLambda'
   Events:
    MyAPI:
     Type: Api
     Properties:
      Path: '/pushMessage'
      Method: post
1 Answers
Related