Configurable parameters

You are currently viewing the legacy GraphQL Transformer documentation. View latest documentation

Much of the behavior of the GraphQL Transform logic is configured by passing arguments to the directives in the GraphQL SDL definition. However, certain other things are configured by passing parameters to the CloudFormation template itself. This provides escape hatches without leaking too many implementation details into the SDL definition. You can pass values to these parameters by adding them to the parameters.json file in the API directory of your amplify project.

AppSyncApiName

Override the name of the generated AppSync API

1{
2 "AppSyncApiName": "AppSyncAPI"
3}

CreateAPIKey

CreateAPIKey takes value of either 1 or 0.

It gives you the mechanism to rotate the API Key, in scenarios such as to handle API Key expiration.

Follow these two steps when you need to rotate an API Key

  • Delete the existing API key by setting CreateAPIKey to 0 in the amplify/backend/api/<apiName>/parameters.json file and execute amplify push.
  • Create a new API key by setting CreateAPIKey to 1 in the amplify/backend/api/<apiName>/parameters.json file and execute amplify push.

Delete the existing API Key

1{
2 "CreateAPIKey": 0
3}

Create new API Key

1{
2 "CreateAPIKey": 1
3}

APIKeyExpirationEpoch

Resets the API Key to expire 1 week after the next amplify push

1{
2 "APIKeyExpirationEpoch": 0
3}

Do not create an API key

1{
2 "APIKeyExpirationEpoch": -1
3}

Set a custom API key expiration date

1{
2 "APIKeyExpirationEpoch": 1544745428
3}

The value specified is the expiration date in seconds since Epoch

DynamoDBBillingMode

Set the DynamoDB billing mode for the API. One of "PROVISIONED" or "PAY_PER_REQUEST".

1{
2 "DynamoDBBillingMode": "PAY_PER_REQUEST"
3}

DynamoDBModelTableReadIOPS

Override the default read IOPS provisioned for each @model table

Only valid if the "DynamoDBBillingMode" is set to "PROVISIONED"

1{
2 "DynamoDBModelTableReadIOPS": 5
3}

DynamoDBModelTableWriteIOPS

Override the default write IOPS provisioned for each @model table

Only valid if the "DynamoDBBillingMode" is set to "PROVISIONED"

1{
2 "DynamoDBModelTableWriteIOPS": 5
3}

DynamoDBEnablePointInTimeRecovery

Enable/disable DynamoDB Point-in-time-Recovery for all model tables

For more information, see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/PointInTimeRecovery.html

1{
2 "DynamoDBEnablePointInTimeRecovery": true
3}

ElasticSearchStreamingFunctionName

Override the name of the AWS Lambda searchable streaming function

1{
2 "ElasticSearchStreamingFunctionName": "CustomFunctionName"
3}

ElasticSearchInstanceCount

Override the number of instances launched into the OpenSearch domain created by @searchable

1{
2 "ElasticSearchInstanceCount": 1
3}

ElasticSearchInstanceType

Override the type of instance launched into the OpenSearch domain created by @searchable

1{
2 "ElasticSearchInstanceType": "t2.small.elasticsearch"
3}

ElasticSearchEBSVolumeGB

Override the amount of disk space allocated to each instance in the OpenSearch domain created by @searchable

1{
2 "ElasticSearchEBSVolumeGB": 10
3}

ElasticSearchStreamingLambdaRuntime

Override the runtime for the streaming lambda function used to stream data from DynamoDB into OpenSearch

1{
2 "ElasticSearchStreamingLambdaRuntime": "python3.9"
3}

In the event you have a deprecated runtime and are unable to upgrade your installed Amplify CLI to resolve it you may use this

Note: To use the @auth directive, the API must be configured to use Amazon Cognito user pools.

1type Task
2 @model
3 @auth(
4 rules: [
5 {
6 allow: groups
7 groups: ["Managers"]
8 operations: [create, update, delete]
9 }
10 { allow: groups, groups: ["Employees"], operations: [read, list] }
11 ]
12 ) {
13 id: ID!
14 title: String!
15 description: String
16 status: String
17}
18type PrivateNote @model @auth(rules: [{ allow: owner }]) {
19 id: ID!
20 content: String!
21}