Amox Cillin
Amox Cillin

Reputation: 53

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?

Upvotes: 0

Views: 835

Answers (2)

Ervin Szilagyi
Ervin Szilagyi

Reputation: 16775

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

Upvotes: 0

Abdul Moeez
Abdul Moeez

Reputation: 1401

As I know the way that might be useful for you as well, Which is as follows.

  • Open AWS Console, Search the DynamoDB service, and open it.
  • Click your table and click on the triggers option.
  • Then you can see the lambda's which are linked with the stream. Click on the lambda you wanna change the version/alias. Then click on the edit/test trigger button.
  • You will redirect to the Lambda service page and where you can deploy your specific version of the lambda. Then stream will call that specific version of lambda.

enter image description here

Short Way:

  • Open AWS Console, Search lambda service, and open your lambda/function who is trigger with the stream.
  • Deploy the specific version as you need.

Hope that might be helpful for you!

Upvotes: 0

Related Questions