考虑以下代码:
EventRule:
Type: AWS::Events::Rule
Properties:
Description: "ny trigger"
ScheduleExpression: "rate(1 minute)"
State: "DISABLED"
Targets:
-
Arn: !GetAtt MyFunctionLambdaFunction.Arn
Id: "someId"
Input:
Fn::Sub:
- '{"arn":"#{arn}"}'
- arn: !GetAtt MyStateMachine.Arn
这给了我一个错误:
Error: The CloudFormation template is invalid: Template error: One or more Fn::Sub
intrinsic functions don't specify expected arguments. Specify a string as first argument,
and an optional second argument to specify a mapping of values to replace in the string
答案 0 :(得分:0)
这里不需要library(anytime)
order.time <- anytime(order.time)
中的GetAtt
。 Sub
可以解决Sub
之类的问题。因此,您可以执行以下操作:
MyStateMachine.Arn
在某些情况下,您可能仍需要传递参数(例如,当您需要调用Input: !Sub
- |-
{ "arn": "${MyStateMachine.Arn}" }
之类的函数时)。例如,如果您的状态机是在其他堆栈中定义的,并通过ImportValue
输出导出,则可以执行以下操作:
other-stack-MyStateMachine-Arn