首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >未能启动API模拟端点错误: CloudFormation堆栈参数rdsRegion缺少默认值

问未能启动API模拟端点错误: CloudFormation堆栈参数rdsRegion缺少默认值
EN

Stack Overflow用户
提问于 2020-10-02 17:57:38
回答 1查看 1.1K关注 0票数 0

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

代码语言:javascript
复制
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数据源

代码语言:javascript
复制
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

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

代码语言:javascript
复制
Failed to start API Mock endpoint Error: CloudFormation stack parameter rdsRegion is missing default value
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-10-04 05:10:27

要修复上述错误,可以在rdsRegion文件中的amplify/backend/api/<api-name>中提供parameters.json、rdsClusterIdentifier、rdsSecretStoreArn、rdsDatabaseName的值。

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

下面是日志中显示的消息

本地模拟不支持RELATIONAL_DATABASE类型的数据源。将使用无数据源。

这里是文档。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64176243

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档