无服务器支持 AWS DocumentDB 吗?

Mar*_*lva 0 mongodb amazon-web-services serverless

我在一家使用 Serverless 构建云原生应用程序和服务的公司工作。今天,我们将 DynamoDB 和 SQL 数据库与 AWS Aurora 结合使用。

我们希望将 DocumentDB 用于我们的下一个应用程序,但我们找不到有关 Serverless 和 AWS DocumentDB 的任何信息。Serverless 是否支持 AWS DocumentDB?如果没有,未来是否有计划支持它?

hep*_*ump 6

Serverless supports any AWS resources that you can define using CloudFormation. As per the Serverless docs here:

Define your AWS resources in a property titled resources. What goes in this property is raw CloudFormation template syntax, in YAML...

The YAML for creating a DocumentDB cluster is, going to look something like:

resources:
  Resources:
    DBCluster:
      Type: "AWS::DocDB::DBCluster"
      DeletionPolicy: Delete
      Properties:
        DBClusterIdentifier: "MyCluster"
        MasterUsername: "MasterUser"
        MasterUserPassword: "Password1234!"

    DBInstance:
      Type: "AWS::DocDB::DBInstance"
      Properties:
        DBClusterIdentifier: "MyCluster"
        DBInstanceIdentifier: "MyInstance"
        DBInstanceClass: "db.r4.large"
      DependsOn: DBCluster
Run Code Online (Sandbox Code Playgroud)

您可以在此处找到可以在resourcesServerless.yaml的参数中定义的其他 CloudFormation 资源。