LoginSignup
0
0

More than 1 year has passed since last update.

AWS_STEP_FUNCTIONS_STARTED_BY_EXECUTION_ID の有無による挙動の違い

Posted at

概要

Step Functions でネストしたステートマシンを定義する場合、子のステートマシンを呼び出す際に AWS_STEP_FUNCTIONS_STARTED_BY_EXECUTION_ID を渡すのが一般的。

        "States": {
          "Run Another State Machine": {
            "Type": "Task",
            "Resource": "arn:aws:states:::states:startExecution.sync",
            "Parameters": {
              "StateMachineArn": "arn:aws:states:ap-northeast-1:...",
              "Input": {
                "AWS_STEP_FUNCTIONS_STARTED_BY_EXECUTION_ID.$": "$$.Execution.Id",
                     :

なぜ渡さなければいけないのか、ドキュメントを読んでもよくわからなかったので、実際に試してみた。

実行結果

結論としては、子のステートマシンの実行結果の Started By の有無が差異としてあった。

AWS_STEP_FUNCTIONS_STARTED_BY_EXECUTION_ID あり

image.png

Started By に呼び出し元 (親ステートマシン) の arn がある。

AWS_STEP_FUNCTIONS_STARTED_BY_EXECUTION_ID なし

image.png

Started By がそもそもない。

まとめ

  • AWS_STEP_FUNCTIONS_STARTED_BY_EXECUTION_ID を渡すと、子の実行結果に Started By が追加される。
  • AWS_STEP_FUNCTIONS_STARTED_BY_EXECUTION_ID を渡さなくても実行自体は問題なく行われる。
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0