Skip to main content

channel_namespaces

Creates, updates, deletes, gets or lists a channel_namespaces resource.

Overview

Namechannel_namespaces
TypeResource
Idaws.appsync.channel_namespaces

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name of the channel namespace. This name must be unique within the Api. (pattern: <code>([A-Za-z0-9](?:[A-Za-z0-9-]{0,48}[A-Za-z0-9])?)</code>)
api_idstringThe Api ID.
channel_namespace_arnstringThe Amazon Resource Name (ARN) for the ChannelNamespace.
code_handlersstringThe event handler functions that run custom business logic to process published events and subscribe requests.
createdstring (date-time)The date and time that the ChannelNamespace was created.
handler_configsobjectThe configuration for the OnPublish and OnSubscribe handlers.
last_modifiedstring (date-time)The date and time that the ChannelNamespace was last changed.
publish_auth_modesarrayThe authorization mode to use for publishing messages on the channel namespace. This configuration overrides the default Apiauthorization configuration.
subscribe_auth_modesarrayThe authorization mode to use for subscribing to messages on the channel namespace. This configuration overrides the default Apiauthorization configuration.
tagsobject

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_channel_namespaceselectapi_id, name, regionRetrieves the channel namespace for a specified Api.
list_channel_namespacesselectapi_id, regionnextToken, maxResultsLists the channel namespaces for a specified Api. ListChannelNamespaces returns only high level details for the channel namespace. To retrieve code handlers, use GetChannelNamespace.
create_channel_namespaceinsertapi_id, region, nameCreates a ChannelNamespace for an Api.
update_channel_namespaceupdateapi_id, name, regionUpdates a ChannelNamespace associated with an Api.
delete_channel_namespacedeleteapi_id, name, regionDeletes a ChannelNamespace.

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 ID of the Api associated with the ChannelNamespace.
namestringThe name of the ChannelNamespace.
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 the channel namespace for a specified Api.

SELECT
name,
api_id,
channel_namespace_arn,
code_handlers,
created,
handler_configs,
last_modified,
publish_auth_modes,
subscribe_auth_modes,
tags
FROM aws.appsync.channel_namespaces
WHERE api_id = '{{ api_id }}' -- required
AND name = '{{ name }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a ChannelNamespace for an Api.

INSERT INTO aws.appsync.channel_namespaces (
name,
subscribeAuthModes,
publishAuthModes,
codeHandlers,
tags,
handlerConfigs,
api_id,
region
)
SELECT
'{{ name }}' /* required */,
'{{ subscribeAuthModes }}',
'{{ publishAuthModes }}',
'{{ codeHandlers }}',
'{{ tags }}',
'{{ handlerConfigs }}',
'{{ api_id }}',
'{{ region }}'
RETURNING
channel_namespace
;

UPDATE examples

Updates a ChannelNamespace associated with an Api.

UPDATE aws.appsync.channel_namespaces
SET
subscribeAuthModes = '{{ subscribeAuthModes }}',
publishAuthModes = '{{ publishAuthModes }}',
codeHandlers = '{{ codeHandlers }}',
handlerConfigs = '{{ handlerConfigs }}'
WHERE
api_id = '{{ api_id }}' --required
AND name = '{{ name }}' --required
AND region = '{{ region }}' --required
RETURNING
channel_namespace;

DELETE examples

Deletes a ChannelNamespace.

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