Skip to main content

apis

Creates, updates, deletes or gets an api resource or lists apis in a region

Overview

Nameapis
TypeResource
DescriptionResource schema for AppSync Api
Idawscc.appsync.apis

Fields

NameDatatypeDescription
api_idstringThe unique identifier for the AppSync Api generated by the service
api_arnstringThe Amazon Resource Name (ARN) of the AppSync Api
namestringThe name of the AppSync API.
owner_contactstringThe owner contact information for an API resource.
dnsobjectA map of DNS names for the AppSync API.
event_configobjectThe configuration for an Event Api
tagsarrayAn arbitrary set of tags (key-value pairs) for this Domain Name.
regionstringAWS region.

For more information, see AWS::AppSync::Api.

Methods

NameResourceAccessible byRequired Params
create_resourceapisINSERTName, region
delete_resourceapisDELETEIdentifier, region
update_resourceapisUPDATEIdentifier, PatchDocument, region
list_resourcesapis_list_onlySELECTregion
get_resourceapisSELECTIdentifier, region

SELECT examples

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 }}';

INSERT example

Use the following StackQL query and manifest file to create a new api resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.appsync.apis (
Name,
region
)
SELECT
'{{ name }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

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:

ParameterDescription
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:

appsync:CreateApi,
appsync:TagResource,
appsync:GetApi,
iam:PassRole