[英]Cloudformation how to Sub inside of a ImportValue inside of a Sub?
I feel I have tried just about every combination for this to work, and have come up empty handed.我觉得我已经尝试了几乎所有的组合来使它起作用,但都空手而归。 Has anyone done this?
有没有人这样做过? I am trying to reference an import value inside of a sub while referencing the the parameter ApiStack.
我试图在引用参数 ApiStack 时引用子内部的导入值。 Appreciate any advice!
感谢任何建议!
LambdaPermission:
Type: AWS::Lambda::Permission
Properties:
Action: lambda:InvokeFunction
FunctionName: !GetAtt MyLambdaFunction.Arn
Principal: apigateway.amazonaws.com
SourceArn: !Sub
- arn:aws:execute-api:${AWS::Region}:${AWS::AccountId}:${ApiGateway}/*/POST/CreateBofAParameter
- ApiGateway: !ImportValue
'Fn::Sub': '${ApiStack}--APIID'
The same to used in the question code structure worked for me, thus, as mentioned in the comments, the issue is not related to Sub / ImportValue precedence or format.问题代码结构中使用的对我有用,因此,如评论中所述,该问题与Sub / ImportValue优先级或格式无关。
Arn: !Sub
- "arn:aws:elasticfilesystem:${AWS::Region}:${AWS::AccountId}:access-point/${VariableToImport}"
- VariableToImport: !ImportValue
'Fn::Sub': "${SubVariable}-some-id"
You have extra '
.你有额外
'
。 It should be:它应该是:
'Fn::Sub': "${ApiStack}--APIID"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.