CloudFormation - 为 List<> 类型设置多个默认值
CloudFormation - set multiple default values for type of List<>
当我使用交互式 Parameters
创建 CloudFormation 模板时,我可以定义 List<> 的类型以能够 select 多个值,例如:
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: "???"
问题是如何使用多个 select 离子预设 default
值? if default
只接受字符串而不是列表,并且在多个值之间用逗号分隔的字符串也无济于事
有什么想法吗?请提示我
我最近 运行 在同一期。
答案很简单——逗号分隔列表中不应有空格。
所以它看起来像:
SecurityGroups:
Type: List<AWS::EC2::SecurityGroup::Id>
Description: Select security groups.
Default: "sg-11111111,sg-22222222"
这样,这些值将在您的模板中预选。
P.S。不要尝试 CommaDelimitedList 左右 - 它不会以您想要的方式工作。将选择字符串值,但不会选择实际的安全组。
来源:https://forums.aws.amazon.com/thread.jspa?threadID=165144
当我使用交互式 Parameters
创建 CloudFormation 模板时,我可以定义 List<> 的类型以能够 select 多个值,例如:
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: "???"
问题是如何使用多个 select 离子预设 default
值? if default
只接受字符串而不是列表,并且在多个值之间用逗号分隔的字符串也无济于事
有什么想法吗?请提示我
我最近 运行 在同一期。 答案很简单——逗号分隔列表中不应有空格。 所以它看起来像:
SecurityGroups:
Type: List<AWS::EC2::SecurityGroup::Id>
Description: Select security groups.
Default: "sg-11111111,sg-22222222"
这样,这些值将在您的模板中预选。
P.S。不要尝试 CommaDelimitedList 左右 - 它不会以您想要的方式工作。将选择字符串值,但不会选择实际的安全组。
来源:https://forums.aws.amazon.com/thread.jspa?threadID=165144