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

标签 list aws-cloudformation default

当我使用交互式参数创建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/

相关文章:

typescript - AWS CDK通过EventBridge接收对象创建事件并触发Lambda

SQL Server : Find out default value of a column with a query

git - 如何让 Sublime Text 成为 Git 的默认编辑器?

r - 通过平均向量展平嵌套列表

python - 如何从两个词典创建列表?

amazon-web-services - 插入 CloudFormation ImportValue 类似于如何插入参数?

c# - 在可选参数中设置 DateTime 的默认值

python - 将特定编号(不排序)移到列表左侧

python - 将 3 堆数字从左到右逐行排序

yaml - 我需要使用 CloudFormation 模板创建 DynamoDB 表的帮助