CDK Step Function Map state working with "Distributed Mode"

0

Hi we are from AutoScout24.com in dcs_core team,

We are using cdk to deploy state machine and we are using "Map" state with "inline mode", and we are currently required to use "Distributed mode" due to "inline mode" limitations, but we could not find any documentation or examples related with it does latest cdk version supports working "Map with Distributed mode" ?

Can you please help ? Thank you.

已提問 10 個月前檢視次數 2134 次
2 個答案
1
已接受的答案

Update: As Anentropic pointed out, the CDK Construct has been released: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.DistributedMap.html


Hi Umut,

as of today, Distributed Map isn't supported by the CDK yet (https://github.com/aws/aws-cdk/issues/23216). However, you can always use the CustomState construct to drop in any ASL that’s not natively implemented in the L2 constructs.

For example:

const custom = new sfn.CustomState(this, 'distributed map state', {
  stateJson: { 
    "Type": 'Map',
    "ItemReader": {
      "ReaderConfig": {
        "InputType": "CSV",
        "CSVHeaderLocation": "FIRST_ROW"
      },
      "Resource": "arn:aws:states:::s3:getObject",
      "Parameters": {
         ...
      }
    },
    "ItemProcessor": {
      "ProcessorConfig": {
        "Mode": "DISTRIBUTED",
        "ExecutionType": "EXPRESS"
      },
      "StartAt": "...",
      "States": {
          ....
        }
      }
    }
  }
});

Please upvote/accept this answer if you found it helpful.

profile pictureAWS
專家
已回答 10 個月前
  • Is there any progress on getting DistributedMap support available directly in the CDK, as an L2 construct or otherwise?

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南