Qin*_*jie 4 amazon-web-services aws-step-functions aws-cdk
使用现有的 Step Functions 定义 JSON 文件,如何直接在 CDK 中使用它来创建 Step Function?
这是代码片段,如果它对任何人有用的话。
private createStepFunction(props: {
stepfunction_name: string;
stepfunctions_role_arn: string;
}): stepfunctions.CfnStateMachine {
const file = fs.readFileSync("../step_functions/definition.asl.json");
const stepFunction = new stepfunctions.CfnStateMachine(
this,
"cfnStepFunction",
{
roleArn: props.stepfunctions_role_arn,
definitionString: file.toString(),
stateMachineName: props.stepfunction_name,
}
);
return stepFunction;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5003 次 |
| 最近记录: |