apis
Creates, updates, deletes, gets or lists an apis resource.
Overview
| Name | apis |
| Type | Resource |
| Id | aws.appsync.apis |
Fields
The following fields are returned by SELECT queries:
- get_api
- list_apis
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the Api. (pattern: <code>[A-Za-z0-9_-\ ]+</code>) |
api_arn | string | The Amazon Resource Name (ARN) for the Api. |
api_id | string | The Api ID. |
created | string (date-time) | The date and time that the Api was created. |
dns | object | The DNS records for the API. This will include an HTTP and a real-time endpoint. |
event_config | object | Describes the authorization configuration for connections, message publishing, message subscriptions, and logging for an Event API. |
owner_contact | string | The owner contact information for the Api (pattern: <code>[A-Za-z0-9_-\ .]+</code>) |
tags | object | |
waf_web_acl_arn | string | The Amazon Resource Name (ARN) of the WAF web access control list (web ACL) associated with this Api, if one exists. |
xray_enabled | boolean | A flag indicating whether to use X-Ray tracing for this Api. |
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the Api. (pattern: <code>[A-Za-z0-9_-\ ]+</code>) |
api_arn | string | The Amazon Resource Name (ARN) for the Api. |
api_id | string | The Api ID. |
created | string (date-time) | The date and time that the Api was created. |
dns | object | The DNS records for the API. This will include an HTTP and a real-time endpoint. |
event_config | object | Describes the authorization configuration for connections, message publishing, message subscriptions, and logging for an Event API. |
owner_contact | string | The owner contact information for the Api (pattern: <code>[A-Za-z0-9_-\ .]+</code>) |
tags | object | |
waf_web_acl_arn | string | The Amazon Resource Name (ARN) of the WAF web access control list (web ACL) associated with this Api, if one exists. |
xray_enabled | boolean | A flag indicating whether to use X-Ray tracing for this Api. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_api | select | api_id, region | Retrieves an Api object. | |
list_apis | select | region | nextToken, maxResults | Lists the APIs in your AppSync account. ListApis returns only the high level API details. For more detailed information about an API, use GetApi. |
create_api | insert | region, name, eventConfig | 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. | |
update_api | update | api_id, region, name, eventConfig | Updates an Api. | |
associate_api | update | domain_name, region, apiId | Maps an endpoint to your custom domain. | |
disassociate_api | update | domain_name, region | Removes an ApiAssociation object from a custom domain. | |
delete_api | delete | api_id, region | Deletes an Api object | |
flush_api_cache | exec | api_id, region | Flushes an ApiCache object. | |
start_schema_creation | exec | api_id, region, definition | Adds 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.
| Name | Datatype | Description |
|---|---|---|
api_id | string | The API ID. |
domain_name | string | The domain name. |
region | string | AWS region (default: us-east-1) |
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. |
SELECT examples
- get_api
- list_apis
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
;
Lists the APIs in your AppSync account. ListApis returns only the high level API details. For more detailed information about an API, use GetApi.
SELECT
name,
api_arn,
api_id,
created,
dns,
event_config,
owner_contact,
tags,
waf_web_acl_arn,
xray_enabled
FROM aws.appsync.apis
WHERE region = '{{ region }}' -- required
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
;
INSERT examples
- create_api
- Manifest
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
;
# Description fields are for documentation purposes
- name: apis
props:
- name: region
value: "{{ region }}"
description: Required parameter for the apis resource.
- name: name
value: "{{ name }}"
- name: ownerContact
value: "{{ ownerContact }}"
- name: tags
value: "{{ tags }}"
description: |
A map with keys of TagKey objects and values of TagValue objects.
- name: eventConfig
description: |
Describes the authorization configuration for connections, message publishing, message subscriptions, and logging for an Event API.
value:
authProviders:
- authType: "{{ authType }}"
cognitoConfig:
userPoolId: "{{ userPoolId }}"
awsRegion: "{{ awsRegion }}"
appIdClientRegex: "{{ appIdClientRegex }}"
openIDConnectConfig:
issuer: "{{ issuer }}"
clientId: "{{ clientId }}"
iatTTL: {{ iatTTL }}
authTTL: {{ authTTL }}
lambdaAuthorizerConfig:
authorizerResultTtlInSeconds: {{ authorizerResultTtlInSeconds }}
authorizerUri: "{{ authorizerUri }}"
identityValidationExpression: "{{ identityValidationExpression }}"
connectionAuthModes:
- authType: "{{ authType }}"
defaultPublishAuthModes:
- authType: "{{ authType }}"
defaultSubscribeAuthModes:
- authType: "{{ authType }}"
logConfig:
logLevel: "{{ logLevel }}"
cloudWatchLogsRoleArn: "{{ cloudWatchLogsRoleArn }}"
UPDATE examples
- update_api
- associate_api
- disassociate_api
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;
Maps an endpoint to your custom domain.
UPDATE aws.appsync.apis
SET
apiId = '{{ apiId }}'
WHERE
domain_name = '{{ domain_name }}' --required
AND region = '{{ region }}' --required
AND apiId = '{{ apiId }}' --required
RETURNING
api_association;
Removes an ApiAssociation object from a custom domain.
UPDATE aws.appsync.apis
SET
-- No updatable properties
WHERE
domain_name = '{{ domain_name }}' --required
AND region = '{{ region }}' --required;
DELETE examples
- delete_api
Deletes an Api object
DELETE FROM aws.appsync.apis
WHERE api_id = '{{ api_id }}' --required
AND region = '{{ region }}' --required
;
Lifecycle Methods
- flush_api_cache
- start_schema_creation
Flushes an ApiCache object.
EXEC aws.appsync.apis.flush_api_cache
@api_id='{{ api_id }}' --required,
@region='{{ region }}' --required
;
Adds a new schema to your GraphQL API. This operation is asynchronous. Use to determine when it has completed.
EXEC aws.appsync.apis.start_schema_creation
@api_id='{{ api_id }}' --required,
@region='{{ region }}' --required
@@json=
'{
"definition": "{{ definition }}"
}'
;