gpt4 book ai didi

amazon-web-services - cloudformation 中允许的值

转载 作者:行者123 更新时间:2023-12-03 07:33:41 26 4
gpt4 key购买 nike

我使用一个参数来询问用户是否需要 D 驱动器,为此我使用了条件。

我尝试给出约束描述和允许值参数属性。

  NeedVolumeD:
Type: String
Description: Do you want a D drive? Enter Yes or No
ConstraintDescription: Enter Yes or No
AllowedValues:
- Yes
- No

但这给了我一个 true 和 false 的下拉列表,而稍后在我的代码中的 Conditions 下我尝试使用 Yes 和 No,尽管这在某种程度上是有效的。

enter image description here

我在这里不明白什么。

最佳答案

您必须使用单引号:

  NeedVolumeD:
Type: String
Description: Do you want a D drive? Enter Yes or No
ConstraintDescription: Enter Yes or No
AllowedValues:
- 'Yes'
- 'No'

否则,YAML(旧版本)会自动将 Yes/No 转换为 true/false

关于amazon-web-services - cloudformation 中允许的值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72301852/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com