Parameters:
Bucket:
Default: bucket_1
Type: String
AllowedValues:
- bucket_1
- bucket_2
Resources:
StepFunction:
Type: 'AWS::StepFunctions::StateMachine'
Properties:
DefinitionString: |-
{
...
}
RoleArn: ...
StateMachineName: ...
EventRule:
Type: 'AWS::Events::Rule'
Properties:
ScheduleExpression: cron(...)
Targets:
- RoleArn: ...
Arn: !Ref StepFunction
Id: "ScheduleStepFunction"
InputTransformer:
InputPathsMap:
Bucket: !Ref Bucket
InputTemplate: "{\"Bucket\": <Bucket>}"
我试图将名为Bucket
的输入参数(在CloudFormation模板本身中定义为参数)传递给事件规则的StepFunction目标。
I get this error: InputPath for target ScheduleStepFunction is invalid.
Note: The optional parameter 'InputPath' has not been provided also.
答案 0 :(得分:0)
Targets:
- RoleArn: ...
Arn: !Ref StepFunction
Id: "ScheduleStepFunction"
InputTransformer:
InputPathsMap:
Bucket: !Ref Bucket
InputTemplate: "{\"Bucket\": <Bucket>}"
您的 Targets 似乎有问题,因为根据Amazon eventRule文档的建议,您的目标中没有提及 Input 。转到提供的链接以按照AWS UserGuide的建议在目标中使用Input。