【发布时间】:2019-10-15 13:51:21
【问题描述】:
我对 AWS CloudFormation 如何处理布尔值和布尔值的字符串感到困惑。
例如,就 CloudFormation 而言,'true' 和 true(或 'false' 和 false)在逻辑上是否等效?我在他们的快速入门模板中看到了这两种情况的示例,这让我认为它们是(尽管我还没有找到关于这种或另一种方式的文档)。
例如,在他们的模板quickstart-compliance-common/templates/vpc-production.template 中,他们定义了一个“String”类型的变量pSupportsNatGateway(尽管它的默认值是literal 值true):
Parameters:
...
pSupportsNatGateway:
Description: Specifies whether this region supports NAT Gateway (this value is
determined by the main stack if it is invoked from there)
Type: String
Default: true
然后,在模板后面的condition 中,将该参数(可能是字符串)与文字 值true 进行比较。
Conditions:
...
cSupportsNatGateway:
!Equals
- true
- !Ref pSupportsNatGateway
我的问题是,CloudFormation 如何比较文字值和这些值的字符串?这在 AWS 文档中的什么地方定义?
【问题讨论】:
标签: amazon-web-services amazon-cloudformation