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

stepfunctions task - support dynamodb #6468

Closed
nija-at opened this issue Feb 26, 2020 · 4 comments · Fixed by #6654
Closed

stepfunctions task - support dynamodb #6468

nija-at opened this issue Feb 26, 2020 · 4 comments · Fixed by #6654
Assignees
Labels
@aws-cdk/aws-stepfunctions Related to AWS StepFunctions effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. in-progress This issue is being actively worked on.

Comments

@nija-at
Copy link
Contributor

nija-at commented Feb 26, 2020

https://docs.aws.amazon.com/step-functions/latest/dg/connect-ddb.html


This is a 🚀 Feature Request

@nija-at nija-at added feature-request A feature should be added or improved. @aws-cdk/aws-stepfunctions Related to AWS StepFunctions effort/small Small work item – less than a day of effort labels Feb 26, 2020
@nija-at nija-at self-assigned this Feb 26, 2020
@ayush987goyal
Copy link
Contributor

ayush987goyal commented Feb 27, 2020

Hi @nija-at ,

To implement this, I was thinking of having individual classes for all 4 APIs (GetItem, PutItem, DeleteItem and UpdateItem) that implement IStepFunctionsTask and one public class called CallDynamoDB which has static methods for each of these APIs that instantiates and returns a task object for these.

So basically,

class GetItemTask implements sfn.IStepFunctionsTask {
	...
}

class PutItemTask implements sfn.IStepFunctionsTask {
	...
}

class DeleteItemTask implements sfn.IStepFunctionsTask {
	...
}

class UpdateItemTask implements sfn.IStepFunctionsTask {
	...
}

export class CallDynamoDB {
	static getItemTask(props: GetItemTaskProps) {
		return new GetItemTask(props);
	}

	.
	.
	.

	static updateItemTask(props: UpdateItemTaskProps) {
		return new UpdateItemTask(props);
	}
}

How does that sound?

@nija-at
Copy link
Contributor Author

nija-at commented Mar 2, 2020

This sounds like a good start. I would prefix the classes with the service name and drop the Task suffix, so DynamoGetItem, DynamoPutItem, etc.

@ayush987goyal
Copy link
Contributor

@nija-at Hi, I am having trouble installing @aws-cdk/aws-dynamodb as a dependency of @aws-cdk/aws-stepfunctions-tasks. This is what I am doing in aws-cdk/packages/@aws-cdk/aws-stepfunctions-tasks sub-directory:

  1. yarn add @aws-cdk/aws-dynamodb@0.0.0
  2. ../../../scripts/buildup

I am getting following error

cdk-build Error:
Error: Unable to locate module: @aws-cdk/aws-dynamodb

I am not sure what I am doing wrong and what I should do instead.

@ayush987goyal
Copy link
Contributor

I ran a yarn build in the root and I am getting the following error

lerna ERR! ECYCLE Dependency cycles detected, you should fix these!
lerna ERR! ECYCLE @aws-cdk/aws-dynamodb -> @aws-cdk/custom-resources -> @aws-cdk/aws-stepfunctions-tasks -> @aws-cdk/aws-dynamodb

I think there is a cycle in the dependencies. The custom-resources package requires aws-stepfunctions-tasks. How do we handle this scenario?

@SomayaB SomayaB added the in-progress This issue is being actively worked on. label Mar 10, 2020
@mergify mergify bot closed this as completed in #6654 Apr 3, 2020
mergify bot pushed a commit that referenced this issue Apr 3, 2020
Support for DynamoDB as StepFunctions tasks. Supports GetItem,
PutItem, DeleteItem and UpdateItem tasks.

closes #6468
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-stepfunctions Related to AWS StepFunctions effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. in-progress This issue is being actively worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants