DataSync Start Execution Api

0

https://stackoverflow.com/questions/78417368/hi-fellow-developers-there-is-something-i-need-to-know-about-datasync-start-exe

Hi have few questions regarding DataSync Start Execution Sdk.

  • Can I use dataSync Start execution Api in the same stack in which task are also getting created or tasks need to be created beforehand.
  • Wil the StartExecution Api start running the task as soon as it is deployed, and if we have to run the tasks again. do we need to deploy the stack again.
  • I am currently using a pipeline to deploy the stack with datasync cfn resources. As I want to automate the process as much as possible.

please see the attached link for the detailed explanation of my issue.

1 Answer
0
Accepted Answer

From your StackOverflow question, I see you are getting the error Malformed ARN: ${Token[TOKEN.110]}. It looks like you may be using CDK and are making an AWS SDK call in your CDK application code. I will answer as though that is the case. If I have misinterpreted your situation, please provide additional details of what your stack code looks like and how/where the StartTaskExecution call is being made and I can try to assist further.

CDK uses tokens to resolve unknown values within the resulting CloudFormation templates. These are encoded to a value similar to${Token[TOKEN.110]}. The resolved values of these are not available to be used directly in the code of your CDK application. Instead, they are translated to the proper CloudFormation Ref intrinsic calls when the CloudFormation template is synthesized. CloudFormation then further resolves these values at deployment time to the actual value. Please refer to the documentation on Tokens for additional information [1]. If you wish to call StartTaskExecution on a task created in your CDK stack, then you have two options:

  1. Use a custom resource [2] to either wrap AWS SDK calls or write a custom Lambda function. This framework allows you to customize how creates, updates, and deletes on your stack are handled.
  2. Create a CloudFormation output using CfnOutput [3] for the Task ARN and add an additional step in your pipeline AFTER your CDK deployment that looks up the Stack Output and calls StartTaskExecution using that ARN.

[1] https://docs.aws.amazon.com/cdk/v2/guide/tokens.html

[2] https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.custom_resources-readme.html

[3] https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.CfnOutput.html

profile pictureAWS
answered a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions