2024/02/12 - AWS AppSync - 16 updated api methods
Changes Adds support for new options on GraphqlAPIs, Resolvers and Data Sources for emitting Amazon CloudWatch metrics for enhanced monitoring of AppSync APIs.
{'healthMetricsConfig': 'ENABLED | DISABLED'}Response
{'apiCache': {'healthMetricsConfig': 'ENABLED | DISABLED'}}
Creates a cache for the GraphQL API.
See also: AWS API Documentation
Request Syntax
client.create_api_cache( apiId='string', ttl=123, transitEncryptionEnabled=True|False, atRestEncryptionEnabled=True|False, apiCachingBehavior='FULL_REQUEST_CACHING'|'PER_RESOLVER_CACHING', type='T2_SMALL'|'T2_MEDIUM'|'R4_LARGE'|'R4_XLARGE'|'R4_2XLARGE'|'R4_4XLARGE'|'R4_8XLARGE'|'SMALL'|'MEDIUM'|'LARGE'|'XLARGE'|'LARGE_2X'|'LARGE_4X'|'LARGE_8X'|'LARGE_12X', healthMetricsConfig='ENABLED'|'DISABLED' )
string
[REQUIRED]
The GraphQL API ID.
integer
[REQUIRED]
TTL in seconds for cache entries.
Valid values are 1–3,600 seconds.
boolean
Transit encryption flag when connecting to cache. You cannot update this setting after creation.
boolean
At-rest encryption flag for cache. You cannot update this setting after creation.
string
[REQUIRED]
Caching behavior.
FULL_REQUEST_CACHING : All requests are fully cached.
PER_RESOLVER_CACHING : Individual resolvers that you specify are cached.
string
[REQUIRED]
The cache instance type. Valid values are
SMALL
MEDIUM
LARGE
XLARGE
LARGE_2X
LARGE_4X
LARGE_8X (not available in all regions)
LARGE_12X
Historically, instance types were identified by an EC2-style value. As of July 2020, this is deprecated, and the generic identifiers above should be used.
The following legacy instance types are available, but their use is discouraged:
T2_SMALL : A t2.small instance type.
T2_MEDIUM : A t2.medium instance type.
R4_LARGE : A r4.large instance type.
R4_XLARGE : A r4.xlarge instance type.
R4_2XLARGE : A r4.2xlarge instance type.
R4_4XLARGE : A r4.4xlarge instance type.
R4_8XLARGE : A r4.8xlarge instance type.
string
Controls how cache health metrics will be emitted to CloudWatch. Cache health metrics include:
NetworkBandwidthOutAllowanceExceeded: The number of times a specified GraphQL operation was called.
EngineCPUUtilization: The number of GraphQL errors that occurred during a specified GraphQL operation.
Metrics will be recorded by API ID. You can set the value to ENABLED or DISABLED .
dict
Response Syntax
{ 'apiCache': { 'ttl': 123, 'apiCachingBehavior': 'FULL_REQUEST_CACHING'|'PER_RESOLVER_CACHING', 'transitEncryptionEnabled': True|False, 'atRestEncryptionEnabled': True|False, 'type': 'T2_SMALL'|'T2_MEDIUM'|'R4_LARGE'|'R4_XLARGE'|'R4_2XLARGE'|'R4_4XLARGE'|'R4_8XLARGE'|'SMALL'|'MEDIUM'|'LARGE'|'XLARGE'|'LARGE_2X'|'LARGE_4X'|'LARGE_8X'|'LARGE_12X', 'status': 'AVAILABLE'|'CREATING'|'DELETING'|'MODIFYING'|'FAILED', 'healthMetricsConfig': 'ENABLED'|'DISABLED' } }
Response Structure
(dict) --
Represents the output of a CreateApiCache operation.
apiCache (dict) --
The ApiCache object.
ttl (integer) --
TTL in seconds for cache entries.
Valid values are 1–3,600 seconds.
apiCachingBehavior (string) --
Caching behavior.
FULL_REQUEST_CACHING : All requests are fully cached.
PER_RESOLVER_CACHING : Individual resolvers that you specify are cached.
transitEncryptionEnabled (boolean) --
Transit encryption flag when connecting to cache. You cannot update this setting after creation.
atRestEncryptionEnabled (boolean) --
At-rest encryption flag for cache. You cannot update this setting after creation.
type (string) --
The cache instance type. Valid values are
SMALL
MEDIUM
LARGE
XLARGE
LARGE_2X
LARGE_4X
LARGE_8X (not available in all regions)
LARGE_12X
Historically, instance types were identified by an EC2-style value. As of July 2020, this is deprecated, and the generic identifiers above should be used.
The following legacy instance types are available, but their use is discouraged:
T2_SMALL : A t2.small instance type.
T2_MEDIUM : A t2.medium instance type.
R4_LARGE : A r4.large instance type.
R4_XLARGE : A r4.xlarge instance type.
R4_2XLARGE : A r4.2xlarge instance type.
R4_4XLARGE : A r4.4xlarge instance type.
R4_8XLARGE : A r4.8xlarge instance type.
status (string) --
The cache instance status.
AVAILABLE : The instance is available for use.
CREATING : The instance is currently creating.
DELETING : The instance is currently deleting.
MODIFYING : The instance is currently modifying.
FAILED : The instance has failed creation.
healthMetricsConfig (string) --
Controls how cache health metrics will be emitted to CloudWatch. Cache health metrics include:
NetworkBandwidthOutAllowanceExceeded: The network packets dropped because the throughput exceeded the aggregated bandwidth limit. This is useful for diagnosing bottlenecks in a cache configuration.
EngineCPUUtilization: The CPU utilization (percentage) allocated to the Redis process. This is useful for diagnosing bottlenecks in a cache configuration.
Metrics will be recorded by API ID. You can set the value to ENABLED or DISABLED .
{'metricsConfig': 'ENABLED | DISABLED'}Response
{'dataSource': {'metricsConfig': 'ENABLED | DISABLED'}}
Creates a DataSource object.
See also: AWS API Documentation
Request Syntax
client.create_data_source( apiId='string', name='string', description='string', type='AWS_LAMBDA'|'AMAZON_DYNAMODB'|'AMAZON_ELASTICSEARCH'|'NONE'|'HTTP'|'RELATIONAL_DATABASE'|'AMAZON_OPENSEARCH_SERVICE'|'AMAZON_EVENTBRIDGE', serviceRoleArn='string', dynamodbConfig={ 'tableName': 'string', 'awsRegion': 'string', 'useCallerCredentials': True|False, 'deltaSyncConfig': { 'baseTableTTL': 123, 'deltaSyncTableName': 'string', 'deltaSyncTableTTL': 123 }, 'versioned': True|False }, lambdaConfig={ 'lambdaFunctionArn': 'string' }, elasticsearchConfig={ 'endpoint': 'string', 'awsRegion': 'string' }, openSearchServiceConfig={ 'endpoint': 'string', 'awsRegion': 'string' }, httpConfig={ 'endpoint': 'string', 'authorizationConfig': { 'authorizationType': 'AWS_IAM', 'awsIamConfig': { 'signingRegion': 'string', 'signingServiceName': 'string' } } }, relationalDatabaseConfig={ 'relationalDatabaseSourceType': 'RDS_HTTP_ENDPOINT', 'rdsHttpEndpointConfig': { 'awsRegion': 'string', 'dbClusterIdentifier': 'string', 'databaseName': 'string', 'schema': 'string', 'awsSecretStoreArn': 'string' } }, eventBridgeConfig={ 'eventBusArn': 'string' }, metricsConfig='ENABLED'|'DISABLED' )
string
[REQUIRED]
The API ID for the GraphQL API for the DataSource .
string
[REQUIRED]
A user-supplied name for the DataSource .
string
A description of the DataSource .
string
[REQUIRED]
The type of the DataSource .
string
The Identity and Access Management (IAM) service role Amazon Resource Name (ARN) for the data source. The system assumes this role when accessing the data source.
dict
Amazon DynamoDB settings.
tableName (string) -- [REQUIRED]
The table name.
awsRegion (string) -- [REQUIRED]
The Amazon Web Services Region.
useCallerCredentials (boolean) --
Set to TRUE to use Amazon Cognito credentials with this data source.
deltaSyncConfig (dict) --
The DeltaSyncConfig for a versioned data source.
baseTableTTL (integer) --
The number of minutes that an Item is stored in the data source.
deltaSyncTableName (string) --
The Delta Sync table name.
deltaSyncTableTTL (integer) --
The number of minutes that a Delta Sync log entry is stored in the Delta Sync table.
versioned (boolean) --
Set to TRUE to use Conflict Detection and Resolution with this data source.
dict
Lambda settings.
lambdaFunctionArn (string) -- [REQUIRED]
The Amazon Resource Name (ARN) for the Lambda function.
dict
Amazon OpenSearch Service settings.
As of September 2021, Amazon Elasticsearch service is Amazon OpenSearch Service. This configuration is deprecated. For new data sources, use CreateDataSourceRequest$openSearchServiceConfig to create an OpenSearch data source.
endpoint (string) -- [REQUIRED]
The endpoint.
awsRegion (string) -- [REQUIRED]
The Amazon Web Services Region.
dict
Amazon OpenSearch Service settings.
endpoint (string) -- [REQUIRED]
The endpoint.
awsRegion (string) -- [REQUIRED]
The Amazon Web Services Region.
dict
HTTP endpoint settings.
endpoint (string) --
The HTTP URL endpoint. You can specify either the domain name or IP, and port combination, and the URL scheme must be HTTP or HTTPS. If you don't specify the port, AppSync uses the default port 80 for the HTTP endpoint and port 443 for HTTPS endpoints.
authorizationConfig (dict) --
The authorization configuration in case the HTTP endpoint requires authorization.
authorizationType (string) -- [REQUIRED]
The authorization type that the HTTP endpoint requires.
AWS_IAM : The authorization type is Signature Version 4 (SigV4).
awsIamConfig (dict) --
The Identity and Access Management (IAM) settings.
signingRegion (string) --
The signing Amazon Web Services Region for IAM authorization.
signingServiceName (string) --
The signing service name for IAM authorization.
dict
Relational database settings.
relationalDatabaseSourceType (string) --
Source type for the relational database.
RDS_HTTP_ENDPOINT : The relational database source type is an Amazon Relational Database Service (Amazon RDS) HTTP endpoint.
rdsHttpEndpointConfig (dict) --
Amazon RDS HTTP endpoint settings.
awsRegion (string) --
Amazon Web Services Region for Amazon RDS HTTP endpoint.
dbClusterIdentifier (string) --
Amazon RDS cluster Amazon Resource Name (ARN).
databaseName (string) --
Logical database name.
schema (string) --
Logical schema name.
awsSecretStoreArn (string) --
Amazon Web Services secret store Amazon Resource Name (ARN) for database credentials.
dict
Amazon EventBridge settings.
eventBusArn (string) -- [REQUIRED]
The ARN of the event bus. For more information about event buses, see Amazon EventBridge event buses .
string
Enables or disables enhanced data source metrics for specified data sources. Note that metricsConfig won't be used unless the dataSourceLevelMetricsBehavior value is set to PER_DATA_SOURCE_METRICS . If the dataSourceLevelMetricsBehavior is set to FULL_REQUEST_DATA_SOURCE_METRICS instead, metricsConfig will be ignored. However, you can still set its value.
metricsConfig can be ENABLED or DISABLED .
dict
Response Syntax
{ 'dataSource': { 'dataSourceArn': 'string', 'name': 'string', 'description': 'string', 'type': 'AWS_LAMBDA'|'AMAZON_DYNAMODB'|'AMAZON_ELASTICSEARCH'|'NONE'|'HTTP'|'RELATIONAL_DATABASE'|'AMAZON_OPENSEARCH_SERVICE'|'AMAZON_EVENTBRIDGE', 'serviceRoleArn': 'string', 'dynamodbConfig': { 'tableName': 'string', 'awsRegion': 'string', 'useCallerCredentials': True|False, 'deltaSyncConfig': { 'baseTableTTL': 123, 'deltaSyncTableName': 'string', 'deltaSyncTableTTL': 123 }, 'versioned': True|False }, 'lambdaConfig': { 'lambdaFunctionArn': 'string' }, 'elasticsearchConfig': { 'endpoint': 'string', 'awsRegion': 'string' }, 'openSearchServiceConfig': { 'endpoint': 'string', 'awsRegion': 'string' }, 'httpConfig': { 'endpoint': 'string', 'authorizationConfig': { 'authorizationType': 'AWS_IAM', 'awsIamConfig': { 'signingRegion': 'string', 'signingServiceName': 'string' } } }, 'relationalDatabaseConfig': { 'relationalDatabaseSourceType': 'RDS_HTTP_ENDPOINT', 'rdsHttpEndpointConfig': { 'awsRegion': 'string', 'dbClusterIdentifier': 'string', 'databaseName': 'string', 'schema': 'string', 'awsSecretStoreArn': 'string' } }, 'eventBridgeConfig': { 'eventBusArn': 'string' }, 'metricsConfig': 'ENABLED'|'DISABLED' } }
Response Structure
(dict) --
dataSource (dict) --
The DataSource object.
dataSourceArn (string) --
The data source Amazon Resource Name (ARN).
name (string) --
The name of the data source.
description (string) --
The description of the data source.
type (string) --
The type of the data source.
AWS_LAMBDA : The data source is an Lambda function.
AMAZON_DYNAMODB : The data source is an Amazon DynamoDB table.
AMAZON_ELASTICSEARCH : The data source is an Amazon OpenSearch Service domain.
AMAZON_OPENSEARCH_SERVICE : The data source is an Amazon OpenSearch Service domain.
AMAZON_EVENTBRIDGE : The data source is an Amazon EventBridge configuration.
NONE : There is no data source. Use this type when you want to invoke a GraphQL operation without connecting to a data source, such as when you're performing data transformation with resolvers or invoking a subscription from a mutation.
HTTP : The data source is an HTTP endpoint.
RELATIONAL_DATABASE : The data source is a relational database.
serviceRoleArn (string) --
The Identity and Access Management (IAM) service role Amazon Resource Name (ARN) for the data source. The system assumes this role when accessing the data source.
dynamodbConfig (dict) --
DynamoDB settings.
tableName (string) --
The table name.
awsRegion (string) --
The Amazon Web Services Region.
useCallerCredentials (boolean) --
Set to TRUE to use Amazon Cognito credentials with this data source.
deltaSyncConfig (dict) --
The DeltaSyncConfig for a versioned data source.
baseTableTTL (integer) --
The number of minutes that an Item is stored in the data source.
deltaSyncTableName (string) --
The Delta Sync table name.
deltaSyncTableTTL (integer) --
The number of minutes that a Delta Sync log entry is stored in the Delta Sync table.
versioned (boolean) --
Set to TRUE to use Conflict Detection and Resolution with this data source.
lambdaConfig (dict) --
Lambda settings.
lambdaFunctionArn (string) --
The Amazon Resource Name (ARN) for the Lambda function.
elasticsearchConfig (dict) --
Amazon OpenSearch Service settings.
endpoint (string) --
The endpoint.
awsRegion (string) --
The Amazon Web Services Region.
openSearchServiceConfig (dict) --
Amazon OpenSearch Service settings.
endpoint (string) --
The endpoint.
awsRegion (string) --
The Amazon Web Services Region.
httpConfig (dict) --
HTTP endpoint settings.
endpoint (string) --
The HTTP URL endpoint. You can specify either the domain name or IP, and port combination, and the URL scheme must be HTTP or HTTPS. If you don't specify the port, AppSync uses the default port 80 for the HTTP endpoint and port 443 for HTTPS endpoints.
authorizationConfig (dict) --
The authorization configuration in case the HTTP endpoint requires authorization.
authorizationType (string) --
The authorization type that the HTTP endpoint requires.
AWS_IAM : The authorization type is Signature Version 4 (SigV4).
awsIamConfig (dict) --
The Identity and Access Management (IAM) settings.
signingRegion (string) --
The signing Amazon Web Services Region for IAM authorization.
signingServiceName (string) --
The signing service name for IAM authorization.
relationalDatabaseConfig (dict) --
Relational database settings.
relationalDatabaseSourceType (string) --
Source type for the relational database.
RDS_HTTP_ENDPOINT : The relational database source type is an Amazon Relational Database Service (Amazon RDS) HTTP endpoint.
rdsHttpEndpointConfig (dict) --
Amazon RDS HTTP endpoint settings.
awsRegion (string) --
Amazon Web Services Region for Amazon RDS HTTP endpoint.
dbClusterIdentifier (string) --
Amazon RDS cluster Amazon Resource Name (ARN).
databaseName (string) --
Logical database name.
schema (string) --
Logical schema name.
awsSecretStoreArn (string) --
Amazon Web Services secret store Amazon Resource Name (ARN) for database credentials.
eventBridgeConfig (dict) --
Amazon EventBridge settings.
eventBusArn (string) --
The ARN of the event bus. For more information about event buses, see Amazon EventBridge event buses .
metricsConfig (string) --
Enables or disables enhanced data source metrics for specified data sources. Note that metricsConfig won't be used unless the dataSourceLevelMetricsBehavior value is set to PER_DATA_SOURCE_METRICS . If the dataSourceLevelMetricsBehavior is set to FULL_REQUEST_DATA_SOURCE_METRICS instead, metricsConfig will be ignored. However, you can still set its value.
metricsConfig can be ENABLED or DISABLED .
{'enhancedMetricsConfig': {'dataSourceLevelMetricsBehavior': 'FULL_REQUEST_DATA_SOURCE_METRICS ' '| ' 'PER_DATA_SOURCE_METRICS', 'operationLevelMetricsConfig': 'ENABLED | DISABLED', 'resolverLevelMetricsBehavior': 'FULL_REQUEST_RESOLVER_METRICS ' '| ' 'PER_RESOLVER_METRICS'}}Response
{'graphqlApi': {'enhancedMetricsConfig': {'dataSourceLevelMetricsBehavior': 'FULL_REQUEST_DATA_SOURCE_METRICS ' '| ' 'PER_DATA_SOURCE_METRICS', 'operationLevelMetricsConfig': 'ENABLED ' '| ' 'DISABLED', 'resolverLevelMetricsBehavior': 'FULL_REQUEST_RESOLVER_METRICS ' '| ' 'PER_RESOLVER_METRICS'}}}
Creates a GraphqlApi object.
See also: AWS API Documentation
Request Syntax
client.create_graphql_api( name='string', logConfig={ 'fieldLogLevel': 'NONE'|'ERROR'|'ALL', 'cloudWatchLogsRoleArn': 'string', 'excludeVerboseContent': True|False }, authenticationType='API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA', userPoolConfig={ 'userPoolId': 'string', 'awsRegion': 'string', 'defaultAction': 'ALLOW'|'DENY', 'appIdClientRegex': 'string' }, openIDConnectConfig={ 'issuer': 'string', 'clientId': 'string', 'iatTTL': 123, 'authTTL': 123 }, tags={ 'string': 'string' }, additionalAuthenticationProviders=[ { 'authenticationType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA', 'openIDConnectConfig': { 'issuer': 'string', 'clientId': 'string', 'iatTTL': 123, 'authTTL': 123 }, 'userPoolConfig': { 'userPoolId': 'string', 'awsRegion': 'string', 'appIdClientRegex': 'string' }, 'lambdaAuthorizerConfig': { 'authorizerResultTtlInSeconds': 123, 'authorizerUri': 'string', 'identityValidationExpression': 'string' } }, ], xrayEnabled=True|False, lambdaAuthorizerConfig={ 'authorizerResultTtlInSeconds': 123, 'authorizerUri': 'string', 'identityValidationExpression': 'string' }, visibility='GLOBAL'|'PRIVATE', apiType='GRAPHQL'|'MERGED', mergedApiExecutionRoleArn='string', ownerContact='string', introspectionConfig='ENABLED'|'DISABLED', queryDepthLimit=123, resolverCountLimit=123, enhancedMetricsConfig={ 'resolverLevelMetricsBehavior': 'FULL_REQUEST_RESOLVER_METRICS'|'PER_RESOLVER_METRICS', 'dataSourceLevelMetricsBehavior': 'FULL_REQUEST_DATA_SOURCE_METRICS'|'PER_DATA_SOURCE_METRICS', 'operationLevelMetricsConfig': 'ENABLED'|'DISABLED' } )
string
[REQUIRED]
A user-supplied name for the GraphqlApi .
dict
The Amazon CloudWatch Logs configuration.
fieldLogLevel (string) -- [REQUIRED]
The field logging level. Values can be NONE, ERROR, or ALL.
NONE : No field-level logs are captured.
ERROR : Logs the following information only for the fields that are in error:
The error section in the server response.
Field-level errors.
The generated request/response functions that got resolved for error fields.
ALL : The following information is logged for all fields in the query:
Field-level tracing information.
The generated request/response functions that got resolved for each field.
cloudWatchLogsRoleArn (string) -- [REQUIRED]
The service role that AppSync assumes to publish to CloudWatch logs in your account.
excludeVerboseContent (boolean) --
Set to TRUE to exclude sections that contain information such as headers, context, and evaluated mapping templates, regardless of logging level.
string
[REQUIRED]
The authentication type: API key, Identity and Access Management (IAM), OpenID Connect (OIDC), Amazon Cognito user pools, or Lambda.
dict
The Amazon Cognito user pool configuration.
userPoolId (string) -- [REQUIRED]
The user pool ID.
awsRegion (string) -- [REQUIRED]
The Amazon Web Services Region in which the user pool was created.
defaultAction (string) -- [REQUIRED]
The action that you want your GraphQL API to take when a request that uses Amazon Cognito user pool authentication doesn't match the Amazon Cognito user pool configuration.
appIdClientRegex (string) --
A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.
dict
The OIDC configuration.
issuer (string) -- [REQUIRED]
The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of iss in the ID token.
clientId (string) --
The client identifier of the relying party at the OpenID identity provider. This identifier is typically obtained when the relying party is registered with the OpenID identity provider. You can specify a regular expression so that AppSync can validate against multiple client identifiers at a time.
iatTTL (integer) --
The number of milliseconds that a token is valid after it's issued to a user.
authTTL (integer) --
The number of milliseconds that a token is valid after being authenticated.
dict
A TagMap object.
(string) --
The key for the tag.
(string) --
The value for the tag.
list
A list of additional authentication providers for the GraphqlApi API.
(dict) --
Describes an additional authentication provider.
authenticationType (string) --
The authentication type: API key, Identity and Access Management (IAM), OpenID Connect (OIDC), Amazon Cognito user pools, or Lambda.
openIDConnectConfig (dict) --
The OIDC configuration.
issuer (string) -- [REQUIRED]
The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of iss in the ID token.
clientId (string) --
The client identifier of the relying party at the OpenID identity provider. This identifier is typically obtained when the relying party is registered with the OpenID identity provider. You can specify a regular expression so that AppSync can validate against multiple client identifiers at a time.
iatTTL (integer) --
The number of milliseconds that a token is valid after it's issued to a user.
authTTL (integer) --
The number of milliseconds that a token is valid after being authenticated.
userPoolConfig (dict) --
The Amazon Cognito user pool configuration.
userPoolId (string) -- [REQUIRED]
The user pool ID.
awsRegion (string) -- [REQUIRED]
The Amazon Web Services Region in which the user pool was created.
appIdClientRegex (string) --
A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.
lambdaAuthorizerConfig (dict) --
Configuration for Lambda function authorization.
authorizerResultTtlInSeconds (integer) --
The number of seconds a response should be cached for. The default is 0 seconds, which disables caching. If you don't specify a value for authorizerResultTtlInSeconds , the default value is used. The maximum value is one hour (3600 seconds). The Lambda function can override this by returning a ttlOverride key in its response.
authorizerUri (string) -- [REQUIRED]
The Amazon Resource Name (ARN) of the Lambda function to be called for authorization. This can be a standard Lambda ARN, a version ARN (.../v3 ), or an alias ARN.
Note : This Lambda function must have the following resource-based policy assigned to it. When configuring Lambda authorizers in the console, this is done for you. To use the Command Line Interface (CLI), run the following:
aws lambda add-permission --function-name "arn:aws:lambda:us-east-2:111122223333:function:my-function" --statement-id "appsync" --principal appsync.amazonaws.com --action lambda:InvokeFunction
identityValidationExpression (string) --
A regular expression for validation of tokens before the Lambda function is called.
boolean
A flag indicating whether to use X-Ray tracing for the GraphqlApi .
dict
Configuration for Lambda function authorization.
authorizerResultTtlInSeconds (integer) --
The number of seconds a response should be cached for. The default is 0 seconds, which disables caching. If you don't specify a value for authorizerResultTtlInSeconds , the default value is used. The maximum value is one hour (3600 seconds). The Lambda function can override this by returning a ttlOverride key in its response.
authorizerUri (string) -- [REQUIRED]
The Amazon Resource Name (ARN) of the Lambda function to be called for authorization. This can be a standard Lambda ARN, a version ARN (.../v3 ), or an alias ARN.
Note : This Lambda function must have the following resource-based policy assigned to it. When configuring Lambda authorizers in the console, this is done for you. To use the Command Line Interface (CLI), run the following:
aws lambda add-permission --function-name "arn:aws:lambda:us-east-2:111122223333:function:my-function" --statement-id "appsync" --principal appsync.amazonaws.com --action lambda:InvokeFunction
identityValidationExpression (string) --
A regular expression for validation of tokens before the Lambda function is called.
string
Sets the value of the GraphQL API to public (GLOBAL ) or private (PRIVATE ). If no value is provided, the visibility will be set to GLOBAL by default. This value cannot be changed once the API has been created.
string
The value that indicates whether the GraphQL API is a standard API (GRAPHQL ) or merged API (MERGED ).
string
The Identity and Access Management service role ARN for a merged API. The AppSync service assumes this role on behalf of the Merged API to validate access to source APIs at runtime and to prompt the AUTO_MERGE to update the merged API endpoint with the source API changes automatically.
string
The owner contact information for an API resource.
This field accepts any string input with a length of 0 - 256 characters.
string
Sets the value of the GraphQL API to enable (ENABLED ) or disable (DISABLED ) introspection. If no value is provided, the introspection configuration will be set to ENABLED by default. This field will produce an error if the operation attempts to use the introspection feature while this field is disabled.
For more information about introspection, see GraphQL introspection .
integer
The maximum depth a query can have in a single request. Depth refers to the amount of nested levels allowed in the body of query. The default value is 0 (or unspecified), which indicates there's no depth limit. If you set a limit, it can be between 1 and 75 nested levels. This field will produce a limit error if the operation falls out of bounds.
Note that fields can still be set to nullable or non-nullable. If a non-nullable field produces an error, the error will be thrown upwards to the first nullable field available.
integer
The maximum number of resolvers that can be invoked in a single request. The default value is 0 (or unspecified), which will set the limit to 10000 . When specified, the limit value can be between 1 and 10000 . This field will produce a limit error if the operation falls out of bounds.
dict
The enhancedMetricsConfig object.
resolverLevelMetricsBehavior (string) -- [REQUIRED]
Controls how resolver metrics will be emitted to CloudWatch. Resolver metrics include:
GraphQL errors: The number of GraphQL errors that occurred.
Requests: The number of invocations that occurred during a request.
Latency: The time to complete a resolver invocation.
Cache hits: The number of cache hits during a request.
Cache misses: The number of cache misses during a request.
These metrics can be emitted to CloudWatch per resolver or for all resolvers in the request. Metrics will be recorded by API ID and resolver name. resolverLevelMetricsBehavior accepts one of these values at a time:
FULL_REQUEST_RESOLVER_METRICS : Records and emits metric data for all resolvers in the request.
PER_RESOLVER_METRICS : Records and emits metric data for resolvers that have the metricConfig value set to ENABLED .
dataSourceLevelMetricsBehavior (string) -- [REQUIRED]
Controls how data source metrics will be emitted to CloudWatch. Data source metrics include:
Requests: The number of invocations that occured during a request.
Latency: The time to complete a data source invocation.
Errors: The number of errors that occurred during a data source invocation.
These metrics can be emitted to CloudWatch per data source or for all data sources in the request. Metrics will be recorded by API ID and data source name. dataSourceLevelMetricsBehavior accepts one of these values at a time:
FULL_REQUEST_DATA_SOURCE_METRICS : Records and emits metric data for all data sources in the request.
PER_DATA_SOURCE_METRICS : Records and emits metric data for data sources that have the metricConfig value set to ENABLED .
operationLevelMetricsConfig (string) -- [REQUIRED]
Controls how operation metrics will be emitted to CloudWatch. Operation metrics include:
Requests: The number of times a specified GraphQL operation was called.
GraphQL errors: The number of GraphQL errors that occurred during a specified GraphQL operation.
Metrics will be recorded by API ID and operation name. You can set the value to ENABLED or DISABLED .
dict
Response Syntax
{ 'graphqlApi': { 'name': 'string', 'apiId': 'string', 'authenticationType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA', 'logConfig': { 'fieldLogLevel': 'NONE'|'ERROR'|'ALL', 'cloudWatchLogsRoleArn': 'string', 'excludeVerboseContent': True|False }, 'userPoolConfig': { 'userPoolId': 'string', 'awsRegion': 'string', 'defaultAction': 'ALLOW'|'DENY', 'appIdClientRegex': 'string' }, 'openIDConnectConfig': { 'issuer': 'string', 'clientId': 'string', 'iatTTL': 123, 'authTTL': 123 }, 'arn': 'string', 'uris': { 'string': 'string' }, 'tags': { 'string': 'string' }, 'additionalAuthenticationProviders': [ { 'authenticationType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA', 'openIDConnectConfig': { 'issuer': 'string', 'clientId': 'string', 'iatTTL': 123, 'authTTL': 123 }, 'userPoolConfig': { 'userPoolId': 'string', 'awsRegion': 'string', 'appIdClientRegex': 'string' }, 'lambdaAuthorizerConfig': { 'authorizerResultTtlInSeconds': 123, 'authorizerUri': 'string', 'identityValidationExpression': 'string' } }, ], 'xrayEnabled': True|False, 'wafWebAclArn': 'string', 'lambdaAuthorizerConfig': { 'authorizerResultTtlInSeconds': 123, 'authorizerUri': 'string', 'identityValidationExpression': 'string' }, 'dns': { 'string': 'string' }, 'visibility': 'GLOBAL'|'PRIVATE', 'apiType': 'GRAPHQL'|'MERGED', 'mergedApiExecutionRoleArn': 'string', 'owner': 'string', 'ownerContact': 'string', 'introspectionConfig': 'ENABLED'|'DISABLED', 'queryDepthLimit': 123, 'resolverCountLimit': 123, 'enhancedMetricsConfig': { 'resolverLevelMetricsBehavior': 'FULL_REQUEST_RESOLVER_METRICS'|'PER_RESOLVER_METRICS', 'dataSourceLevelMetricsBehavior': 'FULL_REQUEST_DATA_SOURCE_METRICS'|'PER_DATA_SOURCE_METRICS', 'operationLevelMetricsConfig': 'ENABLED'|'DISABLED' } } }
Response Structure
(dict) --
graphqlApi (dict) --
The GraphqlApi .
name (string) --
The API name.
apiId (string) --
The API ID.
authenticationType (string) --
The authentication type.
logConfig (dict) --
The Amazon CloudWatch Logs configuration.
fieldLogLevel (string) --
The field logging level. Values can be NONE, ERROR, or ALL.
NONE : No field-level logs are captured.
ERROR : Logs the following information only for the fields that are in error:
The error section in the server response.
Field-level errors.
The generated request/response functions that got resolved for error fields.
ALL : The following information is logged for all fields in the query:
Field-level tracing information.
The generated request/response functions that got resolved for each field.
cloudWatchLogsRoleArn (string) --
The service role that AppSync assumes to publish to CloudWatch logs in your account.
excludeVerboseContent (boolean) --
Set to TRUE to exclude sections that contain information such as headers, context, and evaluated mapping templates, regardless of logging level.
userPoolConfig (dict) --
The Amazon Cognito user pool configuration.
userPoolId (string) --
The user pool ID.
awsRegion (string) --
The Amazon Web Services Region in which the user pool was created.
defaultAction (string) --
The action that you want your GraphQL API to take when a request that uses Amazon Cognito user pool authentication doesn't match the Amazon Cognito user pool configuration.
appIdClientRegex (string) --
A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.
openIDConnectConfig (dict) --
The OpenID Connect configuration.
issuer (string) --
The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of iss in the ID token.
clientId (string) --
The client identifier of the relying party at the OpenID identity provider. This identifier is typically obtained when the relying party is registered with the OpenID identity provider. You can specify a regular expression so that AppSync can validate against multiple client identifiers at a time.
iatTTL (integer) --
The number of milliseconds that a token is valid after it's issued to a user.
authTTL (integer) --
The number of milliseconds that a token is valid after being authenticated.
arn (string) --
The Amazon Resource Name (ARN).
uris (dict) --
The URIs.
(string) --
(string) --
tags (dict) --
The tags.
(string) --
The key for the tag.
(string) --
The value for the tag.
additionalAuthenticationProviders (list) --
A list of additional authentication providers for the GraphqlApi API.
(dict) --
Describes an additional authentication provider.
authenticationType (string) --
The authentication type: API key, Identity and Access Management (IAM), OpenID Connect (OIDC), Amazon Cognito user pools, or Lambda.
openIDConnectConfig (dict) --
The OIDC configuration.
issuer (string) --
The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of iss in the ID token.
clientId (string) --
The client identifier of the relying party at the OpenID identity provider. This identifier is typically obtained when the relying party is registered with the OpenID identity provider. You can specify a regular expression so that AppSync can validate against multiple client identifiers at a time.
iatTTL (integer) --
The number of milliseconds that a token is valid after it's issued to a user.
authTTL (integer) --
The number of milliseconds that a token is valid after being authenticated.
userPoolConfig (dict) --
The Amazon Cognito user pool configuration.
userPoolId (string) --
The user pool ID.
awsRegion (string) --
The Amazon Web Services Region in which the user pool was created.
appIdClientRegex (string) --
A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.
lambdaAuthorizerConfig (dict) --
Configuration for Lambda function authorization.
authorizerResultTtlInSeconds (integer) --
The number of seconds a response should be cached for. The default is 0 seconds, which disables caching. If you don't specify a value for authorizerResultTtlInSeconds , the default value is used. The maximum value is one hour (3600 seconds). The Lambda function can override this by returning a ttlOverride key in its response.
authorizerUri (string) --
The Amazon Resource Name (ARN) of the Lambda function to be called for authorization. This can be a standard Lambda ARN, a version ARN (.../v3 ), or an alias ARN.
Note : This Lambda function must have the following resource-based policy assigned to it. When configuring Lambda authorizers in the console, this is done for you. To use the Command Line Interface (CLI), run the following:
aws lambda add-permission --function-name "arn:aws:lambda:us-east-2:111122223333:function:my-function" --statement-id "appsync" --principal appsync.amazonaws.com --action lambda:InvokeFunction
identityValidationExpression (string) --
A regular expression for validation of tokens before the Lambda function is called.
xrayEnabled (boolean) --
A flag indicating whether to use X-Ray tracing for this GraphqlApi .
wafWebAclArn (string) --
The ARN of the WAF access control list (ACL) associated with this GraphqlApi , if one exists.
lambdaAuthorizerConfig (dict) --
Configuration for Lambda function authorization.
authorizerResultTtlInSeconds (integer) --
The number of seconds a response should be cached for. The default is 0 seconds, which disables caching. If you don't specify a value for authorizerResultTtlInSeconds , the default value is used. The maximum value is one hour (3600 seconds). The Lambda function can override this by returning a ttlOverride key in its response.
authorizerUri (string) --
The Amazon Resource Name (ARN) of the Lambda function to be called for authorization. This can be a standard Lambda ARN, a version ARN (.../v3 ), or an alias ARN.
Note : This Lambda function must have the following resource-based policy assigned to it. When configuring Lambda authorizers in the console, this is done for you. To use the Command Line Interface (CLI), run the following:
aws lambda add-permission --function-name "arn:aws:lambda:us-east-2:111122223333:function:my-function" --statement-id "appsync" --principal appsync.amazonaws.com --action lambda:InvokeFunction
identityValidationExpression (string) --
A regular expression for validation of tokens before the Lambda function is called.
dns (dict) --
The DNS records for the API.
(string) --
(string) --
visibility (string) --
Sets the value of the GraphQL API to public (GLOBAL ) or private (PRIVATE ). If no value is provided, the visibility will be set to GLOBAL by default. This value cannot be changed once the API has been created.
apiType (string) --
The value that indicates whether the GraphQL API is a standard API (GRAPHQL ) or merged API (MERGED ).
mergedApiExecutionRoleArn (string) --
The Identity and Access Management service role ARN for a merged API. The AppSync service assumes this role on behalf of the Merged API to validate access to source APIs at runtime and to prompt the AUTO_MERGE to update the merged API endpoint with the source API changes automatically.
owner (string) --
The account owner of the GraphQL API.
ownerContact (string) --
The owner contact information for an API resource.
This field accepts any string input with a length of 0 - 256 characters.
introspectionConfig (string) --
Sets the value of the GraphQL API to enable (ENABLED ) or disable (DISABLED ) introspection. If no value is provided, the introspection configuration will be set to ENABLED by default. This field will produce an error if the operation attempts to use the introspection feature while this field is disabled.
For more information about introspection, see GraphQL introspection .
queryDepthLimit (integer) --
The maximum depth a query can have in a single request. Depth refers to the amount of nested levels allowed in the body of query. The default value is 0 (or unspecified), which indicates there's no depth limit. If you set a limit, it can be between 1 and 75 nested levels. This field will produce a limit error if the operation falls out of bounds.
Note that fields can still be set to nullable or non-nullable. If a non-nullable field produces an error, the error will be thrown upwards to the first nullable field available.
resolverCountLimit (integer) --
The maximum number of resolvers that can be invoked in a single request. The default value is 0 (or unspecified), which will set the limit to 10000 . When specified, the limit value can be between 1 and 10000 . This field will produce a limit error if the operation falls out of bounds.
enhancedMetricsConfig (dict) --
The enhancedMetricsConfig object.
resolverLevelMetricsBehavior (string) --
Controls how resolver metrics will be emitted to CloudWatch. Resolver metrics include:
GraphQL errors: The number of GraphQL errors that occurred.
Requests: The number of invocations that occurred during a request.
Latency: The time to complete a resolver invocation.
Cache hits: The number of cache hits during a request.
Cache misses: The number of cache misses during a request.
These metrics can be emitted to CloudWatch per resolver or for all resolvers in the request. Metrics will be recorded by API ID and resolver name. resolverLevelMetricsBehavior accepts one of these values at a time:
FULL_REQUEST_RESOLVER_METRICS : Records and emits metric data for all resolvers in the request.
PER_RESOLVER_METRICS : Records and emits metric data for resolvers that have the metricConfig value set to ENABLED .
dataSourceLevelMetricsBehavior (string) --
Controls how data source metrics will be emitted to CloudWatch. Data source metrics include:
Requests: The number of invocations that occured during a request.
Latency: The time to complete a data source invocation.
Errors: The number of errors that occurred during a data source invocation.
These metrics can be emitted to CloudWatch per data source or for all data sources in the request. Metrics will be recorded by API ID and data source name. dataSourceLevelMetricsBehavior accepts one of these values at a time:
FULL_REQUEST_DATA_SOURCE_METRICS : Records and emits metric data for all data sources in the request.
PER_DATA_SOURCE_METRICS : Records and emits metric data for data sources that have the metricConfig value set to ENABLED .
operationLevelMetricsConfig (string) --
Controls how operation metrics will be emitted to CloudWatch. Operation metrics include:
Requests: The number of times a specified GraphQL operation was called.
GraphQL errors: The number of GraphQL errors that occurred during a specified GraphQL operation.
Metrics will be recorded by API ID and operation name. You can set the value to ENABLED or DISABLED .
{'metricsConfig': 'ENABLED | DISABLED'}Response
{'resolver': {'metricsConfig': 'ENABLED | DISABLED'}}
Creates a Resolver object.
A resolver converts incoming requests into a format that a data source can understand, and converts the data source's responses into GraphQL.
See also: AWS API Documentation
Request Syntax
client.create_resolver( apiId='string', typeName='string', fieldName='string', dataSourceName='string', requestMappingTemplate='string', responseMappingTemplate='string', kind='UNIT'|'PIPELINE', pipelineConfig={ 'functions': [ 'string', ] }, syncConfig={ 'conflictHandler': 'OPTIMISTIC_CONCURRENCY'|'LAMBDA'|'AUTOMERGE'|'NONE', 'conflictDetection': 'VERSION'|'NONE', 'lambdaConflictHandlerConfig': { 'lambdaConflictHandlerArn': 'string' } }, cachingConfig={ 'ttl': 123, 'cachingKeys': [ 'string', ] }, maxBatchSize=123, runtime={ 'name': 'APPSYNC_JS', 'runtimeVersion': 'string' }, code='string', metricsConfig='ENABLED'|'DISABLED' )
string
[REQUIRED]
The ID for the GraphQL API for which the resolver is being created.
string
[REQUIRED]
The name of the Type .
string
[REQUIRED]
The name of the field to attach the resolver to.
string
The name of the data source for which the resolver is being created.
string
The mapping template to use for requests.
A resolver uses a request mapping template to convert a GraphQL expression into a format that a data source can understand. Mapping templates are written in Apache Velocity Template Language (VTL).
VTL request mapping templates are optional when using an Lambda data source. For all other data sources, VTL request and response mapping templates are required.
string
The mapping template to use for responses from the data source.
string
The resolver type.
UNIT : A UNIT resolver type. A UNIT resolver is the default resolver type. You can use a UNIT resolver to run a GraphQL query against a single data source.
PIPELINE : A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of Function objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.
dict
The PipelineConfig .
functions (list) --
A list of Function objects.
(string) --
dict
The SyncConfig for a resolver attached to a versioned data source.
conflictHandler (string) --
The Conflict Resolution strategy to perform in the event of a conflict.
OPTIMISTIC_CONCURRENCY : Resolve conflicts by rejecting mutations when versions don't match the latest version at the server.
AUTOMERGE : Resolve conflicts with the Automerge conflict resolution strategy.
LAMBDA : Resolve conflicts with an Lambda function supplied in the LambdaConflictHandlerConfig .
conflictDetection (string) --
The Conflict Detection strategy to use.
VERSION : Detect conflicts based on object versions for this resolver.
NONE : Do not detect conflicts when invoking this resolver.
lambdaConflictHandlerConfig (dict) --
The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.
lambdaConflictHandlerArn (string) --
The Amazon Resource Name (ARN) for the Lambda function to use as the Conflict Handler.
dict
The caching configuration for the resolver.
ttl (integer) -- [REQUIRED]
The TTL in seconds for a resolver that has caching activated.
Valid values are 1–3,600 seconds.
cachingKeys (list) --
The caching keys for a resolver that has caching activated.
Valid values are entries from the $context.arguments , $context.source , and $context.identity maps.
(string) --
integer
The maximum batching size for a resolver.
dict
Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.
name (string) -- [REQUIRED]
The name of the runtime to use. Currently, the only allowed value is APPSYNC_JS .
runtimeVersion (string) -- [REQUIRED]
The version of the runtime to use. Currently, the only allowed version is 1.0.0 .
string
The resolver code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS .
string
Enables or disables enhanced resolver metrics for specified resolvers. Note that metricsConfig won't be used unless the resolverLevelMetricsBehavior value is set to PER_RESOLVER_METRICS . If the resolverLevelMetricsBehavior is set to FULL_REQUEST_RESOLVER_METRICS instead, metricsConfig will be ignored. However, you can still set its value.
metricsConfig can be ENABLED or DISABLED .
dict
Response Syntax
{ 'resolver': { 'typeName': 'string', 'fieldName': 'string', 'dataSourceName': 'string', 'resolverArn': 'string', 'requestMappingTemplate': 'string', 'responseMappingTemplate': 'string', 'kind': 'UNIT'|'PIPELINE', 'pipelineConfig': { 'functions': [ 'string', ] }, 'syncConfig': { 'conflictHandler': 'OPTIMISTIC_CONCURRENCY'|'LAMBDA'|'AUTOMERGE'|'NONE', 'conflictDetection': 'VERSION'|'NONE', 'lambdaConflictHandlerConfig': { 'lambdaConflictHandlerArn': 'string' } }, 'cachingConfig': { 'ttl': 123, 'cachingKeys': [ 'string', ] }, 'maxBatchSize': 123, 'runtime': { 'name': 'APPSYNC_JS', 'runtimeVersion': 'string' }, 'code': 'string', 'metricsConfig': 'ENABLED'|'DISABLED' } }
Response Structure
(dict) --
resolver (dict) --
The Resolver object.
typeName (string) --
The resolver type name.
fieldName (string) --
The resolver field name.
dataSourceName (string) --
The resolver data source name.
resolverArn (string) --
The resolver Amazon Resource Name (ARN).
requestMappingTemplate (string) --
The request mapping template.
responseMappingTemplate (string) --
The response mapping template.
kind (string) --
The resolver type.
UNIT : A UNIT resolver type. A UNIT resolver is the default resolver type. You can use a UNIT resolver to run a GraphQL query against a single data source.
PIPELINE : A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of Function objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.
pipelineConfig (dict) --
The PipelineConfig .
functions (list) --
A list of Function objects.
(string) --
syncConfig (dict) --
The SyncConfig for a resolver attached to a versioned data source.
conflictHandler (string) --
The Conflict Resolution strategy to perform in the event of a conflict.
OPTIMISTIC_CONCURRENCY : Resolve conflicts by rejecting mutations when versions don't match the latest version at the server.
AUTOMERGE : Resolve conflicts with the Automerge conflict resolution strategy.
LAMBDA : Resolve conflicts with an Lambda function supplied in the LambdaConflictHandlerConfig .
conflictDetection (string) --
The Conflict Detection strategy to use.
VERSION : Detect conflicts based on object versions for this resolver.
NONE : Do not detect conflicts when invoking this resolver.
lambdaConflictHandlerConfig (dict) --
The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.
lambdaConflictHandlerArn (string) --
The Amazon Resource Name (ARN) for the Lambda function to use as the Conflict Handler.
cachingConfig (dict) --
The caching configuration for the resolver.
ttl (integer) --
The TTL in seconds for a resolver that has caching activated.
Valid values are 1–3,600 seconds.
cachingKeys (list) --
The caching keys for a resolver that has caching activated.
Valid values are entries from the $context.arguments , $context.source , and $context.identity maps.
(string) --
maxBatchSize (integer) --
The maximum batching size for a resolver.
runtime (dict) --
Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.
name (string) --
The name of the runtime to use. Currently, the only allowed value is APPSYNC_JS .
runtimeVersion (string) --
The version of the runtime to use. Currently, the only allowed version is 1.0.0 .
code (string) --
The resolver code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS .
metricsConfig (string) --
Enables or disables enhanced resolver metrics for specified resolvers. Note that metricsConfig won't be used unless the resolverLevelMetricsBehavior value is set to PER_RESOLVER_METRICS . If the resolverLevelMetricsBehavior is set to FULL_REQUEST_RESOLVER_METRICS instead, metricsConfig will be ignored. However, you can still set its value.
metricsConfig can be ENABLED or DISABLED .
{'apiCache': {'healthMetricsConfig': 'ENABLED | DISABLED'}}
Retrieves an ApiCache object.
See also: AWS API Documentation
Request Syntax
client.get_api_cache( apiId='string' )
string
[REQUIRED]
The API ID.
dict
Response Syntax
{ 'apiCache': { 'ttl': 123, 'apiCachingBehavior': 'FULL_REQUEST_CACHING'|'PER_RESOLVER_CACHING', 'transitEncryptionEnabled': True|False, 'atRestEncryptionEnabled': True|False, 'type': 'T2_SMALL'|'T2_MEDIUM'|'R4_LARGE'|'R4_XLARGE'|'R4_2XLARGE'|'R4_4XLARGE'|'R4_8XLARGE'|'SMALL'|'MEDIUM'|'LARGE'|'XLARGE'|'LARGE_2X'|'LARGE_4X'|'LARGE_8X'|'LARGE_12X', 'status': 'AVAILABLE'|'CREATING'|'DELETING'|'MODIFYING'|'FAILED', 'healthMetricsConfig': 'ENABLED'|'DISABLED' } }
Response Structure
(dict) --
Represents the output of a GetApiCache operation.
apiCache (dict) --
The ApiCache object.
ttl (integer) --
TTL in seconds for cache entries.
Valid values are 1–3,600 seconds.
apiCachingBehavior (string) --
Caching behavior.
FULL_REQUEST_CACHING : All requests are fully cached.
PER_RESOLVER_CACHING : Individual resolvers that you specify are cached.
transitEncryptionEnabled (boolean) --
Transit encryption flag when connecting to cache. You cannot update this setting after creation.
atRestEncryptionEnabled (boolean) --
At-rest encryption flag for cache. You cannot update this setting after creation.
type (string) --
The cache instance type. Valid values are
SMALL
MEDIUM
LARGE
XLARGE
LARGE_2X
LARGE_4X
LARGE_8X (not available in all regions)
LARGE_12X
Historically, instance types were identified by an EC2-style value. As of July 2020, this is deprecated, and the generic identifiers above should be used.
The following legacy instance types are available, but their use is discouraged:
T2_SMALL : A t2.small instance type.
T2_MEDIUM : A t2.medium instance type.
R4_LARGE : A r4.large instance type.
R4_XLARGE : A r4.xlarge instance type.
R4_2XLARGE : A r4.2xlarge instance type.
R4_4XLARGE : A r4.4xlarge instance type.
R4_8XLARGE : A r4.8xlarge instance type.
status (string) --
The cache instance status.
AVAILABLE : The instance is available for use.
CREATING : The instance is currently creating.
DELETING : The instance is currently deleting.
MODIFYING : The instance is currently modifying.
FAILED : The instance has failed creation.
healthMetricsConfig (string) --
Controls how cache health metrics will be emitted to CloudWatch. Cache health metrics include:
NetworkBandwidthOutAllowanceExceeded: The network packets dropped because the throughput exceeded the aggregated bandwidth limit. This is useful for diagnosing bottlenecks in a cache configuration.
EngineCPUUtilization: The CPU utilization (percentage) allocated to the Redis process. This is useful for diagnosing bottlenecks in a cache configuration.
Metrics will be recorded by API ID. You can set the value to ENABLED or DISABLED .
{'dataSource': {'metricsConfig': 'ENABLED | DISABLED'}}
Retrieves a DataSource object.
See also: AWS API Documentation
Request Syntax
client.get_data_source( apiId='string', name='string' )
string
[REQUIRED]
The API ID.
string
[REQUIRED]
The name of the data source.
dict
Response Syntax
{ 'dataSource': { 'dataSourceArn': 'string', 'name': 'string', 'description': 'string', 'type': 'AWS_LAMBDA'|'AMAZON_DYNAMODB'|'AMAZON_ELASTICSEARCH'|'NONE'|'HTTP'|'RELATIONAL_DATABASE'|'AMAZON_OPENSEARCH_SERVICE'|'AMAZON_EVENTBRIDGE', 'serviceRoleArn': 'string', 'dynamodbConfig': { 'tableName': 'string', 'awsRegion': 'string', 'useCallerCredentials': True|False, 'deltaSyncConfig': { 'baseTableTTL': 123, 'deltaSyncTableName': 'string', 'deltaSyncTableTTL': 123 }, 'versioned': True|False }, 'lambdaConfig': { 'lambdaFunctionArn': 'string' }, 'elasticsearchConfig': { 'endpoint': 'string', 'awsRegion': 'string' }, 'openSearchServiceConfig': { 'endpoint': 'string', 'awsRegion': 'string' }, 'httpConfig': { 'endpoint': 'string', 'authorizationConfig': { 'authorizationType': 'AWS_IAM', 'awsIamConfig': { 'signingRegion': 'string', 'signingServiceName': 'string' } } }, 'relationalDatabaseConfig': { 'relationalDatabaseSourceType': 'RDS_HTTP_ENDPOINT', 'rdsHttpEndpointConfig': { 'awsRegion': 'string', 'dbClusterIdentifier': 'string', 'databaseName': 'string', 'schema': 'string', 'awsSecretStoreArn': 'string' } }, 'eventBridgeConfig': { 'eventBusArn': 'string' }, 'metricsConfig': 'ENABLED'|'DISABLED' } }
Response Structure
(dict) --
dataSource (dict) --
The DataSource object.
dataSourceArn (string) --
The data source Amazon Resource Name (ARN).
name (string) --
The name of the data source.
description (string) --
The description of the data source.
type (string) --
The type of the data source.
AWS_LAMBDA : The data source is an Lambda function.
AMAZON_DYNAMODB : The data source is an Amazon DynamoDB table.
AMAZON_ELASTICSEARCH : The data source is an Amazon OpenSearch Service domain.
AMAZON_OPENSEARCH_SERVICE : The data source is an Amazon OpenSearch Service domain.
AMAZON_EVENTBRIDGE : The data source is an Amazon EventBridge configuration.
NONE : There is no data source. Use this type when you want to invoke a GraphQL operation without connecting to a data source, such as when you're performing data transformation with resolvers or invoking a subscription from a mutation.
HTTP : The data source is an HTTP endpoint.
RELATIONAL_DATABASE : The data source is a relational database.
serviceRoleArn (string) --
The Identity and Access Management (IAM) service role Amazon Resource Name (ARN) for the data source. The system assumes this role when accessing the data source.
dynamodbConfig (dict) --
DynamoDB settings.
tableName (string) --
The table name.
awsRegion (string) --
The Amazon Web Services Region.
useCallerCredentials (boolean) --
Set to TRUE to use Amazon Cognito credentials with this data source.
deltaSyncConfig (dict) --
The DeltaSyncConfig for a versioned data source.
baseTableTTL (integer) --
The number of minutes that an Item is stored in the data source.
deltaSyncTableName (string) --
The Delta Sync table name.
deltaSyncTableTTL (integer) --
The number of minutes that a Delta Sync log entry is stored in the Delta Sync table.
versioned (boolean) --
Set to TRUE to use Conflict Detection and Resolution with this data source.
lambdaConfig (dict) --
Lambda settings.
lambdaFunctionArn (string) --
The Amazon Resource Name (ARN) for the Lambda function.
elasticsearchConfig (dict) --
Amazon OpenSearch Service settings.
endpoint (string) --
The endpoint.
awsRegion (string) --
The Amazon Web Services Region.
openSearchServiceConfig (dict) --
Amazon OpenSearch Service settings.
endpoint (string) --
The endpoint.
awsRegion (string) --
The Amazon Web Services Region.
httpConfig (dict) --
HTTP endpoint settings.
endpoint (string) --
The HTTP URL endpoint. You can specify either the domain name or IP, and port combination, and the URL scheme must be HTTP or HTTPS. If you don't specify the port, AppSync uses the default port 80 for the HTTP endpoint and port 443 for HTTPS endpoints.
authorizationConfig (dict) --
The authorization configuration in case the HTTP endpoint requires authorization.
authorizationType (string) --
The authorization type that the HTTP endpoint requires.
AWS_IAM : The authorization type is Signature Version 4 (SigV4).
awsIamConfig (dict) --
The Identity and Access Management (IAM) settings.
signingRegion (string) --
The signing Amazon Web Services Region for IAM authorization.
signingServiceName (string) --
The signing service name for IAM authorization.
relationalDatabaseConfig (dict) --
Relational database settings.
relationalDatabaseSourceType (string) --
Source type for the relational database.
RDS_HTTP_ENDPOINT : The relational database source type is an Amazon Relational Database Service (Amazon RDS) HTTP endpoint.
rdsHttpEndpointConfig (dict) --
Amazon RDS HTTP endpoint settings.
awsRegion (string) --
Amazon Web Services Region for Amazon RDS HTTP endpoint.
dbClusterIdentifier (string) --
Amazon RDS cluster Amazon Resource Name (ARN).
databaseName (string) --
Logical database name.
schema (string) --
Logical schema name.
awsSecretStoreArn (string) --
Amazon Web Services secret store Amazon Resource Name (ARN) for database credentials.
eventBridgeConfig (dict) --
Amazon EventBridge settings.
eventBusArn (string) --
The ARN of the event bus. For more information about event buses, see Amazon EventBridge event buses .
metricsConfig (string) --
Enables or disables enhanced data source metrics for specified data sources. Note that metricsConfig won't be used unless the dataSourceLevelMetricsBehavior value is set to PER_DATA_SOURCE_METRICS . If the dataSourceLevelMetricsBehavior is set to FULL_REQUEST_DATA_SOURCE_METRICS instead, metricsConfig will be ignored. However, you can still set its value.
metricsConfig can be ENABLED or DISABLED .
{'graphqlApi': {'enhancedMetricsConfig': {'dataSourceLevelMetricsBehavior': 'FULL_REQUEST_DATA_SOURCE_METRICS ' '| ' 'PER_DATA_SOURCE_METRICS', 'operationLevelMetricsConfig': 'ENABLED ' '| ' 'DISABLED', 'resolverLevelMetricsBehavior': 'FULL_REQUEST_RESOLVER_METRICS ' '| ' 'PER_RESOLVER_METRICS'}}}
Retrieves a GraphqlApi object.
See also: AWS API Documentation
Request Syntax
client.get_graphql_api( apiId='string' )
string
[REQUIRED]
The API ID for the GraphQL API.
dict
Response Syntax
{ 'graphqlApi': { 'name': 'string', 'apiId': 'string', 'authenticationType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA', 'logConfig': { 'fieldLogLevel': 'NONE'|'ERROR'|'ALL', 'cloudWatchLogsRoleArn': 'string', 'excludeVerboseContent': True|False }, 'userPoolConfig': { 'userPoolId': 'string', 'awsRegion': 'string', 'defaultAction': 'ALLOW'|'DENY', 'appIdClientRegex': 'string' }, 'openIDConnectConfig': { 'issuer': 'string', 'clientId': 'string', 'iatTTL': 123, 'authTTL': 123 }, 'arn': 'string', 'uris': { 'string': 'string' }, 'tags': { 'string': 'string' }, 'additionalAuthenticationProviders': [ { 'authenticationType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA', 'openIDConnectConfig': { 'issuer': 'string', 'clientId': 'string', 'iatTTL': 123, 'authTTL': 123 }, 'userPoolConfig': { 'userPoolId': 'string', 'awsRegion': 'string', 'appIdClientRegex': 'string' }, 'lambdaAuthorizerConfig': { 'authorizerResultTtlInSeconds': 123, 'authorizerUri': 'string', 'identityValidationExpression': 'string' } }, ], 'xrayEnabled': True|False, 'wafWebAclArn': 'string', 'lambdaAuthorizerConfig': { 'authorizerResultTtlInSeconds': 123, 'authorizerUri': 'string', 'identityValidationExpression': 'string' }, 'dns': { 'string': 'string' }, 'visibility': 'GLOBAL'|'PRIVATE', 'apiType': 'GRAPHQL'|'MERGED', 'mergedApiExecutionRoleArn': 'string', 'owner': 'string', 'ownerContact': 'string', 'introspectionConfig': 'ENABLED'|'DISABLED', 'queryDepthLimit': 123, 'resolverCountLimit': 123, 'enhancedMetricsConfig': { 'resolverLevelMetricsBehavior': 'FULL_REQUEST_RESOLVER_METRICS'|'PER_RESOLVER_METRICS', 'dataSourceLevelMetricsBehavior': 'FULL_REQUEST_DATA_SOURCE_METRICS'|'PER_DATA_SOURCE_METRICS', 'operationLevelMetricsConfig': 'ENABLED'|'DISABLED' } } }
Response Structure
(dict) --
graphqlApi (dict) --
The GraphqlApi object.
name (string) --
The API name.
apiId (string) --
The API ID.
authenticationType (string) --
The authentication type.
logConfig (dict) --
The Amazon CloudWatch Logs configuration.
fieldLogLevel (string) --
The field logging level. Values can be NONE, ERROR, or ALL.
NONE : No field-level logs are captured.
ERROR : Logs the following information only for the fields that are in error:
The error section in the server response.
Field-level errors.
The generated request/response functions that got resolved for error fields.
ALL : The following information is logged for all fields in the query:
Field-level tracing information.
The generated request/response functions that got resolved for each field.
cloudWatchLogsRoleArn (string) --
The service role that AppSync assumes to publish to CloudWatch logs in your account.
excludeVerboseContent (boolean) --
Set to TRUE to exclude sections that contain information such as headers, context, and evaluated mapping templates, regardless of logging level.
userPoolConfig (dict) --
The Amazon Cognito user pool configuration.
userPoolId (string) --
The user pool ID.
awsRegion (string) --
The Amazon Web Services Region in which the user pool was created.
defaultAction (string) --
The action that you want your GraphQL API to take when a request that uses Amazon Cognito user pool authentication doesn't match the Amazon Cognito user pool configuration.
appIdClientRegex (string) --
A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.
openIDConnectConfig (dict) --
The OpenID Connect configuration.
issuer (string) --
The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of iss in the ID token.
clientId (string) --
The client identifier of the relying party at the OpenID identity provider. This identifier is typically obtained when the relying party is registered with the OpenID identity provider. You can specify a regular expression so that AppSync can validate against multiple client identifiers at a time.
iatTTL (integer) --
The number of milliseconds that a token is valid after it's issued to a user.
authTTL (integer) --
The number of milliseconds that a token is valid after being authenticated.
arn (string) --
The Amazon Resource Name (ARN).
uris (dict) --
The URIs.
(string) --
(string) --
tags (dict) --
The tags.
(string) --
The key for the tag.
(string) --
The value for the tag.
additionalAuthenticationProviders (list) --
A list of additional authentication providers for the GraphqlApi API.
(dict) --
Describes an additional authentication provider.
authenticationType (string) --
The authentication type: API key, Identity and Access Management (IAM), OpenID Connect (OIDC), Amazon Cognito user pools, or Lambda.
openIDConnectConfig (dict) --
The OIDC configuration.
issuer (string) --
The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of iss in the ID token.
clientId (string) --
The client identifier of the relying party at the OpenID identity provider. This identifier is typically obtained when the relying party is registered with the OpenID identity provider. You can specify a regular expression so that AppSync can validate against multiple client identifiers at a time.
iatTTL (integer) --
The number of milliseconds that a token is valid after it's issued to a user.
authTTL (integer) --
The number of milliseconds that a token is valid after being authenticated.
userPoolConfig (dict) --
The Amazon Cognito user pool configuration.
userPoolId (string) --
The user pool ID.
awsRegion (string) --
The Amazon Web Services Region in which the user pool was created.
appIdClientRegex (string) --
A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.
lambdaAuthorizerConfig (dict) --
Configuration for Lambda function authorization.
authorizerResultTtlInSeconds (integer) --
The number of seconds a response should be cached for. The default is 0 seconds, which disables caching. If you don't specify a value for authorizerResultTtlInSeconds , the default value is used. The maximum value is one hour (3600 seconds). The Lambda function can override this by returning a ttlOverride key in its response.
authorizerUri (string) --
The Amazon Resource Name (ARN) of the Lambda function to be called for authorization. This can be a standard Lambda ARN, a version ARN (.../v3 ), or an alias ARN.
Note : This Lambda function must have the following resource-based policy assigned to it. When configuring Lambda authorizers in the console, this is done for you. To use the Command Line Interface (CLI), run the following:
aws lambda add-permission --function-name "arn:aws:lambda:us-east-2:111122223333:function:my-function" --statement-id "appsync" --principal appsync.amazonaws.com --action lambda:InvokeFunction
identityValidationExpression (string) --
A regular expression for validation of tokens before the Lambda function is called.
xrayEnabled (boolean) --
A flag indicating whether to use X-Ray tracing for this GraphqlApi .
wafWebAclArn (string) --
The ARN of the WAF access control list (ACL) associated with this GraphqlApi , if one exists.
lambdaAuthorizerConfig (dict) --
Configuration for Lambda function authorization.
authorizerResultTtlInSeconds (integer) --
The number of seconds a response should be cached for. The default is 0 seconds, which disables caching. If you don't specify a value for authorizerResultTtlInSeconds , the default value is used. The maximum value is one hour (3600 seconds). The Lambda function can override this by returning a ttlOverride key in its response.
authorizerUri (string) --
The Amazon Resource Name (ARN) of the Lambda function to be called for authorization. This can be a standard Lambda ARN, a version ARN (.../v3 ), or an alias ARN.
Note : This Lambda function must have the following resource-based policy assigned to it. When configuring Lambda authorizers in the console, this is done for you. To use the Command Line Interface (CLI), run the following:
aws lambda add-permission --function-name "arn:aws:lambda:us-east-2:111122223333:function:my-function" --statement-id "appsync" --principal appsync.amazonaws.com --action lambda:InvokeFunction
identityValidationExpression (string) --
A regular expression for validation of tokens before the Lambda function is called.
dns (dict) --
The DNS records for the API.
(string) --
(string) --
visibility (string) --
Sets the value of the GraphQL API to public (GLOBAL ) or private (PRIVATE ). If no value is provided, the visibility will be set to GLOBAL by default. This value cannot be changed once the API has been created.
apiType (string) --
The value that indicates whether the GraphQL API is a standard API (GRAPHQL ) or merged API (MERGED ).
mergedApiExecutionRoleArn (string) --
The Identity and Access Management service role ARN for a merged API. The AppSync service assumes this role on behalf of the Merged API to validate access to source APIs at runtime and to prompt the AUTO_MERGE to update the merged API endpoint with the source API changes automatically.
owner (string) --
The account owner of the GraphQL API.
ownerContact (string) --
The owner contact information for an API resource.
This field accepts any string input with a length of 0 - 256 characters.
introspectionConfig (string) --
Sets the value of the GraphQL API to enable (ENABLED ) or disable (DISABLED ) introspection. If no value is provided, the introspection configuration will be set to ENABLED by default. This field will produce an error if the operation attempts to use the introspection feature while this field is disabled.
For more information about introspection, see GraphQL introspection .
queryDepthLimit (integer) --
The maximum depth a query can have in a single request. Depth refers to the amount of nested levels allowed in the body of query. The default value is 0 (or unspecified), which indicates there's no depth limit. If you set a limit, it can be between 1 and 75 nested levels. This field will produce a limit error if the operation falls out of bounds.
Note that fields can still be set to nullable or non-nullable. If a non-nullable field produces an error, the error will be thrown upwards to the first nullable field available.
resolverCountLimit (integer) --
The maximum number of resolvers that can be invoked in a single request. The default value is 0 (or unspecified), which will set the limit to 10000 . When specified, the limit value can be between 1 and 10000 . This field will produce a limit error if the operation falls out of bounds.
enhancedMetricsConfig (dict) --
The enhancedMetricsConfig object.
resolverLevelMetricsBehavior (string) --
Controls how resolver metrics will be emitted to CloudWatch. Resolver metrics include:
GraphQL errors: The number of GraphQL errors that occurred.
Requests: The number of invocations that occurred during a request.
Latency: The time to complete a resolver invocation.
Cache hits: The number of cache hits during a request.
Cache misses: The number of cache misses during a request.
These metrics can be emitted to CloudWatch per resolver or for all resolvers in the request. Metrics will be recorded by API ID and resolver name. resolverLevelMetricsBehavior accepts one of these values at a time:
FULL_REQUEST_RESOLVER_METRICS : Records and emits metric data for all resolvers in the request.
PER_RESOLVER_METRICS : Records and emits metric data for resolvers that have the metricConfig value set to ENABLED .
dataSourceLevelMetricsBehavior (string) --
Controls how data source metrics will be emitted to CloudWatch. Data source metrics include:
Requests: The number of invocations that occured during a request.
Latency: The time to complete a data source invocation.
Errors: The number of errors that occurred during a data source invocation.
These metrics can be emitted to CloudWatch per data source or for all data sources in the request. Metrics will be recorded by API ID and data source name. dataSourceLevelMetricsBehavior accepts one of these values at a time:
FULL_REQUEST_DATA_SOURCE_METRICS : Records and emits metric data for all data sources in the request.
PER_DATA_SOURCE_METRICS : Records and emits metric data for data sources that have the metricConfig value set to ENABLED .
operationLevelMetricsConfig (string) --
Controls how operation metrics will be emitted to CloudWatch. Operation metrics include:
Requests: The number of times a specified GraphQL operation was called.
GraphQL errors: The number of GraphQL errors that occurred during a specified GraphQL operation.
Metrics will be recorded by API ID and operation name. You can set the value to ENABLED or DISABLED .
{'resolver': {'metricsConfig': 'ENABLED | DISABLED'}}
Retrieves a Resolver object.
See also: AWS API Documentation
Request Syntax
client.get_resolver( apiId='string', typeName='string', fieldName='string' )
string
[REQUIRED]
The API ID.
string
[REQUIRED]
The resolver type name.
string
[REQUIRED]
The resolver field name.
dict
Response Syntax
{ 'resolver': { 'typeName': 'string', 'fieldName': 'string', 'dataSourceName': 'string', 'resolverArn': 'string', 'requestMappingTemplate': 'string', 'responseMappingTemplate': 'string', 'kind': 'UNIT'|'PIPELINE', 'pipelineConfig': { 'functions': [ 'string', ] }, 'syncConfig': { 'conflictHandler': 'OPTIMISTIC_CONCURRENCY'|'LAMBDA'|'AUTOMERGE'|'NONE', 'conflictDetection': 'VERSION'|'NONE', 'lambdaConflictHandlerConfig': { 'lambdaConflictHandlerArn': 'string' } }, 'cachingConfig': { 'ttl': 123, 'cachingKeys': [ 'string', ] }, 'maxBatchSize': 123, 'runtime': { 'name': 'APPSYNC_JS', 'runtimeVersion': 'string' }, 'code': 'string', 'metricsConfig': 'ENABLED'|'DISABLED' } }
Response Structure
(dict) --
resolver (dict) --
The Resolver object.
typeName (string) --
The resolver type name.
fieldName (string) --
The resolver field name.
dataSourceName (string) --
The resolver data source name.
resolverArn (string) --
The resolver Amazon Resource Name (ARN).
requestMappingTemplate (string) --
The request mapping template.
responseMappingTemplate (string) --
The response mapping template.
kind (string) --
The resolver type.
UNIT : A UNIT resolver type. A UNIT resolver is the default resolver type. You can use a UNIT resolver to run a GraphQL query against a single data source.
PIPELINE : A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of Function objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.
pipelineConfig (dict) --
The PipelineConfig .
functions (list) --
A list of Function objects.
(string) --
syncConfig (dict) --
The SyncConfig for a resolver attached to a versioned data source.
conflictHandler (string) --
The Conflict Resolution strategy to perform in the event of a conflict.
OPTIMISTIC_CONCURRENCY : Resolve conflicts by rejecting mutations when versions don't match the latest version at the server.
AUTOMERGE : Resolve conflicts with the Automerge conflict resolution strategy.
LAMBDA : Resolve conflicts with an Lambda function supplied in the LambdaConflictHandlerConfig .
conflictDetection (string) --
The Conflict Detection strategy to use.
VERSION : Detect conflicts based on object versions for this resolver.
NONE : Do not detect conflicts when invoking this resolver.
lambdaConflictHandlerConfig (dict) --
The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.
lambdaConflictHandlerArn (string) --
The Amazon Resource Name (ARN) for the Lambda function to use as the Conflict Handler.
cachingConfig (dict) --
The caching configuration for the resolver.
ttl (integer) --
The TTL in seconds for a resolver that has caching activated.
Valid values are 1–3,600 seconds.
cachingKeys (list) --
The caching keys for a resolver that has caching activated.
Valid values are entries from the $context.arguments , $context.source , and $context.identity maps.
(string) --
maxBatchSize (integer) --
The maximum batching size for a resolver.
runtime (dict) --
Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.
name (string) --
The name of the runtime to use. Currently, the only allowed value is APPSYNC_JS .
runtimeVersion (string) --
The version of the runtime to use. Currently, the only allowed version is 1.0.0 .
code (string) --
The resolver code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS .
metricsConfig (string) --
Enables or disables enhanced resolver metrics for specified resolvers. Note that metricsConfig won't be used unless the resolverLevelMetricsBehavior value is set to PER_RESOLVER_METRICS . If the resolverLevelMetricsBehavior is set to FULL_REQUEST_RESOLVER_METRICS instead, metricsConfig will be ignored. However, you can still set its value.
metricsConfig can be ENABLED or DISABLED .
{'dataSources': {'metricsConfig': 'ENABLED | DISABLED'}}
Lists the data sources for a given API.
See also: AWS API Documentation
Request Syntax
client.list_data_sources( apiId='string', nextToken='string', maxResults=123 )
string
[REQUIRED]
The API ID.
string
An identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list.
integer
The maximum number of results that you want the request to return.
dict
Response Syntax
{ 'dataSources': [ { 'dataSourceArn': 'string', 'name': 'string', 'description': 'string', 'type': 'AWS_LAMBDA'|'AMAZON_DYNAMODB'|'AMAZON_ELASTICSEARCH'|'NONE'|'HTTP'|'RELATIONAL_DATABASE'|'AMAZON_OPENSEARCH_SERVICE'|'AMAZON_EVENTBRIDGE', 'serviceRoleArn': 'string', 'dynamodbConfig': { 'tableName': 'string', 'awsRegion': 'string', 'useCallerCredentials': True|False, 'deltaSyncConfig': { 'baseTableTTL': 123, 'deltaSyncTableName': 'string', 'deltaSyncTableTTL': 123 }, 'versioned': True|False }, 'lambdaConfig': { 'lambdaFunctionArn': 'string' }, 'elasticsearchConfig': { 'endpoint': 'string', 'awsRegion': 'string' }, 'openSearchServiceConfig': { 'endpoint': 'string', 'awsRegion': 'string' }, 'httpConfig': { 'endpoint': 'string', 'authorizationConfig': { 'authorizationType': 'AWS_IAM', 'awsIamConfig': { 'signingRegion': 'string', 'signingServiceName': 'string' } } }, 'relationalDatabaseConfig': { 'relationalDatabaseSourceType': 'RDS_HTTP_ENDPOINT', 'rdsHttpEndpointConfig': { 'awsRegion': 'string', 'dbClusterIdentifier': 'string', 'databaseName': 'string', 'schema': 'string', 'awsSecretStoreArn': 'string' } }, 'eventBridgeConfig': { 'eventBusArn': 'string' }, 'metricsConfig': 'ENABLED'|'DISABLED' }, ], 'nextToken': 'string' }
Response Structure
(dict) --
dataSources (list) --
The DataSource objects.
(dict) --
Describes a data source.
dataSourceArn (string) --
The data source Amazon Resource Name (ARN).
name (string) --
The name of the data source.
description (string) --
The description of the data source.
type (string) --
The type of the data source.
AWS_LAMBDA : The data source is an Lambda function.
AMAZON_DYNAMODB : The data source is an Amazon DynamoDB table.
AMAZON_ELASTICSEARCH : The data source is an Amazon OpenSearch Service domain.
AMAZON_OPENSEARCH_SERVICE : The data source is an Amazon OpenSearch Service domain.
AMAZON_EVENTBRIDGE : The data source is an Amazon EventBridge configuration.
NONE : There is no data source. Use this type when you want to invoke a GraphQL operation without connecting to a data source, such as when you're performing data transformation with resolvers or invoking a subscription from a mutation.
HTTP : The data source is an HTTP endpoint.
RELATIONAL_DATABASE : The data source is a relational database.
serviceRoleArn (string) --
The Identity and Access Management (IAM) service role Amazon Resource Name (ARN) for the data source. The system assumes this role when accessing the data source.
dynamodbConfig (dict) --
DynamoDB settings.
tableName (string) --
The table name.
awsRegion (string) --
The Amazon Web Services Region.
useCallerCredentials (boolean) --
Set to TRUE to use Amazon Cognito credentials with this data source.
deltaSyncConfig (dict) --
The DeltaSyncConfig for a versioned data source.
baseTableTTL (integer) --
The number of minutes that an Item is stored in the data source.
deltaSyncTableName (string) --
The Delta Sync table name.
deltaSyncTableTTL (integer) --
The number of minutes that a Delta Sync log entry is stored in the Delta Sync table.
versioned (boolean) --
Set to TRUE to use Conflict Detection and Resolution with this data source.
lambdaConfig (dict) --
Lambda settings.
lambdaFunctionArn (string) --
The Amazon Resource Name (ARN) for the Lambda function.
elasticsearchConfig (dict) --
Amazon OpenSearch Service settings.
endpoint (string) --
The endpoint.
awsRegion (string) --
The Amazon Web Services Region.
openSearchServiceConfig (dict) --
Amazon OpenSearch Service settings.
endpoint (string) --
The endpoint.
awsRegion (string) --
The Amazon Web Services Region.
httpConfig (dict) --
HTTP endpoint settings.
endpoint (string) --
The HTTP URL endpoint. You can specify either the domain name or IP, and port combination, and the URL scheme must be HTTP or HTTPS. If you don't specify the port, AppSync uses the default port 80 for the HTTP endpoint and port 443 for HTTPS endpoints.
authorizationConfig (dict) --
The authorization configuration in case the HTTP endpoint requires authorization.
authorizationType (string) --
The authorization type that the HTTP endpoint requires.
AWS_IAM : The authorization type is Signature Version 4 (SigV4).
awsIamConfig (dict) --
The Identity and Access Management (IAM) settings.
signingRegion (string) --
The signing Amazon Web Services Region for IAM authorization.
signingServiceName (string) --
The signing service name for IAM authorization.
relationalDatabaseConfig (dict) --
Relational database settings.
relationalDatabaseSourceType (string) --
Source type for the relational database.
RDS_HTTP_ENDPOINT : The relational database source type is an Amazon Relational Database Service (Amazon RDS) HTTP endpoint.
rdsHttpEndpointConfig (dict) --
Amazon RDS HTTP endpoint settings.
awsRegion (string) --
Amazon Web Services Region for Amazon RDS HTTP endpoint.
dbClusterIdentifier (string) --
Amazon RDS cluster Amazon Resource Name (ARN).
databaseName (string) --
Logical database name.
schema (string) --
Logical schema name.
awsSecretStoreArn (string) --
Amazon Web Services secret store Amazon Resource Name (ARN) for database credentials.
eventBridgeConfig (dict) --
Amazon EventBridge settings.
eventBusArn (string) --
The ARN of the event bus. For more information about event buses, see Amazon EventBridge event buses .
metricsConfig (string) --
Enables or disables enhanced data source metrics for specified data sources. Note that metricsConfig won't be used unless the dataSourceLevelMetricsBehavior value is set to PER_DATA_SOURCE_METRICS . If the dataSourceLevelMetricsBehavior is set to FULL_REQUEST_DATA_SOURCE_METRICS instead, metricsConfig will be ignored. However, you can still set its value.
metricsConfig can be ENABLED or DISABLED .
nextToken (string) --
An identifier to pass in the next request to this operation to return the next set of items in the list.
{'graphqlApis': {'enhancedMetricsConfig': {'dataSourceLevelMetricsBehavior': 'FULL_REQUEST_DATA_SOURCE_METRICS ' '| ' 'PER_DATA_SOURCE_METRICS', 'operationLevelMetricsConfig': 'ENABLED ' '| ' 'DISABLED', 'resolverLevelMetricsBehavior': 'FULL_REQUEST_RESOLVER_METRICS ' '| ' 'PER_RESOLVER_METRICS'}}}
Lists your GraphQL APIs.
See also: AWS API Documentation
Request Syntax
client.list_graphql_apis( nextToken='string', maxResults=123, apiType='GRAPHQL'|'MERGED', owner='CURRENT_ACCOUNT'|'OTHER_ACCOUNTS' )
string
An identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list.
integer
The maximum number of results that you want the request to return.
string
The value that indicates whether the GraphQL API is a standard API (GRAPHQL ) or merged API (MERGED ).
string
The account owner of the GraphQL API.
dict
Response Syntax
{ 'graphqlApis': [ { 'name': 'string', 'apiId': 'string', 'authenticationType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA', 'logConfig': { 'fieldLogLevel': 'NONE'|'ERROR'|'ALL', 'cloudWatchLogsRoleArn': 'string', 'excludeVerboseContent': True|False }, 'userPoolConfig': { 'userPoolId': 'string', 'awsRegion': 'string', 'defaultAction': 'ALLOW'|'DENY', 'appIdClientRegex': 'string' }, 'openIDConnectConfig': { 'issuer': 'string', 'clientId': 'string', 'iatTTL': 123, 'authTTL': 123 }, 'arn': 'string', 'uris': { 'string': 'string' }, 'tags': { 'string': 'string' }, 'additionalAuthenticationProviders': [ { 'authenticationType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA', 'openIDConnectConfig': { 'issuer': 'string', 'clientId': 'string', 'iatTTL': 123, 'authTTL': 123 }, 'userPoolConfig': { 'userPoolId': 'string', 'awsRegion': 'string', 'appIdClientRegex': 'string' }, 'lambdaAuthorizerConfig': { 'authorizerResultTtlInSeconds': 123, 'authorizerUri': 'string', 'identityValidationExpression': 'string' } }, ], 'xrayEnabled': True|False, 'wafWebAclArn': 'string', 'lambdaAuthorizerConfig': { 'authorizerResultTtlInSeconds': 123, 'authorizerUri': 'string', 'identityValidationExpression': 'string' }, 'dns': { 'string': 'string' }, 'visibility': 'GLOBAL'|'PRIVATE', 'apiType': 'GRAPHQL'|'MERGED', 'mergedApiExecutionRoleArn': 'string', 'owner': 'string', 'ownerContact': 'string', 'introspectionConfig': 'ENABLED'|'DISABLED', 'queryDepthLimit': 123, 'resolverCountLimit': 123, 'enhancedMetricsConfig': { 'resolverLevelMetricsBehavior': 'FULL_REQUEST_RESOLVER_METRICS'|'PER_RESOLVER_METRICS', 'dataSourceLevelMetricsBehavior': 'FULL_REQUEST_DATA_SOURCE_METRICS'|'PER_DATA_SOURCE_METRICS', 'operationLevelMetricsConfig': 'ENABLED'|'DISABLED' } }, ], 'nextToken': 'string' }
Response Structure
(dict) --
graphqlApis (list) --
The GraphqlApi objects.
(dict) --
Describes a GraphQL API.
name (string) --
The API name.
apiId (string) --
The API ID.
authenticationType (string) --
The authentication type.
logConfig (dict) --
The Amazon CloudWatch Logs configuration.
fieldLogLevel (string) --
The field logging level. Values can be NONE, ERROR, or ALL.
NONE : No field-level logs are captured.
ERROR : Logs the following information only for the fields that are in error:
The error section in the server response.
Field-level errors.
The generated request/response functions that got resolved for error fields.
ALL : The following information is logged for all fields in the query:
Field-level tracing information.
The generated request/response functions that got resolved for each field.
cloudWatchLogsRoleArn (string) --
The service role that AppSync assumes to publish to CloudWatch logs in your account.
excludeVerboseContent (boolean) --
Set to TRUE to exclude sections that contain information such as headers, context, and evaluated mapping templates, regardless of logging level.
userPoolConfig (dict) --
The Amazon Cognito user pool configuration.
userPoolId (string) --
The user pool ID.
awsRegion (string) --
The Amazon Web Services Region in which the user pool was created.
defaultAction (string) --
The action that you want your GraphQL API to take when a request that uses Amazon Cognito user pool authentication doesn't match the Amazon Cognito user pool configuration.
appIdClientRegex (string) --
A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.
openIDConnectConfig (dict) --
The OpenID Connect configuration.
issuer (string) --
The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of iss in the ID token.
clientId (string) --
The client identifier of the relying party at the OpenID identity provider. This identifier is typically obtained when the relying party is registered with the OpenID identity provider. You can specify a regular expression so that AppSync can validate against multiple client identifiers at a time.
iatTTL (integer) --
The number of milliseconds that a token is valid after it's issued to a user.
authTTL (integer) --
The number of milliseconds that a token is valid after being authenticated.
arn (string) --
The Amazon Resource Name (ARN).
uris (dict) --
The URIs.
(string) --
(string) --
tags (dict) --
The tags.
(string) --
The key for the tag.
(string) --
The value for the tag.
additionalAuthenticationProviders (list) --
A list of additional authentication providers for the GraphqlApi API.
(dict) --
Describes an additional authentication provider.
authenticationType (string) --
The authentication type: API key, Identity and Access Management (IAM), OpenID Connect (OIDC), Amazon Cognito user pools, or Lambda.
openIDConnectConfig (dict) --
The OIDC configuration.
issuer (string) --
The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of iss in the ID token.
clientId (string) --
The client identifier of the relying party at the OpenID identity provider. This identifier is typically obtained when the relying party is registered with the OpenID identity provider. You can specify a regular expression so that AppSync can validate against multiple client identifiers at a time.
iatTTL (integer) --
The number of milliseconds that a token is valid after it's issued to a user.
authTTL (integer) --
The number of milliseconds that a token is valid after being authenticated.
userPoolConfig (dict) --
The Amazon Cognito user pool configuration.
userPoolId (string) --
The user pool ID.
awsRegion (string) --
The Amazon Web Services Region in which the user pool was created.
appIdClientRegex (string) --
A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.
lambdaAuthorizerConfig (dict) --
Configuration for Lambda function authorization.
authorizerResultTtlInSeconds (integer) --
The number of seconds a response should be cached for. The default is 0 seconds, which disables caching. If you don't specify a value for authorizerResultTtlInSeconds , the default value is used. The maximum value is one hour (3600 seconds). The Lambda function can override this by returning a ttlOverride key in its response.
authorizerUri (string) --
The Amazon Resource Name (ARN) of the Lambda function to be called for authorization. This can be a standard Lambda ARN, a version ARN (.../v3 ), or an alias ARN.
Note : This Lambda function must have the following resource-based policy assigned to it. When configuring Lambda authorizers in the console, this is done for you. To use the Command Line Interface (CLI), run the following:
aws lambda add-permission --function-name "arn:aws:lambda:us-east-2:111122223333:function:my-function" --statement-id "appsync" --principal appsync.amazonaws.com --action lambda:InvokeFunction
identityValidationExpression (string) --
A regular expression for validation of tokens before the Lambda function is called.
xrayEnabled (boolean) --
A flag indicating whether to use X-Ray tracing for this GraphqlApi .
wafWebAclArn (string) --
The ARN of the WAF access control list (ACL) associated with this GraphqlApi , if one exists.
lambdaAuthorizerConfig (dict) --
Configuration for Lambda function authorization.
authorizerResultTtlInSeconds (integer) --
The number of seconds a response should be cached for. The default is 0 seconds, which disables caching. If you don't specify a value for authorizerResultTtlInSeconds , the default value is used. The maximum value is one hour (3600 seconds). The Lambda function can override this by returning a ttlOverride key in its response.
authorizerUri (string) --
The Amazon Resource Name (ARN) of the Lambda function to be called for authorization. This can be a standard Lambda ARN, a version ARN (.../v3 ), or an alias ARN.
Note : This Lambda function must have the following resource-based policy assigned to it. When configuring Lambda authorizers in the console, this is done for you. To use the Command Line Interface (CLI), run the following:
aws lambda add-permission --function-name "arn:aws:lambda:us-east-2:111122223333:function:my-function" --statement-id "appsync" --principal appsync.amazonaws.com --action lambda:InvokeFunction
identityValidationExpression (string) --
A regular expression for validation of tokens before the Lambda function is called.
dns (dict) --
The DNS records for the API.
(string) --
(string) --
visibility (string) --
Sets the value of the GraphQL API to public (GLOBAL ) or private (PRIVATE ). If no value is provided, the visibility will be set to GLOBAL by default. This value cannot be changed once the API has been created.
apiType (string) --
The value that indicates whether the GraphQL API is a standard API (GRAPHQL ) or merged API (MERGED ).
mergedApiExecutionRoleArn (string) --
The Identity and Access Management service role ARN for a merged API. The AppSync service assumes this role on behalf of the Merged API to validate access to source APIs at runtime and to prompt the AUTO_MERGE to update the merged API endpoint with the source API changes automatically.
owner (string) --
The account owner of the GraphQL API.
ownerContact (string) --
The owner contact information for an API resource.
This field accepts any string input with a length of 0 - 256 characters.
introspectionConfig (string) --
Sets the value of the GraphQL API to enable (ENABLED ) or disable (DISABLED ) introspection. If no value is provided, the introspection configuration will be set to ENABLED by default. This field will produce an error if the operation attempts to use the introspection feature while this field is disabled.
For more information about introspection, see GraphQL introspection .
queryDepthLimit (integer) --
The maximum depth a query can have in a single request. Depth refers to the amount of nested levels allowed in the body of query. The default value is 0 (or unspecified), which indicates there's no depth limit. If you set a limit, it can be between 1 and 75 nested levels. This field will produce a limit error if the operation falls out of bounds.
Note that fields can still be set to nullable or non-nullable. If a non-nullable field produces an error, the error will be thrown upwards to the first nullable field available.
resolverCountLimit (integer) --
The maximum number of resolvers that can be invoked in a single request. The default value is 0 (or unspecified), which will set the limit to 10000 . When specified, the limit value can be between 1 and 10000 . This field will produce a limit error if the operation falls out of bounds.
enhancedMetricsConfig (dict) --
The enhancedMetricsConfig object.
resolverLevelMetricsBehavior (string) --
Controls how resolver metrics will be emitted to CloudWatch. Resolver metrics include:
GraphQL errors: The number of GraphQL errors that occurred.
Requests: The number of invocations that occurred during a request.
Latency: The time to complete a resolver invocation.
Cache hits: The number of cache hits during a request.
Cache misses: The number of cache misses during a request.
These metrics can be emitted to CloudWatch per resolver or for all resolvers in the request. Metrics will be recorded by API ID and resolver name. resolverLevelMetricsBehavior accepts one of these values at a time:
FULL_REQUEST_RESOLVER_METRICS : Records and emits metric data for all resolvers in the request.
PER_RESOLVER_METRICS : Records and emits metric data for resolvers that have the metricConfig value set to ENABLED .
dataSourceLevelMetricsBehavior (string) --
Controls how data source metrics will be emitted to CloudWatch. Data source metrics include:
Requests: The number of invocations that occured during a request.
Latency: The time to complete a data source invocation.
Errors: The number of errors that occurred during a data source invocation.
These metrics can be emitted to CloudWatch per data source or for all data sources in the request. Metrics will be recorded by API ID and data source name. dataSourceLevelMetricsBehavior accepts one of these values at a time:
FULL_REQUEST_DATA_SOURCE_METRICS : Records and emits metric data for all data sources in the request.
PER_DATA_SOURCE_METRICS : Records and emits metric data for data sources that have the metricConfig value set to ENABLED .
operationLevelMetricsConfig (string) --
Controls how operation metrics will be emitted to CloudWatch. Operation metrics include:
Requests: The number of times a specified GraphQL operation was called.
GraphQL errors: The number of GraphQL errors that occurred during a specified GraphQL operation.
Metrics will be recorded by API ID and operation name. You can set the value to ENABLED or DISABLED .
nextToken (string) --
An identifier to pass in the next request to this operation to return the next set of items in the list.
{'resolvers': {'metricsConfig': 'ENABLED | DISABLED'}}
Lists the resolvers for a given API and type.
See also: AWS API Documentation
Request Syntax
client.list_resolvers( apiId='string', typeName='string', nextToken='string', maxResults=123 )
string
[REQUIRED]
The API ID.
string
[REQUIRED]
The type name.
string
An identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list.
integer
The maximum number of results that you want the request to return.
dict
Response Syntax
{ 'resolvers': [ { 'typeName': 'string', 'fieldName': 'string', 'dataSourceName': 'string', 'resolverArn': 'string', 'requestMappingTemplate': 'string', 'responseMappingTemplate': 'string', 'kind': 'UNIT'|'PIPELINE', 'pipelineConfig': { 'functions': [ 'string', ] }, 'syncConfig': { 'conflictHandler': 'OPTIMISTIC_CONCURRENCY'|'LAMBDA'|'AUTOMERGE'|'NONE', 'conflictDetection': 'VERSION'|'NONE', 'lambdaConflictHandlerConfig': { 'lambdaConflictHandlerArn': 'string' } }, 'cachingConfig': { 'ttl': 123, 'cachingKeys': [ 'string', ] }, 'maxBatchSize': 123, 'runtime': { 'name': 'APPSYNC_JS', 'runtimeVersion': 'string' }, 'code': 'string', 'metricsConfig': 'ENABLED'|'DISABLED' }, ], 'nextToken': 'string' }
Response Structure
(dict) --
resolvers (list) --
The Resolver objects.
(dict) --
Describes a resolver.
typeName (string) --
The resolver type name.
fieldName (string) --
The resolver field name.
dataSourceName (string) --
The resolver data source name.
resolverArn (string) --
The resolver Amazon Resource Name (ARN).
requestMappingTemplate (string) --
The request mapping template.
responseMappingTemplate (string) --
The response mapping template.
kind (string) --
The resolver type.
UNIT : A UNIT resolver type. A UNIT resolver is the default resolver type. You can use a UNIT resolver to run a GraphQL query against a single data source.
PIPELINE : A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of Function objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.
pipelineConfig (dict) --
The PipelineConfig .
functions (list) --
A list of Function objects.
(string) --
syncConfig (dict) --
The SyncConfig for a resolver attached to a versioned data source.
conflictHandler (string) --
The Conflict Resolution strategy to perform in the event of a conflict.
OPTIMISTIC_CONCURRENCY : Resolve conflicts by rejecting mutations when versions don't match the latest version at the server.
AUTOMERGE : Resolve conflicts with the Automerge conflict resolution strategy.
LAMBDA : Resolve conflicts with an Lambda function supplied in the LambdaConflictHandlerConfig .
conflictDetection (string) --
The Conflict Detection strategy to use.
VERSION : Detect conflicts based on object versions for this resolver.
NONE : Do not detect conflicts when invoking this resolver.
lambdaConflictHandlerConfig (dict) --
The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.
lambdaConflictHandlerArn (string) --
The Amazon Resource Name (ARN) for the Lambda function to use as the Conflict Handler.
cachingConfig (dict) --
The caching configuration for the resolver.
ttl (integer) --
The TTL in seconds for a resolver that has caching activated.
Valid values are 1–3,600 seconds.
cachingKeys (list) --
The caching keys for a resolver that has caching activated.
Valid values are entries from the $context.arguments , $context.source , and $context.identity maps.
(string) --
maxBatchSize (integer) --
The maximum batching size for a resolver.
runtime (dict) --
Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.
name (string) --
The name of the runtime to use. Currently, the only allowed value is APPSYNC_JS .
runtimeVersion (string) --
The version of the runtime to use. Currently, the only allowed version is 1.0.0 .
code (string) --
The resolver code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS .
metricsConfig (string) --
Enables or disables enhanced resolver metrics for specified resolvers. Note that metricsConfig won't be used unless the resolverLevelMetricsBehavior value is set to PER_RESOLVER_METRICS . If the resolverLevelMetricsBehavior is set to FULL_REQUEST_RESOLVER_METRICS instead, metricsConfig will be ignored. However, you can still set its value.
metricsConfig can be ENABLED or DISABLED .
nextToken (string) --
An identifier to pass in the next request to this operation to return the next set of items in the list.
{'resolvers': {'metricsConfig': 'ENABLED | DISABLED'}}
List the resolvers that are associated with a specific function.
See also: AWS API Documentation
Request Syntax
client.list_resolvers_by_function( apiId='string', functionId='string', nextToken='string', maxResults=123 )
string
[REQUIRED]
The API ID.
string
[REQUIRED]
The function ID.
string
An identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list.
integer
The maximum number of results that you want the request to return.
dict
Response Syntax
{ 'resolvers': [ { 'typeName': 'string', 'fieldName': 'string', 'dataSourceName': 'string', 'resolverArn': 'string', 'requestMappingTemplate': 'string', 'responseMappingTemplate': 'string', 'kind': 'UNIT'|'PIPELINE', 'pipelineConfig': { 'functions': [ 'string', ] }, 'syncConfig': { 'conflictHandler': 'OPTIMISTIC_CONCURRENCY'|'LAMBDA'|'AUTOMERGE'|'NONE', 'conflictDetection': 'VERSION'|'NONE', 'lambdaConflictHandlerConfig': { 'lambdaConflictHandlerArn': 'string' } }, 'cachingConfig': { 'ttl': 123, 'cachingKeys': [ 'string', ] }, 'maxBatchSize': 123, 'runtime': { 'name': 'APPSYNC_JS', 'runtimeVersion': 'string' }, 'code': 'string', 'metricsConfig': 'ENABLED'|'DISABLED' }, ], 'nextToken': 'string' }
Response Structure
(dict) --
resolvers (list) --
The list of resolvers.
(dict) --
Describes a resolver.
typeName (string) --
The resolver type name.
fieldName (string) --
The resolver field name.
dataSourceName (string) --
The resolver data source name.
resolverArn (string) --
The resolver Amazon Resource Name (ARN).
requestMappingTemplate (string) --
The request mapping template.
responseMappingTemplate (string) --
The response mapping template.
kind (string) --
The resolver type.
UNIT : A UNIT resolver type. A UNIT resolver is the default resolver type. You can use a UNIT resolver to run a GraphQL query against a single data source.
PIPELINE : A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of Function objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.
pipelineConfig (dict) --
The PipelineConfig .
functions (list) --
A list of Function objects.
(string) --
syncConfig (dict) --
The SyncConfig for a resolver attached to a versioned data source.
conflictHandler (string) --
The Conflict Resolution strategy to perform in the event of a conflict.
OPTIMISTIC_CONCURRENCY : Resolve conflicts by rejecting mutations when versions don't match the latest version at the server.
AUTOMERGE : Resolve conflicts with the Automerge conflict resolution strategy.
LAMBDA : Resolve conflicts with an Lambda function supplied in the LambdaConflictHandlerConfig .
conflictDetection (string) --
The Conflict Detection strategy to use.
VERSION : Detect conflicts based on object versions for this resolver.
NONE : Do not detect conflicts when invoking this resolver.
lambdaConflictHandlerConfig (dict) --
The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.
lambdaConflictHandlerArn (string) --
The Amazon Resource Name (ARN) for the Lambda function to use as the Conflict Handler.
cachingConfig (dict) --
The caching configuration for the resolver.
ttl (integer) --
The TTL in seconds for a resolver that has caching activated.
Valid values are 1–3,600 seconds.
cachingKeys (list) --
The caching keys for a resolver that has caching activated.
Valid values are entries from the $context.arguments , $context.source , and $context.identity maps.
(string) --
maxBatchSize (integer) --
The maximum batching size for a resolver.
runtime (dict) --
Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.
name (string) --
The name of the runtime to use. Currently, the only allowed value is APPSYNC_JS .
runtimeVersion (string) --
The version of the runtime to use. Currently, the only allowed version is 1.0.0 .
code (string) --
The resolver code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS .
metricsConfig (string) --
Enables or disables enhanced resolver metrics for specified resolvers. Note that metricsConfig won't be used unless the resolverLevelMetricsBehavior value is set to PER_RESOLVER_METRICS . If the resolverLevelMetricsBehavior is set to FULL_REQUEST_RESOLVER_METRICS instead, metricsConfig will be ignored. However, you can still set its value.
metricsConfig can be ENABLED or DISABLED .
nextToken (string) --
An identifier that you can use to return the next set of items in the list.
{'healthMetricsConfig': 'ENABLED | DISABLED'}Response
{'apiCache': {'healthMetricsConfig': 'ENABLED | DISABLED'}}
Updates the cache for the GraphQL API.
See also: AWS API Documentation
Request Syntax
client.update_api_cache( apiId='string', ttl=123, apiCachingBehavior='FULL_REQUEST_CACHING'|'PER_RESOLVER_CACHING', type='T2_SMALL'|'T2_MEDIUM'|'R4_LARGE'|'R4_XLARGE'|'R4_2XLARGE'|'R4_4XLARGE'|'R4_8XLARGE'|'SMALL'|'MEDIUM'|'LARGE'|'XLARGE'|'LARGE_2X'|'LARGE_4X'|'LARGE_8X'|'LARGE_12X', healthMetricsConfig='ENABLED'|'DISABLED' )
string
[REQUIRED]
The GraphQL API ID.
integer
[REQUIRED]
TTL in seconds for cache entries.
Valid values are 1–3,600 seconds.
string
[REQUIRED]
Caching behavior.
FULL_REQUEST_CACHING : All requests are fully cached.
PER_RESOLVER_CACHING : Individual resolvers that you specify are cached.
string
[REQUIRED]
The cache instance type. Valid values are
SMALL
MEDIUM
LARGE
XLARGE
LARGE_2X
LARGE_4X
LARGE_8X (not available in all regions)
LARGE_12X
Historically, instance types were identified by an EC2-style value. As of July 2020, this is deprecated, and the generic identifiers above should be used.
The following legacy instance types are available, but their use is discouraged:
T2_SMALL : A t2.small instance type.
T2_MEDIUM : A t2.medium instance type.
R4_LARGE : A r4.large instance type.
R4_XLARGE : A r4.xlarge instance type.
R4_2XLARGE : A r4.2xlarge instance type.
R4_4XLARGE : A r4.4xlarge instance type.
R4_8XLARGE : A r4.8xlarge instance type.
string
Controls how cache health metrics will be emitted to CloudWatch. Cache health metrics include:
NetworkBandwidthOutAllowanceExceeded: The number of times a specified GraphQL operation was called.
EngineCPUUtilization: The number of GraphQL errors that occurred during a specified GraphQL operation.
Metrics will be recorded by API ID. You can set the value to ENABLED or DISABLED .
dict
Response Syntax
{ 'apiCache': { 'ttl': 123, 'apiCachingBehavior': 'FULL_REQUEST_CACHING'|'PER_RESOLVER_CACHING', 'transitEncryptionEnabled': True|False, 'atRestEncryptionEnabled': True|False, 'type': 'T2_SMALL'|'T2_MEDIUM'|'R4_LARGE'|'R4_XLARGE'|'R4_2XLARGE'|'R4_4XLARGE'|'R4_8XLARGE'|'SMALL'|'MEDIUM'|'LARGE'|'XLARGE'|'LARGE_2X'|'LARGE_4X'|'LARGE_8X'|'LARGE_12X', 'status': 'AVAILABLE'|'CREATING'|'DELETING'|'MODIFYING'|'FAILED', 'healthMetricsConfig': 'ENABLED'|'DISABLED' } }
Response Structure
(dict) --
Represents the output of a UpdateApiCache operation.
apiCache (dict) --
The ApiCache object.
ttl (integer) --
TTL in seconds for cache entries.
Valid values are 1–3,600 seconds.
apiCachingBehavior (string) --
Caching behavior.
FULL_REQUEST_CACHING : All requests are fully cached.
PER_RESOLVER_CACHING : Individual resolvers that you specify are cached.
transitEncryptionEnabled (boolean) --
Transit encryption flag when connecting to cache. You cannot update this setting after creation.
atRestEncryptionEnabled (boolean) --
At-rest encryption flag for cache. You cannot update this setting after creation.
type (string) --
The cache instance type. Valid values are
SMALL
MEDIUM
LARGE
XLARGE
LARGE_2X
LARGE_4X
LARGE_8X (not available in all regions)
LARGE_12X
Historically, instance types were identified by an EC2-style value. As of July 2020, this is deprecated, and the generic identifiers above should be used.
The following legacy instance types are available, but their use is discouraged:
T2_SMALL : A t2.small instance type.
T2_MEDIUM : A t2.medium instance type.
R4_LARGE : A r4.large instance type.
R4_XLARGE : A r4.xlarge instance type.
R4_2XLARGE : A r4.2xlarge instance type.
R4_4XLARGE : A r4.4xlarge instance type.
R4_8XLARGE : A r4.8xlarge instance type.
status (string) --
The cache instance status.
AVAILABLE : The instance is available for use.
CREATING : The instance is currently creating.
DELETING : The instance is currently deleting.
MODIFYING : The instance is currently modifying.
FAILED : The instance has failed creation.
healthMetricsConfig (string) --
Controls how cache health metrics will be emitted to CloudWatch. Cache health metrics include:
NetworkBandwidthOutAllowanceExceeded: The network packets dropped because the throughput exceeded the aggregated bandwidth limit. This is useful for diagnosing bottlenecks in a cache configuration.
EngineCPUUtilization: The CPU utilization (percentage) allocated to the Redis process. This is useful for diagnosing bottlenecks in a cache configuration.
Metrics will be recorded by API ID. You can set the value to ENABLED or DISABLED .
{'metricsConfig': 'ENABLED | DISABLED'}Response
{'dataSource': {'metricsConfig': 'ENABLED | DISABLED'}}
Updates a DataSource object.
See also: AWS API Documentation
Request Syntax
client.update_data_source( apiId='string', name='string', description='string', type='AWS_LAMBDA'|'AMAZON_DYNAMODB'|'AMAZON_ELASTICSEARCH'|'NONE'|'HTTP'|'RELATIONAL_DATABASE'|'AMAZON_OPENSEARCH_SERVICE'|'AMAZON_EVENTBRIDGE', serviceRoleArn='string', dynamodbConfig={ 'tableName': 'string', 'awsRegion': 'string', 'useCallerCredentials': True|False, 'deltaSyncConfig': { 'baseTableTTL': 123, 'deltaSyncTableName': 'string', 'deltaSyncTableTTL': 123 }, 'versioned': True|False }, lambdaConfig={ 'lambdaFunctionArn': 'string' }, elasticsearchConfig={ 'endpoint': 'string', 'awsRegion': 'string' }, openSearchServiceConfig={ 'endpoint': 'string', 'awsRegion': 'string' }, httpConfig={ 'endpoint': 'string', 'authorizationConfig': { 'authorizationType': 'AWS_IAM', 'awsIamConfig': { 'signingRegion': 'string', 'signingServiceName': 'string' } } }, relationalDatabaseConfig={ 'relationalDatabaseSourceType': 'RDS_HTTP_ENDPOINT', 'rdsHttpEndpointConfig': { 'awsRegion': 'string', 'dbClusterIdentifier': 'string', 'databaseName': 'string', 'schema': 'string', 'awsSecretStoreArn': 'string' } }, eventBridgeConfig={ 'eventBusArn': 'string' }, metricsConfig='ENABLED'|'DISABLED' )
string
[REQUIRED]
The API ID.
string
[REQUIRED]
The new name for the data source.
string
The new description for the data source.
string
[REQUIRED]
The new data source type.
string
The new service role Amazon Resource Name (ARN) for the data source.
dict
The new Amazon DynamoDB configuration.
tableName (string) -- [REQUIRED]
The table name.
awsRegion (string) -- [REQUIRED]
The Amazon Web Services Region.
useCallerCredentials (boolean) --
Set to TRUE to use Amazon Cognito credentials with this data source.
deltaSyncConfig (dict) --
The DeltaSyncConfig for a versioned data source.
baseTableTTL (integer) --
The number of minutes that an Item is stored in the data source.
deltaSyncTableName (string) --
The Delta Sync table name.
deltaSyncTableTTL (integer) --
The number of minutes that a Delta Sync log entry is stored in the Delta Sync table.
versioned (boolean) --
Set to TRUE to use Conflict Detection and Resolution with this data source.
dict
The new Lambda configuration.
lambdaFunctionArn (string) -- [REQUIRED]
The Amazon Resource Name (ARN) for the Lambda function.
dict
The new OpenSearch configuration.
As of September 2021, Amazon Elasticsearch service is Amazon OpenSearch Service. This configuration is deprecated. Instead, use UpdateDataSourceRequest$openSearchServiceConfig to update an OpenSearch data source.
endpoint (string) -- [REQUIRED]
The endpoint.
awsRegion (string) -- [REQUIRED]
The Amazon Web Services Region.
dict
The new OpenSearch configuration.
endpoint (string) -- [REQUIRED]
The endpoint.
awsRegion (string) -- [REQUIRED]
The Amazon Web Services Region.
dict
The new HTTP endpoint configuration.
endpoint (string) --
The HTTP URL endpoint. You can specify either the domain name or IP, and port combination, and the URL scheme must be HTTP or HTTPS. If you don't specify the port, AppSync uses the default port 80 for the HTTP endpoint and port 443 for HTTPS endpoints.
authorizationConfig (dict) --
The authorization configuration in case the HTTP endpoint requires authorization.
authorizationType (string) -- [REQUIRED]
The authorization type that the HTTP endpoint requires.
AWS_IAM : The authorization type is Signature Version 4 (SigV4).
awsIamConfig (dict) --
The Identity and Access Management (IAM) settings.
signingRegion (string) --
The signing Amazon Web Services Region for IAM authorization.
signingServiceName (string) --
The signing service name for IAM authorization.
dict
The new relational database configuration.
relationalDatabaseSourceType (string) --
Source type for the relational database.
RDS_HTTP_ENDPOINT : The relational database source type is an Amazon Relational Database Service (Amazon RDS) HTTP endpoint.
rdsHttpEndpointConfig (dict) --
Amazon RDS HTTP endpoint settings.
awsRegion (string) --
Amazon Web Services Region for Amazon RDS HTTP endpoint.
dbClusterIdentifier (string) --
Amazon RDS cluster Amazon Resource Name (ARN).
databaseName (string) --
Logical database name.
schema (string) --
Logical schema name.
awsSecretStoreArn (string) --
Amazon Web Services secret store Amazon Resource Name (ARN) for database credentials.
dict
The new Amazon EventBridge settings.
eventBusArn (string) -- [REQUIRED]
The ARN of the event bus. For more information about event buses, see Amazon EventBridge event buses .
string
Enables or disables enhanced data source metrics for specified data sources. Note that metricsConfig won't be used unless the dataSourceLevelMetricsBehavior value is set to PER_DATA_SOURCE_METRICS . If the dataSourceLevelMetricsBehavior is set to FULL_REQUEST_DATA_SOURCE_METRICS instead, metricsConfig will be ignored. However, you can still set its value.
metricsConfig can be ENABLED or DISABLED .
dict
Response Syntax
{ 'dataSource': { 'dataSourceArn': 'string', 'name': 'string', 'description': 'string', 'type': 'AWS_LAMBDA'|'AMAZON_DYNAMODB'|'AMAZON_ELASTICSEARCH'|'NONE'|'HTTP'|'RELATIONAL_DATABASE'|'AMAZON_OPENSEARCH_SERVICE'|'AMAZON_EVENTBRIDGE', 'serviceRoleArn': 'string', 'dynamodbConfig': { 'tableName': 'string', 'awsRegion': 'string', 'useCallerCredentials': True|False, 'deltaSyncConfig': { 'baseTableTTL': 123, 'deltaSyncTableName': 'string', 'deltaSyncTableTTL': 123 }, 'versioned': True|False }, 'lambdaConfig': { 'lambdaFunctionArn': 'string' }, 'elasticsearchConfig': { 'endpoint': 'string', 'awsRegion': 'string' }, 'openSearchServiceConfig': { 'endpoint': 'string', 'awsRegion': 'string' }, 'httpConfig': { 'endpoint': 'string', 'authorizationConfig': { 'authorizationType': 'AWS_IAM', 'awsIamConfig': { 'signingRegion': 'string', 'signingServiceName': 'string' } } }, 'relationalDatabaseConfig': { 'relationalDatabaseSourceType': 'RDS_HTTP_ENDPOINT', 'rdsHttpEndpointConfig': { 'awsRegion': 'string', 'dbClusterIdentifier': 'string', 'databaseName': 'string', 'schema': 'string', 'awsSecretStoreArn': 'string' } }, 'eventBridgeConfig': { 'eventBusArn': 'string' }, 'metricsConfig': 'ENABLED'|'DISABLED' } }
Response Structure
(dict) --
dataSource (dict) --
The updated DataSource object.
dataSourceArn (string) --
The data source Amazon Resource Name (ARN).
name (string) --
The name of the data source.
description (string) --
The description of the data source.
type (string) --
The type of the data source.
AWS_LAMBDA : The data source is an Lambda function.
AMAZON_DYNAMODB : The data source is an Amazon DynamoDB table.
AMAZON_ELASTICSEARCH : The data source is an Amazon OpenSearch Service domain.
AMAZON_OPENSEARCH_SERVICE : The data source is an Amazon OpenSearch Service domain.
AMAZON_EVENTBRIDGE : The data source is an Amazon EventBridge configuration.
NONE : There is no data source. Use this type when you want to invoke a GraphQL operation without connecting to a data source, such as when you're performing data transformation with resolvers or invoking a subscription from a mutation.
HTTP : The data source is an HTTP endpoint.
RELATIONAL_DATABASE : The data source is a relational database.
serviceRoleArn (string) --
The Identity and Access Management (IAM) service role Amazon Resource Name (ARN) for the data source. The system assumes this role when accessing the data source.
dynamodbConfig (dict) --
DynamoDB settings.
tableName (string) --
The table name.
awsRegion (string) --
The Amazon Web Services Region.
useCallerCredentials (boolean) --
Set to TRUE to use Amazon Cognito credentials with this data source.
deltaSyncConfig (dict) --
The DeltaSyncConfig for a versioned data source.
baseTableTTL (integer) --
The number of minutes that an Item is stored in the data source.
deltaSyncTableName (string) --
The Delta Sync table name.
deltaSyncTableTTL (integer) --
The number of minutes that a Delta Sync log entry is stored in the Delta Sync table.
versioned (boolean) --
Set to TRUE to use Conflict Detection and Resolution with this data source.
lambdaConfig (dict) --
Lambda settings.
lambdaFunctionArn (string) --
The Amazon Resource Name (ARN) for the Lambda function.
elasticsearchConfig (dict) --
Amazon OpenSearch Service settings.
endpoint (string) --
The endpoint.
awsRegion (string) --
The Amazon Web Services Region.
openSearchServiceConfig (dict) --
Amazon OpenSearch Service settings.
endpoint (string) --
The endpoint.
awsRegion (string) --
The Amazon Web Services Region.
httpConfig (dict) --
HTTP endpoint settings.
endpoint (string) --
The HTTP URL endpoint. You can specify either the domain name or IP, and port combination, and the URL scheme must be HTTP or HTTPS. If you don't specify the port, AppSync uses the default port 80 for the HTTP endpoint and port 443 for HTTPS endpoints.
authorizationConfig (dict) --
The authorization configuration in case the HTTP endpoint requires authorization.
authorizationType (string) --
The authorization type that the HTTP endpoint requires.
AWS_IAM : The authorization type is Signature Version 4 (SigV4).
awsIamConfig (dict) --
The Identity and Access Management (IAM) settings.
signingRegion (string) --
The signing Amazon Web Services Region for IAM authorization.
signingServiceName (string) --
The signing service name for IAM authorization.
relationalDatabaseConfig (dict) --
Relational database settings.
relationalDatabaseSourceType (string) --
Source type for the relational database.
RDS_HTTP_ENDPOINT : The relational database source type is an Amazon Relational Database Service (Amazon RDS) HTTP endpoint.
rdsHttpEndpointConfig (dict) --
Amazon RDS HTTP endpoint settings.
awsRegion (string) --
Amazon Web Services Region for Amazon RDS HTTP endpoint.
dbClusterIdentifier (string) --
Amazon RDS cluster Amazon Resource Name (ARN).
databaseName (string) --
Logical database name.
schema (string) --
Logical schema name.
awsSecretStoreArn (string) --
Amazon Web Services secret store Amazon Resource Name (ARN) for database credentials.
eventBridgeConfig (dict) --
Amazon EventBridge settings.
eventBusArn (string) --
The ARN of the event bus. For more information about event buses, see Amazon EventBridge event buses .
metricsConfig (string) --
Enables or disables enhanced data source metrics for specified data sources. Note that metricsConfig won't be used unless the dataSourceLevelMetricsBehavior value is set to PER_DATA_SOURCE_METRICS . If the dataSourceLevelMetricsBehavior is set to FULL_REQUEST_DATA_SOURCE_METRICS instead, metricsConfig will be ignored. However, you can still set its value.
metricsConfig can be ENABLED or DISABLED .
{'enhancedMetricsConfig': {'dataSourceLevelMetricsBehavior': 'FULL_REQUEST_DATA_SOURCE_METRICS ' '| ' 'PER_DATA_SOURCE_METRICS', 'operationLevelMetricsConfig': 'ENABLED | DISABLED', 'resolverLevelMetricsBehavior': 'FULL_REQUEST_RESOLVER_METRICS ' '| ' 'PER_RESOLVER_METRICS'}}Response
{'graphqlApi': {'enhancedMetricsConfig': {'dataSourceLevelMetricsBehavior': 'FULL_REQUEST_DATA_SOURCE_METRICS ' '| ' 'PER_DATA_SOURCE_METRICS', 'operationLevelMetricsConfig': 'ENABLED ' '| ' 'DISABLED', 'resolverLevelMetricsBehavior': 'FULL_REQUEST_RESOLVER_METRICS ' '| ' 'PER_RESOLVER_METRICS'}}}
Updates a GraphqlApi object.
See also: AWS API Documentation
Request Syntax
client.update_graphql_api( apiId='string', name='string', logConfig={ 'fieldLogLevel': 'NONE'|'ERROR'|'ALL', 'cloudWatchLogsRoleArn': 'string', 'excludeVerboseContent': True|False }, authenticationType='API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA', userPoolConfig={ 'userPoolId': 'string', 'awsRegion': 'string', 'defaultAction': 'ALLOW'|'DENY', 'appIdClientRegex': 'string' }, openIDConnectConfig={ 'issuer': 'string', 'clientId': 'string', 'iatTTL': 123, 'authTTL': 123 }, additionalAuthenticationProviders=[ { 'authenticationType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA', 'openIDConnectConfig': { 'issuer': 'string', 'clientId': 'string', 'iatTTL': 123, 'authTTL': 123 }, 'userPoolConfig': { 'userPoolId': 'string', 'awsRegion': 'string', 'appIdClientRegex': 'string' }, 'lambdaAuthorizerConfig': { 'authorizerResultTtlInSeconds': 123, 'authorizerUri': 'string', 'identityValidationExpression': 'string' } }, ], xrayEnabled=True|False, lambdaAuthorizerConfig={ 'authorizerResultTtlInSeconds': 123, 'authorizerUri': 'string', 'identityValidationExpression': 'string' }, mergedApiExecutionRoleArn='string', ownerContact='string', introspectionConfig='ENABLED'|'DISABLED', queryDepthLimit=123, resolverCountLimit=123, enhancedMetricsConfig={ 'resolverLevelMetricsBehavior': 'FULL_REQUEST_RESOLVER_METRICS'|'PER_RESOLVER_METRICS', 'dataSourceLevelMetricsBehavior': 'FULL_REQUEST_DATA_SOURCE_METRICS'|'PER_DATA_SOURCE_METRICS', 'operationLevelMetricsConfig': 'ENABLED'|'DISABLED' } )
string
[REQUIRED]
The API ID.
string
[REQUIRED]
The new name for the GraphqlApi object.
dict
The Amazon CloudWatch Logs configuration for the GraphqlApi object.
fieldLogLevel (string) -- [REQUIRED]
The field logging level. Values can be NONE, ERROR, or ALL.
NONE : No field-level logs are captured.
ERROR : Logs the following information only for the fields that are in error:
The error section in the server response.
Field-level errors.
The generated request/response functions that got resolved for error fields.
ALL : The following information is logged for all fields in the query:
Field-level tracing information.
The generated request/response functions that got resolved for each field.
cloudWatchLogsRoleArn (string) -- [REQUIRED]
The service role that AppSync assumes to publish to CloudWatch logs in your account.
excludeVerboseContent (boolean) --
Set to TRUE to exclude sections that contain information such as headers, context, and evaluated mapping templates, regardless of logging level.
string
The new authentication type for the GraphqlApi object.
dict
The new Amazon Cognito user pool configuration for the ~GraphqlApi object.
userPoolId (string) -- [REQUIRED]
The user pool ID.
awsRegion (string) -- [REQUIRED]
The Amazon Web Services Region in which the user pool was created.
defaultAction (string) -- [REQUIRED]
The action that you want your GraphQL API to take when a request that uses Amazon Cognito user pool authentication doesn't match the Amazon Cognito user pool configuration.
appIdClientRegex (string) --
A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.
dict
The OpenID Connect configuration for the GraphqlApi object.
issuer (string) -- [REQUIRED]
The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of iss in the ID token.
clientId (string) --
The client identifier of the relying party at the OpenID identity provider. This identifier is typically obtained when the relying party is registered with the OpenID identity provider. You can specify a regular expression so that AppSync can validate against multiple client identifiers at a time.
iatTTL (integer) --
The number of milliseconds that a token is valid after it's issued to a user.
authTTL (integer) --
The number of milliseconds that a token is valid after being authenticated.
list
A list of additional authentication providers for the GraphqlApi API.
(dict) --
Describes an additional authentication provider.
authenticationType (string) --
The authentication type: API key, Identity and Access Management (IAM), OpenID Connect (OIDC), Amazon Cognito user pools, or Lambda.
openIDConnectConfig (dict) --
The OIDC configuration.
issuer (string) -- [REQUIRED]
The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of iss in the ID token.
clientId (string) --
The client identifier of the relying party at the OpenID identity provider. This identifier is typically obtained when the relying party is registered with the OpenID identity provider. You can specify a regular expression so that AppSync can validate against multiple client identifiers at a time.
iatTTL (integer) --
The number of milliseconds that a token is valid after it's issued to a user.
authTTL (integer) --
The number of milliseconds that a token is valid after being authenticated.
userPoolConfig (dict) --
The Amazon Cognito user pool configuration.
userPoolId (string) -- [REQUIRED]
The user pool ID.
awsRegion (string) -- [REQUIRED]
The Amazon Web Services Region in which the user pool was created.
appIdClientRegex (string) --
A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.
lambdaAuthorizerConfig (dict) --
Configuration for Lambda function authorization.
authorizerResultTtlInSeconds (integer) --
The number of seconds a response should be cached for. The default is 0 seconds, which disables caching. If you don't specify a value for authorizerResultTtlInSeconds , the default value is used. The maximum value is one hour (3600 seconds). The Lambda function can override this by returning a ttlOverride key in its response.
authorizerUri (string) -- [REQUIRED]
The Amazon Resource Name (ARN) of the Lambda function to be called for authorization. This can be a standard Lambda ARN, a version ARN (.../v3 ), or an alias ARN.
Note : This Lambda function must have the following resource-based policy assigned to it. When configuring Lambda authorizers in the console, this is done for you. To use the Command Line Interface (CLI), run the following:
aws lambda add-permission --function-name "arn:aws:lambda:us-east-2:111122223333:function:my-function" --statement-id "appsync" --principal appsync.amazonaws.com --action lambda:InvokeFunction
identityValidationExpression (string) --
A regular expression for validation of tokens before the Lambda function is called.
boolean
A flag indicating whether to use X-Ray tracing for the GraphqlApi .
dict
Configuration for Lambda function authorization.
authorizerResultTtlInSeconds (integer) --
The number of seconds a response should be cached for. The default is 0 seconds, which disables caching. If you don't specify a value for authorizerResultTtlInSeconds , the default value is used. The maximum value is one hour (3600 seconds). The Lambda function can override this by returning a ttlOverride key in its response.
authorizerUri (string) -- [REQUIRED]
The Amazon Resource Name (ARN) of the Lambda function to be called for authorization. This can be a standard Lambda ARN, a version ARN (.../v3 ), or an alias ARN.
Note : This Lambda function must have the following resource-based policy assigned to it. When configuring Lambda authorizers in the console, this is done for you. To use the Command Line Interface (CLI), run the following:
aws lambda add-permission --function-name "arn:aws:lambda:us-east-2:111122223333:function:my-function" --statement-id "appsync" --principal appsync.amazonaws.com --action lambda:InvokeFunction
identityValidationExpression (string) --
A regular expression for validation of tokens before the Lambda function is called.
string
The Identity and Access Management service role ARN for a merged API. The AppSync service assumes this role on behalf of the Merged API to validate access to source APIs at runtime and to prompt the AUTO_MERGE to update the merged API endpoint with the source API changes automatically.
string
The owner contact information for an API resource.
This field accepts any string input with a length of 0 - 256 characters.
string
Sets the value of the GraphQL API to enable (ENABLED ) or disable (DISABLED ) introspection. If no value is provided, the introspection configuration will be set to ENABLED by default. This field will produce an error if the operation attempts to use the introspection feature while this field is disabled.
For more information about introspection, see GraphQL introspection .
integer
The maximum depth a query can have in a single request. Depth refers to the amount of nested levels allowed in the body of query. The default value is 0 (or unspecified), which indicates there's no depth limit. If you set a limit, it can be between 1 and 75 nested levels. This field will produce a limit error if the operation falls out of bounds.
Note that fields can still be set to nullable or non-nullable. If a non-nullable field produces an error, the error will be thrown upwards to the first nullable field available.
integer
The maximum number of resolvers that can be invoked in a single request. The default value is 0 (or unspecified), which will set the limit to 10000 . When specified, the limit value can be between 1 and 10000 . This field will produce a limit error if the operation falls out of bounds.
dict
The enhancedMetricsConfig object.
resolverLevelMetricsBehavior (string) -- [REQUIRED]
Controls how resolver metrics will be emitted to CloudWatch. Resolver metrics include:
GraphQL errors: The number of GraphQL errors that occurred.
Requests: The number of invocations that occurred during a request.
Latency: The time to complete a resolver invocation.
Cache hits: The number of cache hits during a request.
Cache misses: The number of cache misses during a request.
These metrics can be emitted to CloudWatch per resolver or for all resolvers in the request. Metrics will be recorded by API ID and resolver name. resolverLevelMetricsBehavior accepts one of these values at a time:
FULL_REQUEST_RESOLVER_METRICS : Records and emits metric data for all resolvers in the request.
PER_RESOLVER_METRICS : Records and emits metric data for resolvers that have the metricConfig value set to ENABLED .
dataSourceLevelMetricsBehavior (string) -- [REQUIRED]
Controls how data source metrics will be emitted to CloudWatch. Data source metrics include:
Requests: The number of invocations that occured during a request.
Latency: The time to complete a data source invocation.
Errors: The number of errors that occurred during a data source invocation.
These metrics can be emitted to CloudWatch per data source or for all data sources in the request. Metrics will be recorded by API ID and data source name. dataSourceLevelMetricsBehavior accepts one of these values at a time:
FULL_REQUEST_DATA_SOURCE_METRICS : Records and emits metric data for all data sources in the request.
PER_DATA_SOURCE_METRICS : Records and emits metric data for data sources that have the metricConfig value set to ENABLED .
operationLevelMetricsConfig (string) -- [REQUIRED]
Controls how operation metrics will be emitted to CloudWatch. Operation metrics include:
Requests: The number of times a specified GraphQL operation was called.
GraphQL errors: The number of GraphQL errors that occurred during a specified GraphQL operation.
Metrics will be recorded by API ID and operation name. You can set the value to ENABLED or DISABLED .
dict
Response Syntax
{ 'graphqlApi': { 'name': 'string', 'apiId': 'string', 'authenticationType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA', 'logConfig': { 'fieldLogLevel': 'NONE'|'ERROR'|'ALL', 'cloudWatchLogsRoleArn': 'string', 'excludeVerboseContent': True|False }, 'userPoolConfig': { 'userPoolId': 'string', 'awsRegion': 'string', 'defaultAction': 'ALLOW'|'DENY', 'appIdClientRegex': 'string' }, 'openIDConnectConfig': { 'issuer': 'string', 'clientId': 'string', 'iatTTL': 123, 'authTTL': 123 }, 'arn': 'string', 'uris': { 'string': 'string' }, 'tags': { 'string': 'string' }, 'additionalAuthenticationProviders': [ { 'authenticationType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA', 'openIDConnectConfig': { 'issuer': 'string', 'clientId': 'string', 'iatTTL': 123, 'authTTL': 123 }, 'userPoolConfig': { 'userPoolId': 'string', 'awsRegion': 'string', 'appIdClientRegex': 'string' }, 'lambdaAuthorizerConfig': { 'authorizerResultTtlInSeconds': 123, 'authorizerUri': 'string', 'identityValidationExpression': 'string' } }, ], 'xrayEnabled': True|False, 'wafWebAclArn': 'string', 'lambdaAuthorizerConfig': { 'authorizerResultTtlInSeconds': 123, 'authorizerUri': 'string', 'identityValidationExpression': 'string' }, 'dns': { 'string': 'string' }, 'visibility': 'GLOBAL'|'PRIVATE', 'apiType': 'GRAPHQL'|'MERGED', 'mergedApiExecutionRoleArn': 'string', 'owner': 'string', 'ownerContact': 'string', 'introspectionConfig': 'ENABLED'|'DISABLED', 'queryDepthLimit': 123, 'resolverCountLimit': 123, 'enhancedMetricsConfig': { 'resolverLevelMetricsBehavior': 'FULL_REQUEST_RESOLVER_METRICS'|'PER_RESOLVER_METRICS', 'dataSourceLevelMetricsBehavior': 'FULL_REQUEST_DATA_SOURCE_METRICS'|'PER_DATA_SOURCE_METRICS', 'operationLevelMetricsConfig': 'ENABLED'|'DISABLED' } } }
Response Structure
(dict) --
graphqlApi (dict) --
The updated GraphqlApi object.
name (string) --
The API name.
apiId (string) --
The API ID.
authenticationType (string) --
The authentication type.
logConfig (dict) --
The Amazon CloudWatch Logs configuration.
fieldLogLevel (string) --
The field logging level. Values can be NONE, ERROR, or ALL.
NONE : No field-level logs are captured.
ERROR : Logs the following information only for the fields that are in error:
The error section in the server response.
Field-level errors.
The generated request/response functions that got resolved for error fields.
ALL : The following information is logged for all fields in the query:
Field-level tracing information.
The generated request/response functions that got resolved for each field.
cloudWatchLogsRoleArn (string) --
The service role that AppSync assumes to publish to CloudWatch logs in your account.
excludeVerboseContent (boolean) --
Set to TRUE to exclude sections that contain information such as headers, context, and evaluated mapping templates, regardless of logging level.
userPoolConfig (dict) --
The Amazon Cognito user pool configuration.
userPoolId (string) --
The user pool ID.
awsRegion (string) --
The Amazon Web Services Region in which the user pool was created.
defaultAction (string) --
The action that you want your GraphQL API to take when a request that uses Amazon Cognito user pool authentication doesn't match the Amazon Cognito user pool configuration.
appIdClientRegex (string) --
A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.
openIDConnectConfig (dict) --
The OpenID Connect configuration.
issuer (string) --
The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of iss in the ID token.
clientId (string) --
The client identifier of the relying party at the OpenID identity provider. This identifier is typically obtained when the relying party is registered with the OpenID identity provider. You can specify a regular expression so that AppSync can validate against multiple client identifiers at a time.
iatTTL (integer) --
The number of milliseconds that a token is valid after it's issued to a user.
authTTL (integer) --
The number of milliseconds that a token is valid after being authenticated.
arn (string) --
The Amazon Resource Name (ARN).
uris (dict) --
The URIs.
(string) --
(string) --
tags (dict) --
The tags.
(string) --
The key for the tag.
(string) --
The value for the tag.
additionalAuthenticationProviders (list) --
A list of additional authentication providers for the GraphqlApi API.
(dict) --
Describes an additional authentication provider.
authenticationType (string) --
The authentication type: API key, Identity and Access Management (IAM), OpenID Connect (OIDC), Amazon Cognito user pools, or Lambda.
openIDConnectConfig (dict) --
The OIDC configuration.
issuer (string) --
The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of iss in the ID token.
clientId (string) --
The client identifier of the relying party at the OpenID identity provider. This identifier is typically obtained when the relying party is registered with the OpenID identity provider. You can specify a regular expression so that AppSync can validate against multiple client identifiers at a time.
iatTTL (integer) --
The number of milliseconds that a token is valid after it's issued to a user.
authTTL (integer) --
The number of milliseconds that a token is valid after being authenticated.
userPoolConfig (dict) --
The Amazon Cognito user pool configuration.
userPoolId (string) --
The user pool ID.
awsRegion (string) --
The Amazon Web Services Region in which the user pool was created.
appIdClientRegex (string) --
A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.
lambdaAuthorizerConfig (dict) --
Configuration for Lambda function authorization.
authorizerResultTtlInSeconds (integer) --
The number of seconds a response should be cached for. The default is 0 seconds, which disables caching. If you don't specify a value for authorizerResultTtlInSeconds , the default value is used. The maximum value is one hour (3600 seconds). The Lambda function can override this by returning a ttlOverride key in its response.
authorizerUri (string) --
The Amazon Resource Name (ARN) of the Lambda function to be called for authorization. This can be a standard Lambda ARN, a version ARN (.../v3 ), or an alias ARN.
Note : This Lambda function must have the following resource-based policy assigned to it. When configuring Lambda authorizers in the console, this is done for you. To use the Command Line Interface (CLI), run the following:
aws lambda add-permission --function-name "arn:aws:lambda:us-east-2:111122223333:function:my-function" --statement-id "appsync" --principal appsync.amazonaws.com --action lambda:InvokeFunction
identityValidationExpression (string) --
A regular expression for validation of tokens before the Lambda function is called.
xrayEnabled (boolean) --
A flag indicating whether to use X-Ray tracing for this GraphqlApi .
wafWebAclArn (string) --
The ARN of the WAF access control list (ACL) associated with this GraphqlApi , if one exists.
lambdaAuthorizerConfig (dict) --
Configuration for Lambda function authorization.
authorizerResultTtlInSeconds (integer) --
The number of seconds a response should be cached for. The default is 0 seconds, which disables caching. If you don't specify a value for authorizerResultTtlInSeconds , the default value is used. The maximum value is one hour (3600 seconds). The Lambda function can override this by returning a ttlOverride key in its response.
authorizerUri (string) --
The Amazon Resource Name (ARN) of the Lambda function to be called for authorization. This can be a standard Lambda ARN, a version ARN (.../v3 ), or an alias ARN.
Note : This Lambda function must have the following resource-based policy assigned to it. When configuring Lambda authorizers in the console, this is done for you. To use the Command Line Interface (CLI), run the following:
aws lambda add-permission --function-name "arn:aws:lambda:us-east-2:111122223333:function:my-function" --statement-id "appsync" --principal appsync.amazonaws.com --action lambda:InvokeFunction
identityValidationExpression (string) --
A regular expression for validation of tokens before the Lambda function is called.
dns (dict) --
The DNS records for the API.
(string) --
(string) --
visibility (string) --
Sets the value of the GraphQL API to public (GLOBAL ) or private (PRIVATE ). If no value is provided, the visibility will be set to GLOBAL by default. This value cannot be changed once the API has been created.
apiType (string) --
The value that indicates whether the GraphQL API is a standard API (GRAPHQL ) or merged API (MERGED ).
mergedApiExecutionRoleArn (string) --
The Identity and Access Management service role ARN for a merged API. The AppSync service assumes this role on behalf of the Merged API to validate access to source APIs at runtime and to prompt the AUTO_MERGE to update the merged API endpoint with the source API changes automatically.
owner (string) --
The account owner of the GraphQL API.
ownerContact (string) --
The owner contact information for an API resource.
This field accepts any string input with a length of 0 - 256 characters.
introspectionConfig (string) --
Sets the value of the GraphQL API to enable (ENABLED ) or disable (DISABLED ) introspection. If no value is provided, the introspection configuration will be set to ENABLED by default. This field will produce an error if the operation attempts to use the introspection feature while this field is disabled.
For more information about introspection, see GraphQL introspection .
queryDepthLimit (integer) --
The maximum depth a query can have in a single request. Depth refers to the amount of nested levels allowed in the body of query. The default value is 0 (or unspecified), which indicates there's no depth limit. If you set a limit, it can be between 1 and 75 nested levels. This field will produce a limit error if the operation falls out of bounds.
Note that fields can still be set to nullable or non-nullable. If a non-nullable field produces an error, the error will be thrown upwards to the first nullable field available.
resolverCountLimit (integer) --
The maximum number of resolvers that can be invoked in a single request. The default value is 0 (or unspecified), which will set the limit to 10000 . When specified, the limit value can be between 1 and 10000 . This field will produce a limit error if the operation falls out of bounds.
enhancedMetricsConfig (dict) --
The enhancedMetricsConfig object.
resolverLevelMetricsBehavior (string) --
Controls how resolver metrics will be emitted to CloudWatch. Resolver metrics include:
GraphQL errors: The number of GraphQL errors that occurred.
Requests: The number of invocations that occurred during a request.
Latency: The time to complete a resolver invocation.
Cache hits: The number of cache hits during a request.
Cache misses: The number of cache misses during a request.
These metrics can be emitted to CloudWatch per resolver or for all resolvers in the request. Metrics will be recorded by API ID and resolver name. resolverLevelMetricsBehavior accepts one of these values at a time:
FULL_REQUEST_RESOLVER_METRICS : Records and emits metric data for all resolvers in the request.
PER_RESOLVER_METRICS : Records and emits metric data for resolvers that have the metricConfig value set to ENABLED .
dataSourceLevelMetricsBehavior (string) --
Controls how data source metrics will be emitted to CloudWatch. Data source metrics include:
Requests: The number of invocations that occured during a request.
Latency: The time to complete a data source invocation.
Errors: The number of errors that occurred during a data source invocation.
These metrics can be emitted to CloudWatch per data source or for all data sources in the request. Metrics will be recorded by API ID and data source name. dataSourceLevelMetricsBehavior accepts one of these values at a time:
FULL_REQUEST_DATA_SOURCE_METRICS : Records and emits metric data for all data sources in the request.
PER_DATA_SOURCE_METRICS : Records and emits metric data for data sources that have the metricConfig value set to ENABLED .
operationLevelMetricsConfig (string) --
Controls how operation metrics will be emitted to CloudWatch. Operation metrics include:
Requests: The number of times a specified GraphQL operation was called.
GraphQL errors: The number of GraphQL errors that occurred during a specified GraphQL operation.
Metrics will be recorded by API ID and operation name. You can set the value to ENABLED or DISABLED .
{'metricsConfig': 'ENABLED | DISABLED'}Response
{'resolver': {'metricsConfig': 'ENABLED | DISABLED'}}
Updates a Resolver object.
See also: AWS API Documentation
Request Syntax
client.update_resolver( apiId='string', typeName='string', fieldName='string', dataSourceName='string', requestMappingTemplate='string', responseMappingTemplate='string', kind='UNIT'|'PIPELINE', pipelineConfig={ 'functions': [ 'string', ] }, syncConfig={ 'conflictHandler': 'OPTIMISTIC_CONCURRENCY'|'LAMBDA'|'AUTOMERGE'|'NONE', 'conflictDetection': 'VERSION'|'NONE', 'lambdaConflictHandlerConfig': { 'lambdaConflictHandlerArn': 'string' } }, cachingConfig={ 'ttl': 123, 'cachingKeys': [ 'string', ] }, maxBatchSize=123, runtime={ 'name': 'APPSYNC_JS', 'runtimeVersion': 'string' }, code='string', metricsConfig='ENABLED'|'DISABLED' )
string
[REQUIRED]
The API ID.
string
[REQUIRED]
The new type name.
string
[REQUIRED]
The new field name.
string
The new data source name.
string
The new request mapping template.
A resolver uses a request mapping template to convert a GraphQL expression into a format that a data source can understand. Mapping templates are written in Apache Velocity Template Language (VTL).
VTL request mapping templates are optional when using an Lambda data source. For all other data sources, VTL request and response mapping templates are required.
string
The new response mapping template.
string
The resolver type.
UNIT : A UNIT resolver type. A UNIT resolver is the default resolver type. You can use a UNIT resolver to run a GraphQL query against a single data source.
PIPELINE : A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of Function objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.
dict
The PipelineConfig .
functions (list) --
A list of Function objects.
(string) --
dict
The SyncConfig for a resolver attached to a versioned data source.
conflictHandler (string) --
The Conflict Resolution strategy to perform in the event of a conflict.
OPTIMISTIC_CONCURRENCY : Resolve conflicts by rejecting mutations when versions don't match the latest version at the server.
AUTOMERGE : Resolve conflicts with the Automerge conflict resolution strategy.
LAMBDA : Resolve conflicts with an Lambda function supplied in the LambdaConflictHandlerConfig .
conflictDetection (string) --
The Conflict Detection strategy to use.
VERSION : Detect conflicts based on object versions for this resolver.
NONE : Do not detect conflicts when invoking this resolver.
lambdaConflictHandlerConfig (dict) --
The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.
lambdaConflictHandlerArn (string) --
The Amazon Resource Name (ARN) for the Lambda function to use as the Conflict Handler.
dict
The caching configuration for the resolver.
ttl (integer) -- [REQUIRED]
The TTL in seconds for a resolver that has caching activated.
Valid values are 1–3,600 seconds.
cachingKeys (list) --
The caching keys for a resolver that has caching activated.
Valid values are entries from the $context.arguments , $context.source , and $context.identity maps.
(string) --
integer
The maximum batching size for a resolver.
dict
Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.
name (string) -- [REQUIRED]
The name of the runtime to use. Currently, the only allowed value is APPSYNC_JS .
runtimeVersion (string) -- [REQUIRED]
The version of the runtime to use. Currently, the only allowed version is 1.0.0 .
string
The resolver code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS .
string
Enables or disables enhanced resolver metrics for specified resolvers. Note that metricsConfig won't be used unless the resolverLevelMetricsBehavior value is set to PER_RESOLVER_METRICS . If the resolverLevelMetricsBehavior is set to FULL_REQUEST_RESOLVER_METRICS instead, metricsConfig will be ignored. However, you can still set its value.
metricsConfig can be ENABLED or DISABLED .
dict
Response Syntax
{ 'resolver': { 'typeName': 'string', 'fieldName': 'string', 'dataSourceName': 'string', 'resolverArn': 'string', 'requestMappingTemplate': 'string', 'responseMappingTemplate': 'string', 'kind': 'UNIT'|'PIPELINE', 'pipelineConfig': { 'functions': [ 'string', ] }, 'syncConfig': { 'conflictHandler': 'OPTIMISTIC_CONCURRENCY'|'LAMBDA'|'AUTOMERGE'|'NONE', 'conflictDetection': 'VERSION'|'NONE', 'lambdaConflictHandlerConfig': { 'lambdaConflictHandlerArn': 'string' } }, 'cachingConfig': { 'ttl': 123, 'cachingKeys': [ 'string', ] }, 'maxBatchSize': 123, 'runtime': { 'name': 'APPSYNC_JS', 'runtimeVersion': 'string' }, 'code': 'string', 'metricsConfig': 'ENABLED'|'DISABLED' } }
Response Structure
(dict) --
resolver (dict) --
The updated Resolver object.
typeName (string) --
The resolver type name.
fieldName (string) --
The resolver field name.
dataSourceName (string) --
The resolver data source name.
resolverArn (string) --
The resolver Amazon Resource Name (ARN).
requestMappingTemplate (string) --
The request mapping template.
responseMappingTemplate (string) --
The response mapping template.
kind (string) --
The resolver type.
UNIT : A UNIT resolver type. A UNIT resolver is the default resolver type. You can use a UNIT resolver to run a GraphQL query against a single data source.
PIPELINE : A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of Function objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.
pipelineConfig (dict) --
The PipelineConfig .
functions (list) --
A list of Function objects.
(string) --
syncConfig (dict) --
The SyncConfig for a resolver attached to a versioned data source.
conflictHandler (string) --
The Conflict Resolution strategy to perform in the event of a conflict.
OPTIMISTIC_CONCURRENCY : Resolve conflicts by rejecting mutations when versions don't match the latest version at the server.
AUTOMERGE : Resolve conflicts with the Automerge conflict resolution strategy.
LAMBDA : Resolve conflicts with an Lambda function supplied in the LambdaConflictHandlerConfig .
conflictDetection (string) --
The Conflict Detection strategy to use.
VERSION : Detect conflicts based on object versions for this resolver.
NONE : Do not detect conflicts when invoking this resolver.
lambdaConflictHandlerConfig (dict) --
The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.
lambdaConflictHandlerArn (string) --
The Amazon Resource Name (ARN) for the Lambda function to use as the Conflict Handler.
cachingConfig (dict) --
The caching configuration for the resolver.
ttl (integer) --
The TTL in seconds for a resolver that has caching activated.
Valid values are 1–3,600 seconds.
cachingKeys (list) --
The caching keys for a resolver that has caching activated.
Valid values are entries from the $context.arguments , $context.source , and $context.identity maps.
(string) --
maxBatchSize (integer) --
The maximum batching size for a resolver.
runtime (dict) --
Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.
name (string) --
The name of the runtime to use. Currently, the only allowed value is APPSYNC_JS .
runtimeVersion (string) --
The version of the runtime to use. Currently, the only allowed version is 1.0.0 .
code (string) --
The resolver code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS .
metricsConfig (string) --
Enables or disables enhanced resolver metrics for specified resolvers. Note that metricsConfig won't be used unless the resolverLevelMetricsBehavior value is set to PER_RESOLVER_METRICS . If the resolverLevelMetricsBehavior is set to FULL_REQUEST_RESOLVER_METRICS instead, metricsConfig will be ignored. However, you can still set its value.
metricsConfig can be ENABLED or DISABLED .