amazon-web-services - 遇到不受支持的属性 EBS

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

我在使用 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。文档可以找到 here .

关于amazon-web-services - 遇到不受支持的属性 EBS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49037425/

相关文章:

php - 如何使 PHP 文件与亚马逊托管一起使用?

linux - 如何在Linux中的文本文件中获取最新快照的详细信息?

amazon-web-services - 使用 CloudFormation 模板验证 AWS 资源

amazon-web-services - 结合 AWS CLI 和 CloudFormation?

python - 为什么在我使用复合主键时 AWS Lambda 返回 "The provided key element does not match the schema"?

random - AWS DynamoDB - 随机选择记录/项目?

node.js - AWS EC2 Launch 配置用户数据 - 找不到命令

amazon-ec2 - 在 Amazon EC2 上连接 rabbitmq 集群时出错

python - Django ; AWS Elastic Beanstalk 错误 : Your WSGIPath refers to a file that does not exist

amazon-web-services - 在 AWS Cloudformation 控制台中获取完整的事件文本