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

1.3k views Asked by At

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
1

There are 1 answers

0
GSSwain On BEST ANSWER

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.