apis
Creates, updates, deletes or gets an api resource or lists apis in a region
Overview
| Name | apis |
| Type | Resource |
| Description | Resource schema for AppSync Api |
| Id | awscc.appsync.apis |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
api_id | string | The unique identifier for the AppSync Api generated by the service |
api_arn | string | The Amazon Resource Name (ARN) of the AppSync Api |
name | string | The name of the AppSync API. |
owner_contact | string | The owner contact information for an API resource. |
dns | object | A map of DNS names for the AppSync API. |
event_config | object | The configuration for an Event Api |
tags | array | An arbitrary set of tags (key-value pairs) for this Domain Name. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
api_arn | string | The Amazon Resource Name (ARN) of the AppSync Api |
region | string | AWS region. |
For more information, see AWS::AppSync::Api.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | apis | INSERT | Name, region |
delete_resource | apis | DELETE | Identifier, region |
update_resource | apis | UPDATE | Identifier, PatchDocument, region |
list_resources | apis_list_only | SELECT | region |
get_resource | apis | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual api.
SELECT
region,
api_id,
api_arn,
name,
owner_contact,
dns,
event_config,
tags
FROM awscc.appsync.apis
WHERE
region = 'us-east-1' AND
Identifier = '{{ api_arn }}';
Lists all apis in a region.
SELECT
region,
api_arn
FROM awscc.appsync.apis_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new api resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.appsync.apis (
Name,
region
)
SELECT
'{{ name }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.appsync.apis (
Name,
OwnerContact,
EventConfig,
Tags,
region
)
SELECT
'{{ name }}',
'{{ owner_contact }}',
'{{ event_config }}',
'{{ tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: api
props:
- name: name
value: '{{ name }}'
- name: owner_contact
value: '{{ owner_contact }}'
- name: event_config
value:
auth_providers:
- auth_type: '{{ auth_type }}'
open_id_connect_config:
client_id: '{{ client_id }}'
auth_ttl: null
issuer: '{{ issuer }}'
iat_ttl: null
cognito_config:
app_id_client_regex: '{{ app_id_client_regex }}'
user_pool_id: '{{ user_pool_id }}'
aws_region: '{{ aws_region }}'
lambda_authorizer_config:
identity_validation_expression: '{{ identity_validation_expression }}'
authorizer_uri: '{{ authorizer_uri }}'
authorizer_result_ttl_in_seconds: '{{ authorizer_result_ttl_in_seconds }}'
connection_auth_modes:
- auth_type: null
default_publish_auth_modes: null
default_subscribe_auth_modes: null
log_config:
log_level: '{{ log_level }}'
cloud_watch_logs_role_arn: '{{ cloud_watch_logs_role_arn }}'
- name: tags
value:
- value: '{{ value }}'
key: '{{ key }}'
UPDATE example
Use the following StackQL query and manifest file to update a api resource, using stack-deploy.
/*+ update */
UPDATE awscc.appsync.apis
SET PatchDocument = string('{{ {
"Name": name,
"OwnerContact": owner_contact,
"EventConfig": event_config,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ api_arn }}';
DELETE example
/*+ delete */
DELETE FROM awscc.appsync.apis
WHERE
Identifier = '{{ api_arn }}' AND
region = 'us-east-1';
Permissions
To operate on the apis resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
appsync:CreateApi,
appsync:TagResource,
appsync:GetApi,
iam:PassRole
appsync:GetApi,
appsync:ListTagsForResource
appsync:UpdateApi,
appsync:TagResource,
appsync:UntagResource,
appsync:GetApi,
iam:PassRole
appsync:DeleteApi,
appsync:UntagResource
appsync:ListApis