【发布时间】:2018-03-01 03:52:28
【问题描述】:
我在使用 Cloudformation 模板时遇到了一些问题,当我尝试推出它时,它在创建实例时一直失败,提示错误“遇到不支持的属性 EBS”,这反过来又会导致回滚。我觉得这很有趣,因为我现在似乎拥有所有必要的属性:
还包括一些有助于加快研究速度的链接: Instance Setup, Block Device Mapping, & Block Specific Properties
Resources:
Web01:
Type: AWS::EC2::Instance
Properties:
SecurityGroups:
- Ref: SecurityGoupSocoDrELB
- Ref: SecurityGoupSocoDrData
KeyName:
Ref: KeyPairName
ImageId: !FindInMap
- RegionMap
- Ref: "AWS::Region"
- AMI
Monitoring: 'false'
SubnetId:
Ref: SocoDrSubnet02
PrivateIpAddress: xxxxxxxx
InstanceInitiatedShutdownBehavior: 'stop'
InstanceType:
Ref: InstanceType
#I think the error occurs here-
BlockDeviceMappings:
- DeviceName: /dev/xvda
- EBS:
DeleteOnTermination: 'true'
VolumeType: gp2
VolumeSize: '300'
作为参考,我包括其他适当的部分,但问题源于资源的实例部分:
Parameters:
KeyPairName:
Description: The EC2 Key Pair to allow SSH access to the instance
Type: AWS::EC2::KeyPair::KeyName
# INSTANCE
InstanceType:
Type: String
AllowedValues:
- t2.nano
- t2.micro
- t2.small
- t2.medium
- t2.large
- t2.xlarge
- t2.2xlarge
Default: t2.small
Mappings:
RegionMap:
us-east-2:
AMI: ami-014a7d64
【问题讨论】:
-
应该是
Ebs而不是EBS。 -
当然是。谢谢,这回答了我的问题。
-
太棒了。我会把它作为答案发布。
标签: amazon-web-services amazon-ec2 amazon-cloudformation