Adding existing events to Lambda Function

I had created an aws schedule event which I has used in a lambda function some time ago. However I want to use the same event as trigger for another lambda function but I am unable to do via serverless.yml configuration. So when I add the below lines in my yml file and deploy I get a message saying event already exists. How do I attach the event trigger to my lambda function and not create a new event

      - schedule:
          name: half-an-hour
          description: 'This cron will run every 30 mins'
          rate: cron(0/30 * * * ? *)
          enabled: true

Welcome to the community Valentina!

Could you post a bit more, ideally all your function definitions in your serverless.yml? Also, would it be a problem for you to change the name of the event?

1 Like

Changing the name of the event would create a new event and it will be functional but I was wondering if we could reuse the same event for another lambda function.

You can if it is an asynchronous event trigger like SNS, SQS, etc. Its how I get many of my Lambda functions to all get triggered off of one trigger.

1 Like