Skip to main content

apis

Creates, updates, deletes, gets or lists an apis resource.

Overview

Nameapis
TypeResource
Idaws.appsync.apis

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name of the Api. (pattern: <code>[A-Za-z0-9_-\ ]+</code>)
api_arnstringThe Amazon Resource Name (ARN) for the Api.
api_idstringThe Api ID.
createdstring (date-time)The date and time that the Api was created.
dnsobjectThe DNS records for the API. This will include an HTTP and a real-time endpoint.
event_configobjectDescribes the authorization configuration for connections, message publishing, message subscriptions, and logging for an Event API.
owner_contactstringThe owner contact information for the Api (pattern: <code>[A-Za-z0-9_-\ .]+</code>)
tagsobject
waf_web_acl_arnstringThe Amazon Resource Name (ARN) of the WAF web access control list (web ACL) associated with this Api, if one exists.
xray_enabledbooleanA flag indicating whether to use X-Ray tracing for this Api.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_apiselectapi_id, regionRetrieves an Api object.
list_apisselectregionnextToken, maxResultsLists the APIs in your AppSync account. ListApis returns only the high level API details. For more detailed information about an API, use GetApi.
create_apiinsertregion, name, eventConfigCreates an Api object. Use this operation to create an AppSync API with your preferred configuration, such as an Event API that provides real-time message publishing and message subscriptions over WebSockets.
update_apiupdateapi_id, region, name, eventConfigUpdates an Api.
associate_apiupdatedomain_name, region, apiIdMaps an endpoint to your custom domain.
disassociate_apiupdatedomain_name, regionRemoves an ApiAssociation object from a custom domain.
delete_apideleteapi_id, regionDeletes an Api object
flush_api_cacheexecapi_id, regionFlushes an ApiCache object.
start_schema_creationexecapi_id, region, definitionAdds a new schema to your GraphQL API. This operation is asynchronous. Use to determine when it has completed.

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.

NameDatatypeDescription
api_idstringThe API ID.
domain_namestringThe domain name.
regionstringAWS region (default: us-east-1)
maxResultsintegerThe maximum number of results that you want the request to return.
nextTokenstringAn 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.

SELECT examples

Retrieves an Api object.

SELECT
name,
api_arn,
api_id,
created,
dns,
event_config,
owner_contact,
tags,
waf_web_acl_arn,
xray_enabled
FROM aws.appsync.apis
WHERE api_id = '{{ api_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates an Api object. Use this operation to create an AppSync API with your preferred configuration, such as an Event API that provides real-time message publishing and message subscriptions over WebSockets.

INSERT INTO aws.appsync.apis (
name,
ownerContact,
tags,
eventConfig,
region
)
SELECT
'{{ name }}' /* required */,
'{{ ownerContact }}',
'{{ tags }}',
'{{ eventConfig }}' /* required */,
'{{ region }}'
RETURNING
api
;

UPDATE examples

Updates an Api.

UPDATE aws.appsync.apis
SET
name = '{{ name }}',
ownerContact = '{{ ownerContact }}',
eventConfig = '{{ eventConfig }}'
WHERE
api_id = '{{ api_id }}' --required
AND region = '{{ region }}' --required
AND name = '{{ name }}' --required
AND eventConfig = '{{ eventConfig }}' --required
RETURNING
api;

DELETE examples

Deletes an Api object

DELETE FROM aws.appsync.apis
WHERE api_id = '{{ api_id }}' --required
AND region = '{{ region }}' --required
;

Lifecycle Methods

Flushes an ApiCache object.

EXEC aws.appsync.apis.flush_api_cache
@api_id='{{ api_id }}' --required,
@region='{{ region }}' --required
;