gpt4 book ai didi

list - CloudFormation - 为 List<> 类型设置多个默认值

转载 作者:行者123 更新时间:2023-12-03 20:15:26 28 4
gpt4 key购买 nike

当我使用交互式参数创建CloudFormation模板时,我可以定义List<>的类型以便能够选择多个值,例如:

SubnetIds:
Type: List<AWS::EC2::Subnet::Id>
Description: Select multiple subnets from selected VPC.
Default: "????"

或者:

SecurityGroups:
Type: List<AWS::EC2::SecurityGroup::Id>
Description: Select security groups.
Default: "???"

问题是如何通过多个选择来预设 default 值? if default 仅接受字符串而不是列表,并且多个值之间带有逗号的字符串也没有帮助

有什么想法吗?请提示我

最佳答案

我最近遇到了同样的问题。答案很简单 - 以逗号分隔的列表中不应有空格。所以它看起来像:

SecurityGroups:
Type: List<AWS::EC2::SecurityGroup::Id>
Description: Select security groups.
Default: "sg-11111111,sg-22222222"

这样,这些值就会在您的模板中预先选择。

附注不要尝试 CommaDelimitedList 等 - 它不会按您想要的方式工作。将选择字符串值,但不会选择实际的安全组。

来源:https://forums.aws.amazon.com/thread.jspa?threadID=165144

关于list - CloudFormation - 为 List<> 类型设置多个默认值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56560547/

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