-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
feat(stepfunctions-tasks): dynamodb tasks #6654
Conversation
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Could you enumerate the constructs and types for me, that would be used from the dynamodb construct library, had the cyclic dependency not occur? |
The only construct that I think I would be using from dynamodb would be the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments so far.
packages/@aws-cdk/aws-stepfunctions-tasks/test/integ.call-dynamodb.ts
Outdated
Show resolved
Hide resolved
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! This is starting to come together.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
* | ||
* @param attr Attribute name | ||
*/ | ||
public withAttribute(attr: string): DynamoProjectionExpression { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here around supporting tokens. Make sure this works correctly and a test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure how we would properly handle this scenario with tokens since we are doing string concatenation here.
For:
projectionExpression: [
new tasks.DynamoProjectionExpression()
.withAttribute('Messages')
.atIndex(1)
.withAttribute(sfn.Data.stringAt('$.tagsKey')),
new tasks.DynamoProjectionExpression().withAttribute(
sfn.Data.stringAt('$.idKey')
)
]
I am getting the following error:
Field references must be the entire string, cannot concatenate them (found 'Messages[1].${Token[tagsKey.19]},${Token[idKey.20]}')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Messages[1].${Token[tagsKey.19]},${Token[idKey.20]}'
This should be valid. Where is this error coming from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the complete stack trace of the above error
Field references must be the entire string, cannot concatenate them (found 'Messages[1].${Token[tagKey.21]},${Token[otherKey.22]}')
197 |
198 | if (jsonPathTokens.length > 0 && fragments.length > 1) {
> 199 | throw new Error(`Field references must be the entire string, cannot concatenate them (found '${x}')`);
| ^
200 | }
201 | if (jsonPathTokens.length > 0) {
202 | return jsonPathTokens[0].path;
at jsonPathString (../aws-stepfunctions/lib/json-path.ts:199:11)
at Object.renderString (../aws-stepfunctions/lib/json-path.ts:146:16)
at recurseObject (../aws-stepfunctions/lib/json-path.ts:90:35)
at Object.renderObject (../aws-stepfunctions/lib/json-path.ts:36:10)
at Function.renderObject (../aws-stepfunctions/lib/fields.ts:111:12)
at Task.toStateJson (../aws-stepfunctions/lib/states/task.ts:161:65)
at Object.<anonymous> (test/call-dynamodb.test.ts:251:29)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not entirely sure what's going on here. This is good enough for now.
This will hopefully get fixed up in a later PR.
What you have here is already going to benefit a ton of customers!
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great! Thanks for the awesome contribution @ayush987goyal.
* | ||
* @param attr Attribute name | ||
*/ | ||
public withAttribute(attr: string): DynamoProjectionExpression { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not entirely sure what's going on here. This is good enough for now.
This will hopefully get fixed up in a later PR.
What you have here is already going to benefit a ton of customers!
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
1 similar comment
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Description
Add implementation to call DynamoDB APIs from StepFunctions based on this doc.
Note:
tableName
asstring
instead.GetItem
)closes #6468
Commit Message
feat(stepfunctions-tasks): dynamodb tasks (#6654)
Support for DynamoDB as StepFunctions tasks. Supports GetItem,
PutItem, DeleteItem and UpdateItem tasks.
closes #6468
End Commit Message
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license