[{"data":1,"prerenderedAt":78},["ShallowReactive",2],{"pattern-s3-sfn-batch-operations-typescript-cdk":3,"pattern-group-s3-sfn-batch-operations-typescript-cdk":6},{"id":4,"title":5,"architectureURL":6,"cleanup":7,"contributors":10,"deploy":12,"description":18,"extension":19,"framework":20,"gitHub":21,"highlight":6,"introBox":25,"language":32,"level":33,"meta":34,"patternArch":35,"patternGroup":6,"patternGroupLabel":6,"resources":62,"stem":73,"testing":74,"videoId":6,"__hash__":77},"patterns\u002Fpatterns\u002Fs3-sfn-batch-operations-typescript-cdk.json","Bulk object tagging with Amazon S3 Batch Operations and AWS Step Functions",null,{"text":8},[9],"\u003Ccode>npx cdk destroy\u003C\u002Fcode>",[11],"content\u002Fcontributors\u002Fnithin-chandran-r.json",{"text":13},[14,15,16,17],"\u003Ccode>npm install\u003C\u002Fcode>","\u003Ccode>npm run build\u003C\u002Fcode>","If the account and Region are not bootstrapped for the AWS CDK yet: \u003Ccode>npx cdk bootstrap\u003C\u002Fcode>","\u003Ccode>npx cdk deploy\u003C\u002Fcode>","AWS Step Functions creates an Amazon S3 Batch Operations job with a generated manifest, polls it to the end, and publishes the result to Amazon SNS.","json","AWS CDK",{"template":22},{"patternPath":23,"templateFile":24},"s3-sfn-batch-operations\u002Ftypescript\u002Fcdk","lib\u002Fs3-sfn-batch-operations-stack.ts",{"headline":26,"text":27},"How it works",[28,29,30,31],"An AWS Step Functions workflow calls Amazon S3 Control `CreateJob` through the AWS SDK integration. Amazon S3 generates the object list from a key prefix, so there is no manifest file to build, and the job tags every matching object.","The workflow waits, calls `DescribeJob`, and loops until the job reaches a final status. The loop is bounded and the state machine has a timeout.","A Choice state branches on the failed-task count. A job with zero failed tasks publishes a success message to Amazon SNS. Any other end publishes a message with the job ID and counts, and the execution fails.","The job role can tag only objects under one prefix, so a run with another prefix exercises the failure branch.","TypeScript","300",{},{"icon1":36,"icon2":41,"icon3":45,"icon4":48,"line1":52,"line2":56,"line3":59},{"x":37,"y":38,"service":39,"label":40},15,20,"sfn","AWS Step Functions\nJob workflow",{"x":42,"y":38,"service":43,"label":44},50,"s3","Amazon S3\nBatch Operations",{"x":46,"y":38,"service":43,"label":47},85,"Amazon S3\nSource objects",{"x":37,"y":49,"service":50,"label":51},75,"sns","Amazon SNS\nJob result",{"from":53,"to":54,"label":55},"icon1","icon2","CreateJob",{"from":54,"to":57,"label":58},"icon3","Tag",{"from":53,"to":60,"label":61},"icon4","Publish",{"bullets":63},[64,67,70],{"text":65,"link":66},"Amazon S3 Batch Operations","https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonS3\u002Flatest\u002Fuserguide\u002Fbatch-ops.html",{"text":68,"link":69},"Amazon S3 Control CreateJob API","https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonS3\u002Flatest\u002FAPI\u002FAPI_control_CreateJob.html",{"text":71,"link":72},"AWS Step Functions AWS SDK integrations","https:\u002F\u002Fdocs.aws.amazon.com\u002Fstep-functions\u002Flatest\u002Fdg\u002Fsupported-services-awssdk.html","patterns\u002Fs3-sfn-batch-operations-typescript-cdk",{"text":75},[76],"See the GitHub repo for detailed testing instructions.","aN0jLahS7ZBBAYhuA9ZJopuPF_UQUpwUxEKtQNFQJ_8",1795084468656]