Search code examples
amazon-web-servicesaws-lambdaamazon-dynamodbamazon-dynamodb-streams

How to trigger a specific AWS Lambda version from AWS Dynamodb Streams


I have a dynamodb table that triggers a lambda function by enabling the Dynamodb streams. This was setup from the Dynamodb console. I would however like to be able to point the trigger to a specific version/alias of the lambda function. Most other AWS services allow you to specify the lambda ARN where you can tag on the version or alias at the end like arn:aws:lambda:::function::<version/alias> However when adding a trigger to the dynamodb table , it only allows you to select the lambda function name from a list and there seems to be no way to use a version/alias. There also does not seem to be a CLI/api command to do the same. Has anyone had any success doing this?


Solution

  • We can attach a different trigger to each alias we have for a Lambda function. In order to do this, we just have to go Lambda console, select our function, and create a new alias.

    After the alias is created, we will have the option to attach new triggers:

    enter image description here

    On this page we just have press + Add trigger button and we will have to search for DynamoDB. After we select DynamoDB, we are prompted to select our table for which we have the stream:

    enter image description here