graphql_apis
Creates, updates, deletes, gets or lists a graphql_apis resource.
Overview
| Name | graphql_apis |
| Type | Resource |
| Id | aws.appsync.graphql_apis |
Fields
The following fields are returned by SELECT queries:
- get_graphql_api
- list_graphql_apis
| Name | Datatype | Description |
|---|---|---|
name | string | The API name. (pattern: <code>[_A-Za-z][_0-9A-Za-z]*</code>) |
additional_authentication_providers | array | A list of additional authentication providers for the GraphqlApi API. |
api_id | string | The API ID. |
api_type | string | The value that indicates whether the GraphQL API is a standard API (GRAPHQL) or merged API (MERGED). (GRAPHQL, MERGED) |
arn | string | The Amazon Resource Name (ARN). |
authentication_type | string | The authentication type. (API_KEY, AWS_IAM, AMAZON_COGNITO_USER_POOLS, OPENID_CONNECT, AWS_LAMBDA) |
dns | object | The DNS records for the API. |
enhanced_metrics_config | object | Enables and controls the enhanced metrics feature. Enhanced metrics emit granular data on API usage and performance such as AppSync request and error counts, latency, and cache hits/misses. All enhanced metric data is sent to your CloudWatch account, and you can configure the types of data that will be sent. Enhanced metrics can be configured at the resolver, data source, and operation levels. EnhancedMetricsConfig contains three required parameters, each controlling one of these categories: resolverLevelMetricsBehavior: 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 metricsConfig value set to ENABLED. dataSourceLevelMetricsBehavior: 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 metricsConfig value set to ENABLED. operationLevelMetricsConfig: 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. |
introspection_config | 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. (ENABLED, DISABLED) |
lambda_authorizer_config | object | A LambdaAuthorizerConfig specifies how to authorize AppSync API access when using the AWS_LAMBDA authorizer mode. Be aware that an AppSync API can have only one Lambda authorizer configured at a time. |
log_config | object | The Amazon CloudWatch Logs configuration. |
merged_api_execution_role_arn | 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. |
open_id_connect_config | object | Describes an OpenID Connect (OIDC) configuration. |
owner | string | The account owner of the GraphQL API. |
owner_contact | string | The owner contact information for an API resource. This field accepts any string input with a length of 0 - 256 characters. |
query_depth_limit | 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. |
resolver_count_limit | 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. |
tags | object | The tags. |
uris | object | The URIs. |
user_pool_config | object | Describes an Amazon Cognito user pool configuration. |
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. (GLOBAL, PRIVATE) |
waf_web_acl_arn | string | The ARN of the WAF access control list (ACL) associated with this GraphqlApi, if one exists. |
xray_enabled | boolean | A flag indicating whether to use X-Ray tracing for this GraphqlApi. |
| Name | Datatype | Description |
|---|---|---|
name | string | The API name. (pattern: <code>[_A-Za-z][_0-9A-Za-z]*</code>) |
additional_authentication_providers | array | A list of additional authentication providers for the GraphqlApi API. |
api_id | string | The API ID. |
api_type | string | The value that indicates whether the GraphQL API is a standard API (GRAPHQL) or merged API (MERGED). (GRAPHQL, MERGED) |
arn | string | The Amazon Resource Name (ARN). |
authentication_type | string | The authentication type. (API_KEY, AWS_IAM, AMAZON_COGNITO_USER_POOLS, OPENID_CONNECT, AWS_LAMBDA) |
dns | object | The DNS records for the API. |
enhanced_metrics_config | object | Enables and controls the enhanced metrics feature. Enhanced metrics emit granular data on API usage and performance such as AppSync request and error counts, latency, and cache hits/misses. All enhanced metric data is sent to your CloudWatch account, and you can configure the types of data that will be sent. Enhanced metrics can be configured at the resolver, data source, and operation levels. EnhancedMetricsConfig contains three required parameters, each controlling one of these categories: resolverLevelMetricsBehavior: 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 metricsConfig value set to ENABLED. dataSourceLevelMetricsBehavior: 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 metricsConfig value set to ENABLED. operationLevelMetricsConfig: 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. |
introspection_config | 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. (ENABLED, DISABLED) |
lambda_authorizer_config | object | A LambdaAuthorizerConfig specifies how to authorize AppSync API access when using the AWS_LAMBDA authorizer mode. Be aware that an AppSync API can have only one Lambda authorizer configured at a time. |
log_config | object | The Amazon CloudWatch Logs configuration. |
merged_api_execution_role_arn | 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. |
open_id_connect_config | object | Describes an OpenID Connect (OIDC) configuration. |
owner | string | The account owner of the GraphQL API. |
owner_contact | string | The owner contact information for an API resource. This field accepts any string input with a length of 0 - 256 characters. |
query_depth_limit | 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. |
resolver_count_limit | 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. |
tags | object | The tags. |
uris | object | The URIs. |
user_pool_config | object | Describes an Amazon Cognito user pool configuration. |
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. (GLOBAL, PRIVATE) |
waf_web_acl_arn | string | The ARN of the WAF access control list (ACL) associated with this GraphqlApi, if one exists. |
xray_enabled | boolean | A flag indicating whether to use X-Ray tracing for this GraphqlApi. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_graphql_api | select | api_id, region | Retrieves a GraphqlApi object. | |
list_graphql_apis | select | region | nextToken, maxResults, apiType, owner | Lists your GraphQL APIs. |
create_graphql_api | insert | region, name, authenticationType | Creates a GraphqlApi object. | |
update_graphql_api | update | api_id, region, name, authenticationType | Updates a GraphqlApi object. | |
associate_merged_graphql_api | update | source_api_identifier, region, mergedApiIdentifier | Creates an association between a Merged API and source API using the source API's identifier. | |
associate_source_graphql_api | update | merged_api_identifier, region, sourceApiIdentifier | Creates an association between a Merged API and source API using the Merged API's identifier. | |
disassociate_merged_graphql_api | update | source_api_identifier, association_id, region | Deletes an association between a Merged API and source API using the source API's identifier and the association ID. | |
disassociate_source_graphql_api | update | merged_api_identifier, association_id, region | Deletes an association between a Merged API and source API using the Merged API's identifier and the association ID. | |
delete_graphql_api | delete | api_id, region | Deletes a GraphqlApi object. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
api_id | string | The API ID. |
association_id | string | The ID generated by the AppSync service for the source API association. |
merged_api_identifier | string | The identifier of the AppSync Merged API. This is generated by the AppSync service. In most cases, Merged APIs (especially in your account) only require the API ID value or ARN of the merged API. However, Merged APIs in other accounts (cross-account use cases) strictly require the full resource ARN of the merged API. |
region | string | AWS region (default: us-east-1) |
source_api_identifier | string | The identifier of the AppSync Source API. This is generated by the AppSync service. In most cases, source APIs (especially in your account) only require the API ID value or ARN of the source API. However, source APIs from other accounts (cross-account use cases) strictly require the full resource ARN of the source API. |
apiType | string | The value that indicates whether the GraphQL API is a standard API (GRAPHQL) or merged API (MERGED). |
maxResults | integer | The maximum number of results that you want the request to return. |
nextToken | 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. |
owner | string | The account owner of the GraphQL API. |
SELECT examples
- get_graphql_api
- list_graphql_apis
Retrieves a GraphqlApi object.
SELECT
name,
additional_authentication_providers,
api_id,
api_type,
arn,
authentication_type,
dns,
enhanced_metrics_config,
introspection_config,
lambda_authorizer_config,
log_config,
merged_api_execution_role_arn,
open_id_connect_config,
owner,
owner_contact,
query_depth_limit,
resolver_count_limit,
tags,
uris,
user_pool_config,
visibility,
waf_web_acl_arn,
xray_enabled
FROM aws.appsync.graphql_apis
WHERE api_id = '{{ api_id }}' -- required
AND region = '{{ region }}' -- required
;
Lists your GraphQL APIs.
SELECT
name,
additional_authentication_providers,
api_id,
api_type,
arn,
authentication_type,
dns,
enhanced_metrics_config,
introspection_config,
lambda_authorizer_config,
log_config,
merged_api_execution_role_arn,
open_id_connect_config,
owner,
owner_contact,
query_depth_limit,
resolver_count_limit,
tags,
uris,
user_pool_config,
visibility,
waf_web_acl_arn,
xray_enabled
FROM aws.appsync.graphql_apis
WHERE region = '{{ region }}' -- required
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
AND apiType = '{{ apiType }}'
AND owner = '{{ owner }}'
;
INSERT examples
- create_graphql_api
- Manifest
Creates a GraphqlApi object.
INSERT INTO aws.appsync.graphql_apis (
name,
logConfig,
authenticationType,
userPoolConfig,
openIDConnectConfig,
tags,
additionalAuthenticationProviders,
xrayEnabled,
lambdaAuthorizerConfig,
apiType,
mergedApiExecutionRoleArn,
visibility,
ownerContact,
introspectionConfig,
queryDepthLimit,
resolverCountLimit,
enhancedMetricsConfig,
region
)
SELECT
'{{ name }}' /* required */,
'{{ logConfig }}',
'{{ authenticationType }}' /* required */,
'{{ userPoolConfig }}',
'{{ openIDConnectConfig }}',
'{{ tags }}',
'{{ additionalAuthenticationProviders }}',
{{ xrayEnabled }},
'{{ lambdaAuthorizerConfig }}',
'{{ apiType }}',
'{{ mergedApiExecutionRoleArn }}',
'{{ visibility }}',
'{{ ownerContact }}',
'{{ introspectionConfig }}',
{{ queryDepthLimit }},
{{ resolverCountLimit }},
'{{ enhancedMetricsConfig }}',
'{{ region }}'
RETURNING
graphql_api
;
# Description fields are for documentation purposes
- name: graphql_apis
props:
- name: region
value: "{{ region }}"
description: Required parameter for the graphql_apis resource.
- name: name
value: "{{ name }}"
- name: logConfig
description: |
The Amazon CloudWatch Logs configuration.
value:
fieldLogLevel: "{{ fieldLogLevel }}"
cloudWatchLogsRoleArn: "{{ cloudWatchLogsRoleArn }}"
excludeVerboseContent: {{ excludeVerboseContent }}
- name: authenticationType
value: "{{ authenticationType }}"
valid_values: ['API_KEY', 'AWS_IAM', 'AMAZON_COGNITO_USER_POOLS', 'OPENID_CONNECT', 'AWS_LAMBDA']
- name: userPoolConfig
description: |
Describes an Amazon Cognito user pool configuration.
value:
userPoolId: "{{ userPoolId }}"
awsRegion: "{{ awsRegion }}"
defaultAction: "{{ defaultAction }}"
appIdClientRegex: "{{ appIdClientRegex }}"
- name: openIDConnectConfig
description: |
Describes an OpenID Connect (OIDC) configuration.
value:
issuer: "{{ issuer }}"
clientId: "{{ clientId }}"
iatTTL: {{ iatTTL }}
authTTL: {{ authTTL }}
- name: tags
value: "{{ tags }}"
description: |
A map with keys of TagKey objects and values of TagValue objects.
- name: additionalAuthenticationProviders
value:
- authenticationType: "{{ authenticationType }}"
openIDConnectConfig:
issuer: "{{ issuer }}"
clientId: "{{ clientId }}"
iatTTL: {{ iatTTL }}
authTTL: {{ authTTL }}
userPoolConfig:
userPoolId: "{{ userPoolId }}"
awsRegion: "{{ awsRegion }}"
appIdClientRegex: "{{ appIdClientRegex }}"
lambdaAuthorizerConfig:
authorizerResultTtlInSeconds: {{ authorizerResultTtlInSeconds }}
authorizerUri: "{{ authorizerUri }}"
identityValidationExpression: "{{ identityValidationExpression }}"
- name: xrayEnabled
value: {{ xrayEnabled }}
- name: lambdaAuthorizerConfig
description: |
A LambdaAuthorizerConfig specifies how to authorize AppSync API access when using the AWS_LAMBDA authorizer mode. Be aware that an AppSync API can have only one Lambda authorizer configured at a time.
value:
authorizerResultTtlInSeconds: {{ authorizerResultTtlInSeconds }}
authorizerUri: "{{ authorizerUri }}"
identityValidationExpression: "{{ identityValidationExpression }}"
- name: apiType
value: "{{ apiType }}"
valid_values: ['GRAPHQL', 'MERGED']
- name: mergedApiExecutionRoleArn
value: "{{ mergedApiExecutionRoleArn }}"
- name: visibility
value: "{{ visibility }}"
valid_values: ['GLOBAL', 'PRIVATE']
- name: ownerContact
value: "{{ ownerContact }}"
- name: introspectionConfig
value: "{{ introspectionConfig }}"
valid_values: ['ENABLED', 'DISABLED']
- name: queryDepthLimit
value: {{ queryDepthLimit }}
- name: resolverCountLimit
value: {{ resolverCountLimit }}
- name: enhancedMetricsConfig
description: |
Enables and controls the enhanced metrics feature. Enhanced metrics emit granular data on API usage and performance such as AppSync request and error counts, latency, and cache hits/misses. All enhanced metric data is sent to your CloudWatch account, and you can configure the types of data that will be sent. Enhanced metrics can be configured at the resolver, data source, and operation levels. EnhancedMetricsConfig contains three required parameters, each controlling one of these categories: resolverLevelMetricsBehavior: 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 metricsConfig value set to ENABLED. dataSourceLevelMetricsBehavior: 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 metricsConfig value set to ENABLED. operationLevelMetricsConfig: 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.
value:
resolverLevelMetricsBehavior: "{{ resolverLevelMetricsBehavior }}"
dataSourceLevelMetricsBehavior: "{{ dataSourceLevelMetricsBehavior }}"
operationLevelMetricsConfig: "{{ operationLevelMetricsConfig }}"
UPDATE examples
- update_graphql_api
- associate_merged_graphql_api
- associate_source_graphql_api
- disassociate_merged_graphql_api
- disassociate_source_graphql_api
Updates a GraphqlApi object.
UPDATE aws.appsync.graphql_apis
SET
name = '{{ name }}',
logConfig = '{{ logConfig }}',
authenticationType = '{{ authenticationType }}',
userPoolConfig = '{{ userPoolConfig }}',
openIDConnectConfig = '{{ openIDConnectConfig }}',
additionalAuthenticationProviders = '{{ additionalAuthenticationProviders }}',
xrayEnabled = {{ xrayEnabled }},
lambdaAuthorizerConfig = '{{ lambdaAuthorizerConfig }}',
mergedApiExecutionRoleArn = '{{ mergedApiExecutionRoleArn }}',
ownerContact = '{{ ownerContact }}',
introspectionConfig = '{{ introspectionConfig }}',
queryDepthLimit = {{ queryDepthLimit }},
resolverCountLimit = {{ resolverCountLimit }},
enhancedMetricsConfig = '{{ enhancedMetricsConfig }}'
WHERE
api_id = '{{ api_id }}' --required
AND region = '{{ region }}' --required
AND name = '{{ name }}' --required
AND authenticationType = '{{ authenticationType }}' --required
RETURNING
graphql_api;
Creates an association between a Merged API and source API using the source API's identifier.
UPDATE aws.appsync.graphql_apis
SET
mergedApiIdentifier = '{{ mergedApiIdentifier }}',
description = '{{ description }}',
sourceApiAssociationConfig = '{{ sourceApiAssociationConfig }}'
WHERE
source_api_identifier = '{{ source_api_identifier }}' --required
AND region = '{{ region }}' --required
AND mergedApiIdentifier = '{{ mergedApiIdentifier }}' --required
RETURNING
source_api_association;
Creates an association between a Merged API and source API using the Merged API's identifier.
UPDATE aws.appsync.graphql_apis
SET
sourceApiIdentifier = '{{ sourceApiIdentifier }}',
description = '{{ description }}',
sourceApiAssociationConfig = '{{ sourceApiAssociationConfig }}'
WHERE
merged_api_identifier = '{{ merged_api_identifier }}' --required
AND region = '{{ region }}' --required
AND sourceApiIdentifier = '{{ sourceApiIdentifier }}' --required
RETURNING
source_api_association;
Deletes an association between a Merged API and source API using the source API's identifier and the association ID.
UPDATE aws.appsync.graphql_apis
SET
-- No updatable properties
WHERE
source_api_identifier = '{{ source_api_identifier }}' --required
AND association_id = '{{ association_id }}' --required
AND region = '{{ region }}' --required
RETURNING
source_api_association_status;
Deletes an association between a Merged API and source API using the Merged API's identifier and the association ID.
UPDATE aws.appsync.graphql_apis
SET
-- No updatable properties
WHERE
merged_api_identifier = '{{ merged_api_identifier }}' --required
AND association_id = '{{ association_id }}' --required
AND region = '{{ region }}' --required
RETURNING
source_api_association_status;
DELETE examples
- delete_graphql_api
Deletes a GraphqlApi object.
DELETE FROM aws.appsync.graphql_apis
WHERE api_id = '{{ api_id }}' --required
AND region = '{{ region }}' --required
;