无法启动API Mock端点错误:CloudFormation堆栈参数rdsRegion缺少默认值 [英] Failed to start API Mock endpoint Error: CloudFormation stack parameter rdsRegion is missing default value

查看:116
本文介绍了无法启动API Mock端点错误:CloudFormation堆栈参数rdsRegion缺少默认值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

  hutber @ hutber:/var/www/unsal.co.uk$放大api add-graphql-datasource使用数据源:Aurora Serverless,提供者:awscloudformation?提供您的群集所在的区域:eu-west-2?选择将用作API数据源的Aurora Serverless集群:unsal?选择用于访问Aurora Serverless群集的机密:hutber✔获取Aurora无服务器群集.?选择要用作数据源的数据库:sys 

一切都成功完成:

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

 一些后续步骤:放大推"将构建您所有的本地后端资源并在云中进行配置放大发布"将构建您所有的本地后端和前端资源(如果您添加了托管类别)并在云中进行配置以下类型未启用"@auth".考虑将@auth与@model一起使用- 分配-联赛- 季节在此处了解有关@auth的更多信息:https://docs.amplify.aws/cli/graphql-transformer/directives#authGraphQL模式已成功编译.在/var/www/unsal.co.uk/amplify/backend/api/unsalcouk/schema.graphql中编辑架构,或将.graphql文件放在/var/www/unsal.co.uk/amplify/backend/中的目录中api/unsalcouk/schema 

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

 无法启动API Mock端点错误:CloudFormation堆栈参数rdsRegion缺少默认值 

解决方案

要解决上述错误,您可以提供 rdsRegion rdsClusterIdentifier 的值在 amplify/backend/api/< api-name> 下的 parameters.json 文件中的rdsSecretStoreArn rdsDatabaseName .

目前, amplify模拟api 不支持 RDS 作为数据存储区.因此,如果您将生成的速度模板用作解析器,那么您的模拟api将在没有数据存储的情况下启动并运行,并且将无法进行某种本地测试.

以下是日志中显示的消息

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

此处是文档.

I have added my RDS MySQL datastore to appsync as follows:

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

Everything finished successfully:

Successfully added the Aurora Serverless datasource locally

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

However when starting the mock service I get the following:

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

解决方案

To fix the above error, you can provide the values for rdsRegion, rdsClusterIdentifier, rdsSecretStoreArn, rdsDatabaseName in the parameters.json file under amplify/backend/api/<api-name>.

At this point, amplify mock api does not support RDS as a Datastore. So your mock api would be up and running without a datastore and would not help in kind of local testing if you are using the generated velocity templates as resolvers.

Following is the message that comes up in the logs

Data source of type RELATIONAL_DATABASE is not supported by local mocking. A NONE data source will be used.

Here is the documentation.

这篇关于无法启动API Mock端点错误:CloudFormation堆栈参数rdsRegion缺少默认值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆