【问题标题】:Failed to start API Mock endpoint Error: CloudFormation stack parameter rdsRegion is missing default value无法启动 API Mock 端点错误:CloudFormation 堆栈参数 rdsRegion 缺少默认值
【发布时间】:2020-10-02 17:57:38
【问题描述】:

我已将我的 RDS MySQL 数据存储添加到 appsync,如下所示:

hutber@hutber:/var/www/unsal.co.uk$ amplify api add-graphql-datasource
Using datasource: Aurora Serverless, provided by: awscloudformation
? Provide the region in which your cluster is located: eu-west-2
? Select the Aurora Serverless cluster that will be used as the data source for your API: unsal
? Select the secret used to access your Aurora Serverless cluster: hutber
✔ Fetched Aurora Serverless cluster.
? Select the database to use as the datasource: sys

一切顺利完成:

已成功在本地添加 Aurora Serverless 数据源

Some next steps:
"amplify push" will build all your local backend resources and provision it in the cloud
"amplify publish" will build all your local backend and frontend resources (if you have hosting category added) and provision it in the cloud


The following types do not have '@auth' enabled. Consider using @auth with @model
     - Division
     - League
     - Season
Learn more about @auth here: https://docs.amplify.aws/cli/graphql-transformer/directives#auth


GraphQL schema compiled successfully.

Edit your schema at /var/www/unsal.co.uk/amplify/backend/api/unsalcouk/schema.graphql or place .graphql files in a directory at /var/www/unsal.co.uk/amplify/backend/api/unsalcouk/schema

但是在启动模拟服务时,我得到以下信息:

Failed to start API Mock endpoint Error: CloudFormation stack parameter rdsRegion is missing default value

【问题讨论】:

    标签: amazon-web-services aws-amplify aws-appsync


    【解决方案1】:

    要修复上述错误,您可以在parameters.json 文件的amplify/backend/api/<api-name> 下提供rdsRegionrdsClusterIdentifierrdsSecretStoreArnrdsDatabaseName 的值。

    此时,amplify mock api 不支持将RDS 作为数据存储。因此,如果您使用生成的速度模板作为解析器,您的模拟 api 将在没有数据存储的情况下启动并运行,并且在本地测试中无济于事。

    以下是日志中出现的消息

    本地不支持 RELATIONAL_DATABASE 类型的数据源 嘲笑。将使用 NONE 数据源。

    Here 是文档。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-06-08
      • 2017-12-09
      • 2020-07-04
      • 1970-01-01
      相关资源
      最近更新 更多