适用于 StepFunctions 的 AWS CloudFormation。将 DefinitionString 作为参数传递

问题描述 投票:0回答:1

我正在尝试为 StepFunctions 创建 CloudFormation。 我想将

DefinitionString
作为参数传递。 json 字符串相当大。最大上限为 4096 字节。我该如何处理参数大于上限的情况。下面给出了示例模板

{
   "AWSTemplateFormatVersion" : "2010-09-09",
   "Description" : "An example template for a Step Functions state machine.",
   "Resources" : {
      "MyStateMachine" : {
         "Type" : "AWS::StepFunctions::StateMachine",
         "Properties" : {
            "StateMachineName" : "HelloWorld-StateMachine",
            "DefinitionString" : "{\"StartAt\": \"HelloWorld\", \"States\": {\"HelloWorld\": {\"Type\": \"Task\", \"Resource\": \"arn:aws:lambda:us-east-1:111122223333:function:HelloFunction\", \"End\": true}}}",
            "RoleArn" : "arn:aws:iam::111122223333:role/service-role/StatesExecutionRole-us-east-1"
         }
      }
   }
}
amazon-web-services cloud aws-cloudformation devops aws-step-functions
1个回答
0
投票

如果其他人在 4069 字节最大值方面遇到困难,那么您可以将 Step Function 定义上传到 s3 存储桶并使用

DefinitionS3Location
参数。

请参阅:https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html

© www.soinside.com 2019 - 2024. All rights reserved.