Skip to content

Avnishamzn/Saptob feature ddbstream lambda sfn cdk ts #2743

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

avnishamzn
Copy link

Issue #, if available:

Description of changes:

A CDK construct to automatically trigger AWS Step Functions workflows in response to changes in DynamoDB tables. The DynamoWorkflowTrigger construct bridges DynamoDB streams and Step Functions by allowing you to define event handlers that monitor specific changes in your DynamoDB tables and trigger workflows in response. It leverages Lambda functions to evaluate conditions and start Step Functions state machines with inputs derived from the DynamoDB events.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link
Contributor

@marcojahn marcojahn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @avnishamzn, TY for your PR. I made a few requests for changes. Please review & accept or update. Thank you

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be removed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be removed


# Amazon DynamoDB Stream to AWS Step Functions Trigger

This Pattern demonstrates how to automatically trigger AWS Step Functions workflows in response to changes in DynamoDB tables. `DynamoWorkflowTrigger` lets you connect DynamoDB and Step Functions by allowing you to define event handlers that monitor specific changes in your DynamoDB tables and trigger workflows in response. It leverages Lambda functions to evaluate conditions and start Step Functions state machines with inputs derived from the DynamoDB events.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This Pattern demonstrates how to automatically trigger AWS Step Functions workflows in response to changes in DynamoDB tables. `DynamoWorkflowTrigger` lets you connect DynamoDB and Step Functions by allowing you to define event handlers that monitor specific changes in your DynamoDB tables and trigger workflows in response. It leverages Lambda functions to evaluate conditions and start Step Functions state machines with inputs derived from the DynamoDB events.
This Pattern demonstrates how to automatically trigger AWS Step Functions workflows in response to changes in DynamoDB tables. The CDK construct `DynamoWorkflowTrigger` lets you connect DynamoDB and Step Functions by allowing you to define event handlers that monitor specific changes in your DynamoDB tables and trigger workflows in response. It leverages Lambda functions to evaluate conditions and start Step Functions state machines with inputs derived from the DynamoDB events.


This Pattern demonstrates how to automatically trigger AWS Step Functions workflows in response to changes in DynamoDB tables. `DynamoWorkflowTrigger` lets you connect DynamoDB and Step Functions by allowing you to define event handlers that monitor specific changes in your DynamoDB tables and trigger workflows in response. It leverages Lambda functions to evaluate conditions and start Step Functions state machines with inputs derived from the DynamoDB events.

Learn more about this pattern at Serverless Land Patterns: https://serverlessland.com/patterns/{}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Learn more about this pattern at Serverless Land Patterns: https://serverlessland.com/patterns/{}
Learn more about this pattern at Serverless Land Patterns: [https://serverlessland.com/patterns/ddbstream-lambda-sfn-cdk-ts](https://serverlessland.com/patterns/ddbstream-lambda-sfn-cdk-ts)

```
cd ddbstream-lambda-sfn-cdk-ts
```
3. (Optional) Update the environment settings in `app.ts` if you know exactly what Account and Region you want to deploy the stack to.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be removed/replaced with implementation in ./app.ts (see review comment there)


1. From the command line, use the following in the source folder
```bash
npx cdk destroy
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
npx cdk destroy
cdk destroy

code: Code.fromAsset(path.join(__dirname, '../lambda')),
handler: "index.handler",
runtime: Runtime.NODEJS_20_X,
memorySize: 2048,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think default (128MB) is suitable here so can be removed.
Otherwise pls check. I think 2048MB is oversized.

- For complex filtering, use Lambda event source filters


Here's a suggested testing section for the README:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be removed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be removed

"scripts": {
"build": "tsc",
"watch": "tsc -w",
"test": "jest",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be removed

@marcojahn
Copy link
Contributor

@avnishamzn please add an example-pattern.json file to your repository. Use the example json from here
https://github.com/aws-samples/serverless-patterns/tree/main/_pattern-model

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants