Skip to content
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): task constructs to call DynamoDB APIs #8466

Merged
merged 16 commits into from
Jun 24, 2020

Conversation

shivlaks
Copy link
Contributor

@shivlaks shivlaks commented Jun 10, 2020

Replaces the implementation to call DynamoDb from within a task to
merge state level properties as a construct.

Notable changes:

  • APIs require an ITable to be supplied instead of tableName
  • partitionKey and sortKey are now represented as key
    • Rationale: aligning with the SDK for making these calls to Dynamo
  • DynamoAttributeValue is now a struct rather than a class
    • Rationale: the withX methods don't translate to every language and
      with a struct a fluent builder will be generated with a more idiomatic syntax
      for the language being used

Refactored where it seemed sensible. Test expectations have not changed with
the exception of the tableName being a reference. Verified the integration test.

Closes #8108

BREAKING CHANGE:
Dynamo* tasks no longer implementIStepFunctionsTask and have been replaced byconstructs that can be instantiated directly. See README for examples


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@shivlaks shivlaks added pr/do-not-merge This PR should not be merged at this time. @aws-cdk/aws-stepfunctions-tasks labels Jun 10, 2020
@shivlaks shivlaks requested review from rix0rrr and nija-at June 10, 2020 10:08
@shivlaks shivlaks self-assigned this Jun 10, 2020
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Jun 10, 2020
@ccfife ccfife mentioned this pull request Jun 10, 2020
24 tasks
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 7619e48
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 103e035
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: f282f88
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 21248bd
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 3e80d75
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 4d7e969
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

1 similar comment
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 4d7e969
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@shivlaks
Copy link
Contributor Author

copy @RomainMuller - added you as a reviewer as you will likely have other suggestions for cleaning this integration up while we're in here from both jsii and Dynamo perspective

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 20a68c8
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@shivlaks
Copy link
Contributor Author

@RomainMuller - took a stab at your suggestion(s) - have not done the READMEs yet, but let me know if you had any other thoughts or ideas before I do that.

PS: I'm not super delighted with the naming (wrapX) but i liked it more than some of the other alternatives.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 95502af
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 904cfd5
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 63d5ad9
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 4e544b4
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

/**
* Determines the level of detail about provisioned throughput consumption that is returned.
*/
export enum DynamoConsumedCapacity {
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if those should be directly in the dynamodb package? I don't feel strongly either way, but it sounds like something that could be useful in other contexts using DDB tables?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that makes sense. I'm not strongly opinionated here either.
I'll put together another PR moving them over and let's see what that looks like in a draft to continue with this idea.

Copy link
Contributor

@RomainMuller RomainMuller left a comment

Choose a reason for hiding this comment

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

Looks much better IMO. I'm wondering if we should move the enums directly in the DynamoDB package, since those are applicable beyond SFN... But I'm not sure it's the right move...

@shivlaks shivlaks removed the pr/do-not-merge This PR should not be merged at this time. label Jun 24, 2020
@mergify
Copy link
Contributor

mergify bot commented Jun 24, 2020

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-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 7caad98
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 0b1d8a4
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify
Copy link
Contributor

mergify bot commented Jun 24, 2020

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).

@mergify mergify bot merged commit a7cb3b7 into master Jun 24, 2020
@mergify mergify bot deleted the shivlaks/sfn-tasks-dynamo-rewrite branch June 24, 2020 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to use cdk to create step function to write to dynamodb?
4 participants