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 = '{{ region }}' AND
Identifier = '{{ api_arn }}';
Lists all apis in a region.
SELECT
region,
api_arn
FROM awscc.appsync.apis_list_only
WHERE
region = '{{ region }}';
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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.appsync.apis (
Name,
OwnerContact,
EventConfig,
Tags,
region
)
SELECT
'{{ name }}',
'{{ owner_contact }}',
'{{ event_config }}',
'{{ tags }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.appsync.apis
WHERE
Identifier = '{{ api_arn }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
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