So as per the AWS documentaion
Instead of using Amazon Resource Names (ARNs) for Lambda function in event source mappings, you can use an alias ARN. This approach means that you don't need to update your event source mappings when you promote a new version or roll back to a previous version.
I have AWS lambda function pets
and i have created 2 aliases dev
and prod
pointing to different versions of lambda function.
Then in API Gateway i am using this lambda function in Integration Request
. I have two stages of API, development
and production
. I want development
API stage point to dev
Lambda alias ARN and production
needs to point to prod
alias.
When i select lambda function as Integration Type
then drop down list shows whatever display name i have given earlier while creating lambda function..
I am not finding any stage specific configuration for lambda function. Based on my research on SO i have to follow these steps to deploy development
stage pointing to dev
alias
1> Go to Integration Request
2> Select Lambda function and change it to pets:dev
3> Deploy to development
stage
Follow the same steps for production
by changing Lambda function to pets:prod
before deployment.
This is going to be maintenance nightmare as our lambda function grows. Is there any easier way to do it?