AWS Step Functionsコマンドチートシート

AWS Step Functionsコマンドチートシート

ステートマシン作成

ステートマシン作成します。コードはworkflow.jsonファイルです。

パラメータ 意味
--name ステートマシン名
--definition ワークフロー定義
--role IAM RoleのARN
$ aws stepfunctions create-state-machine \
--name hoge \
--definition file://workflow.json \
--role-arn arn:aws:iam::xxxxxxxxxxxx:role/StepFunctionsSample

これで作成されます。

ステートマシン実行

ステートマシンを実行します。

パラメータ 意味
--state-machine-arn ステートマシンのARN
$ aws stepfunctions start-execution \
--state-machine-arn arn:aws:states:ap-northeast-1:xxxxxxxxxxxx:stateMachine:ステートマシン名

これで実行されます。

ステートマシン一覧

ステートマシン一覧を表示します。

$ aws stepfunctions list-state-machines

ステートマシン名のみの一覧を出力したい場合は--queryオプションを使用します。

$ aws stepfunctions list-state-machines --query stateMachines[].name
[
  "statemachine-1",
  "statemachine-2"
]

ステートマシン削除

ステートマシンを削除します。

パラメータ 意味
--state-machine-arn ステートマシンのARN
$ aws stepfunctions delete-state-machine \
 --state-machine-arn arn:aws:states:ap-northeast-1:xxxxxxxxxxxx:stateMachine:hoge

これでステートマシンが削除されます。

ステートマシンの定義表示

ステートマシンのARN,name,status,definitionなどを表示します。

パラメータ 意味
--state-machine-arn ステートマシンのARN
$ aws stepfunctions describe-state-machine \
--state-machine-arn arn:aws:states:ap-northeast-1:xxxxxxxxxxxx:stateMachine:ステートマシン名

リファレンス

stepfunctions — AWS CLI 2.11.15 Command Reference

コメント

株式会社CONFRAGE ITソリューション事業部をもっと見る

今すぐ購読し、続きを読んで、すべてのアーカイブにアクセスしましょう。

続きを読む

タイトルとURLをコピーしました