【发布时间】:2021-08-06 12:49:09
【问题描述】:
Parameters:
KeyName:
Description: Name of an existing EC2 KeyPair to enable SSH access to the instance
Type: 'AWS::EC2::KeyPair::KeyName'
ConstraintDescription: must be the name of an existing EC2 KeyPair.
MySubnet:
Description: My subnet from my VPC
Type: 'AWS::EC2::Subnet::Id'
Default: subnet-YYYYYYYY
MySG:
Description: My Security Group from my VPC
Type: 'AWS::EC2::SecurityGroup::GroupName'
Default: SG-YYYYYYYY
Resources:
Ec2Instance:
Type: AWS::EC2::Instance
Properties:
InstanceType: t2.micro
ImageId: ami-09e67e426f25ce0d7
SecurityGroups: !Ref MySG
SubnetId: !Ref MySubnet
KeyName: !Ref KeyName
我有上面的 cloudformation 模板代码,它返回“属性 SecurityGroups 的值必须是字符串类型列表”,我的 vpc 和安全组在不同的 cloudformation 模板中进行了简化,我想在特定的安全性中启动 ec2组。
【问题讨论】:
标签: amazon-web-services amazon-ec2 amazon-cloudformation