【发布时间】:2021-07-14 15:38:43
【问题描述】:
我已经在 Terraform (JSON) 文件中实现了 SFn:
data "template_file" "sfn-definition" {
template = file("step-function-definition.json")
}
resource "aws_sfn_state_machine" "sfn_state_machine" {
name = "integration-step-function"
role_arn = aws_iam_role.step_function_role.arn
definition = data.template_file.sfn-definition.rendered
}
它工作正常,但我想使用 YAML 定义而不是 JSON。 我在 YAML 中创建了相同的 SFn 定义。我在 AWS Toolkit (VS Code) 中完成了它,并且图形正确呈现。我将 JSON 文件更改为 YAML:
template = file("step-function-definition.yaml")
不幸的是,它不起作用:
08:58:39 Error: Error creating Step Function State Machine: InvalidDefinition:
Invalid State Machine Definition: 'INVALID_JSON_DESCRIPTION:
Unrecognized token 'StartAt': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
我想aws_sfn_state_machine 中的definition 需要 JSON 文件,但是有没有任何选项可以在 YAML 中定义 SFn 并使用 Terraform?
【问题讨论】:
标签: amazon-web-services terraform aws-step-functions