Amazon cloudformation 无法识别的资源类型

Amazon cloudformation 无法识别的资源类型,amazon-cloudformation,amazon-rds,serverless-framework,Amazon Cloudformation,Amazon Rds,Serverless Framework,我想了解无服务器是如何工作的。我已经阅读了他们的很多文档/教程,但是当我谈到我想要构建一些特定的东西的部分时,比如RDS实例,我没有关于MVP的参考框架 我发现这显示了建立RDS实例的基础。我将该地区换成了一个更本地的地区,然后进行了尝试: service: sandbox app: sandbox org: # omitting provider: name: aws runtime: nodejs12.x resources: Resources: Vpc:

我想了解无服务器是如何工作的。我已经阅读了他们的很多文档/教程,但是当我谈到我想要构建一些特定的东西的部分时,比如RDS实例,我没有关于MVP的参考框架

我发现这显示了建立RDS实例的基础。我将该地区换成了一个更本地的地区,然后进行了尝试:

service: sandbox
app: sandbox
org: # omitting 

provider:
  name: aws
  runtime: nodejs12.x

resources:
  Resources:
    Vpc:
      Type: AWS:EC2::VPC
      Properties:
        CidrBlock: 10.0.0.0/16
        InstanceTenancy: default

    PublicSubnet:
      Type: AWS::EC2::Subnet
      Properties:
        CidrBlock: 10.0.0.0/18
        VpcId:
          Ref: Vpc

    PrivateSubnet1:
      Type: AWS::EC2::Subnet
      Properties:
        AvailabilityZone: ca-central-1a
        CidrBlock: 10.0.64.0/18
        VpcId:
          Ref: Vpc

    PrivateSubnet2:
      Type: AWS::EC2::Subnet
      Properties:
        AvailabilityZone: ca-central-1b
        CidrBlock: 10.0.128.0/18
        VpcId:
          Ref: Vpc

    Database:
      Type: AWS::RDS:DBInstance
      Properties:
        Engine: aurora
        EngineVersion: 5.6.10a
        DBInstanceClass: db.r5.large
        DBName: MyDatabase
        MasterUsername: test
        MasterUserPassword: # ommitting
        DBSubnetGroupName:
          Ref: DBSubnetGroup
        VPCSecurityGroups:
          - Ref: DatabaseVpcSecurityGroup

    DBSubnetGroup:
      Type: "AWS::RDS::DBSubnetGroup"
      Properties: 
        DBSubnetGroupName: PrivateDbSubnet
        DBSubnetGroupDescription: PrivateDbSubnet
        SubnetIds:
          - Ref: PrivateSubnet1
          - Ref: PrivateSubnet2

    DatabaseVpcSecurityGroup:
      Type: "AWS::EC2::SecurityGroup"
      Properties:
        GroupName: DBSecurityGroup
        GroupDescription: Allow local access
        SecurityGroupIngress:
          - CidrIp: 10.0.0.0/16
            IpProtocol: tcp
            FromPort: 3306
            ToPort: 3306
        VpcId: 
            Ref: Vpc
当我尝试使用Serverless部署时,出现以下错误: CloudFormation模板无效:模板格式错误:无法识别的资源类型:[AWS:EC2::VPC,AWS::RDS:DBInstance]

我可以看到AWS上存在这些资源:


所以。。。这个错误意味着什么?我做错了什么?

您的资源类型有输入错误。在这两种情况下,您都有一个单冒号:其中您应该有一个双冒号:

您的资源类型有输入错误。在这两种情况下,您都有一个单冒号:其中应该有一个双冒号:

如果出现无法识别的资源类型错误,则表示代码中存在语法问题

在无法识别的资源类型之后检查输入错误:

Unrecognized resource types: [AWS::Dynamo::Table]
在这种情况下,它应该是

Type: AWS::DynamoDB::Table

如果出现无法识别的资源类型错误,则表示代码中存在语法问题

在无法识别的资源类型之后检查输入错误:

Unrecognized resource types: [AWS::Dynamo::Table]
在这种情况下,它应该是

Type: AWS::DynamoDB::Table

非常感谢,非常感谢。