Search code examples
amazon-web-servicesaws-lambda

How to copy or duplicate an AWS Lambda function


I have an AWS Lambda function that is triggered from an API Gateway API. I want to duplicate this Lambda function including the triggers. How can I do this? I tried using "create version" but the API Gateway trigger is not duplicating and I am not able to change the code.


Solution

  • There is no provided function to copy/clone Lambda Functions and API Gateway configurations. You will need to create new a new function from scratch.

    If you envision having to duplicate functions in the future, it may be worthwhile to use AWS CloudFormation to create your Lambda Functions. You can then easily deploy more in future.