Slide 6
Slide 6 text
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
• Step Functions の変数と JSONata データ変換
が CDK でも簡単に使えるようになった
• 従来の JSONPath ではステート間での
値の受け渡しが複雑だった
• InputPath, Parameters, ResultPath,
ResultSelector が Arguments だけになる
• ステートマシン内でのデータ操作のための
Lambda 関数を減らせる
• 各ステートの静的メソッド
.jsonata() / .jsonPath() を使うことで
適切なプロパティだけが使える
6
AWS Step Functions L2 コンストラクトでJSONata に対応
aws-cdk v2.178.0 (2025/2/6)
https://github.com/aws/aws-cdk/releases/tag/v2.178.0
変数と JSONata を使った AWS Step Functions での開発者エクスペリエンスの簡素化 |
Amazon Web Services ブログ https://aws.amazon.com/jp/blogs/news/simplifying-developer-
experience-with-variables-and-jsonata-in-aws-step-functions/
new StateMachine(this, 'StateMachine', {
definition: workflow,
queryLanguage: QueryLanguage.JSONATA,
});
TypeScript
// コンストラクタでのステート作成(レガシー)
new sfn.Pass(this, 'Constructor Pattern', {
queryLanguage: sfn.QueryLanguage.JSONATA, // or JSON_PATH
});
// 今後はコンストラクタではなく static method の利⽤を推奨
// JSONata
sfn.Pass.jsonata(this, 'JSONata Pattern', {
outputs: { foo: 'bar' },
});
// JSONPath
sfn.Pass.jsonPath(this, 'JSONPath Pattern', {
outputPath: '$.status',
});
TypeScript
ステートマシン全体での設定
ステートごとの設定