遇到不受支持的财产EBS

时间:2018-02-28 19:46:41

标签: amazon-web-services amazon-ec2 amazon-cloudformation

我在使用Cloudformation模板时遇到了一些问题,当我尝试将其推出时,它会一直在创建实例时失败,从而提示错误'遇到不受支持的财产EBS'这反过来导致回滚。我发现这非常有趣,因为我现在似乎拥有所有必要的属性:

还包括一些可以帮助加快研究的链接: Instance SetupBlock 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

1 个答案:

答案 0 :(得分:0)

正确的属性为Ebs而不是EBS。可以找到文档here