0

We have a requirement to create a state machine which includes to datasync tasks followed by each other. These datasync tasks are already created and now I want to execute it using step functions one after another. What is the resource to execute a datasync task. For eg: For executing a Glue Job we give Resource:arn:aws:states:::glue:startJobRun.sync

What Resource string is used for executing a datasync task?

1 Answer 1

2

Step Functions integrates with AWS DataSync using AWS SDK Service Integrations. The Resource string will be of the form arn:aws:states:::aws-sdk:datasync:<api-action>

The easiest way to find this sort of information is with Workflow Studio. As you can see in the image below, it allows you to search through available services and api actions to find what you need, then just drag it into your workflow.

enter image description here

Step Functions does not have an Optimized Integration for DataSync and therefore only supports the Request Response integration pattern. As such, I suspect you will want to use the Job Poller pattern (Workflow Studio helps you here as well) to start the task execution then monitor for completion.

enter image description here

For easier re-use, you might want to implement this in a state machine that you can then reuse by calling it from other state machines when needed. This blog post goes into detail on how to do a similar thing with Glue Crawler, but much of it will be applicable.

Sign up to request clarification or add additional context in comments.

5 Comments

Thanks Justin . You are savior 🙌
Glad it was useful, happy to help!
Hey Justin , I'm using the TaskToken feature for a datasync task to get completed. I have added waitForTaskToken at the end in the resource but how do I use TaskToken feature in state machine definition wrt to Datasync. Do you have any idea? @Justin
how can ejecute a cross acount datasinc task ?
@CristiánVargasAcevedo, you can learn about how to make cross account calls in the following link: docs.aws.amazon.com/step-functions/latest/dg/… Essentially, you use the Credentials field (docs.aws.amazon.com/step-functions/latest/dg/…) to specify a role to assume in the target account. But you need to do a bunch of IAM setup for the roles and your state machine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.