YAML 中 AWS Cloudformation 模板中的 `Ref: logicalName` 和 `!Ref logicalName` 之间有什么区别?

viv*_*ian 6 amazon-web-services aws-cloudformation

YAML 中的 AWS Cloudformation 模板Ref:和其中的区别是什么!Ref

根据AWS docsRef: logicalName是“完整函数名称的!Ref logicalName语法”和“短格式的语法”。完整的函数名称和缩写形式在功能上是否存在差异。我可以只使用 或 吗?

kic*_*hik 5

你可以使用。这只是语法糖。

  • 事实并非如此,“!Ref”在此处使用“AWS::AutoScaling::AutoScalingGroup >> TargetGroupARNs: - Ref...”或此处“AWS::EC2::LaunchTemplate >> SecurityGroups: - Ref...”时会导致错误它应该是“Ref” (2认同)