Configurable parameters
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
{ "AppSyncApiName": "AppSyncAPI"}
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
to0
in theamplify/backend/api/<apiName>/parameters.json
file and executeamplify push
. - Create a new API key by setting
CreateAPIKey
to1
in theamplify/backend/api/<apiName>/parameters.json
file and executeamplify push
.
Delete the existing API Key
{ "CreateAPIKey": 0}
Create new API Key
{ "CreateAPIKey": 1}
APIKeyExpirationEpoch
Resets the API Key to expire 1 week after the next amplify push
{ "APIKeyExpirationEpoch": 0}
Do not create an API key
{ "APIKeyExpirationEpoch": -1}
Set a custom API key expiration date
{ "APIKeyExpirationEpoch": 1544745428}
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".
{ "DynamoDBBillingMode": "PAY_PER_REQUEST"}
DynamoDBModelTableReadIOPS
Override the default read IOPS provisioned for each @model table
Only valid if the "DynamoDBBillingMode" is set to "PROVISIONED"
{ "DynamoDBModelTableReadIOPS": 5}
DynamoDBModelTableWriteIOPS
Override the default write IOPS provisioned for each @model table
Only valid if the "DynamoDBBillingMode" is set to "PROVISIONED"
{ "DynamoDBModelTableWriteIOPS": 5}
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
{ "DynamoDBEnablePointInTimeRecovery": true}
ElasticSearchStreamingFunctionName
Override the name of the AWS Lambda searchable streaming function
{ "ElasticSearchStreamingFunctionName": "CustomFunctionName"}
ElasticSearchInstanceCount
Override the number of instances launched into the OpenSearch domain created by @searchable
{ "ElasticSearchInstanceCount": 1}
ElasticSearchInstanceType
Override the type of instance launched into the OpenSearch domain created by @searchable
{ "ElasticSearchInstanceType": "t2.small.elasticsearch"}
ElasticSearchEBSVolumeGB
Override the amount of disk space allocated to each instance in the OpenSearch domain created by @searchable
{ "ElasticSearchEBSVolumeGB": 10}
ElasticSearchStreamingLambdaRuntime
Override the runtime for the streaming lambda function used to stream data from DynamoDB into OpenSearch
{ "ElasticSearchStreamingLambdaRuntime": "python3.9"}
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.
type Task @model @auth( rules: [ { allow: groups groups: ["Managers"] operations: [create, update, delete] } { allow: groups, groups: ["Employees"], operations: [read, list] } ] ) { id: ID! title: String! description: String status: String}type PrivateNote @model @auth(rules: [{ allow: owner }]) { id: ID! content: String!}