channel_namespaces
Creates, updates, deletes, gets or lists a channel_namespaces resource.
Overview
| Name | channel_namespaces |
| Type | Resource |
| Id | aws.appsync.channel_namespaces |
Fields
The following fields are returned by SELECT queries:
- get_channel_namespace
- list_channel_namespaces
| Name | Datatype | Description |
|---|---|---|
name | string | The 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_id | string | The Api ID. |
channel_namespace_arn | string | The Amazon Resource Name (ARN) for the ChannelNamespace. |
code_handlers | string | The event handler functions that run custom business logic to process published events and subscribe requests. |
created | string (date-time) | The date and time that the ChannelNamespace was created. |
handler_configs | object | The configuration for the OnPublish and OnSubscribe handlers. |
last_modified | string (date-time) | The date and time that the ChannelNamespace was last changed. |
publish_auth_modes | array | The authorization mode to use for publishing messages on the channel namespace. This configuration overrides the default Apiauthorization configuration. |
subscribe_auth_modes | array | The authorization mode to use for subscribing to messages on the channel namespace. This configuration overrides the default Apiauthorization configuration. |
tags | object |
| Name | Datatype | Description |
|---|---|---|
name | string | The 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_id | string | The Api ID. |
channel_namespace_arn | string | The Amazon Resource Name (ARN) for the ChannelNamespace. |
code_handlers | string | The event handler functions that run custom business logic to process published events and subscribe requests. |
created | string (date-time) | The date and time that the ChannelNamespace was created. |
handler_configs | object | The configuration for the OnPublish and OnSubscribe handlers. |
last_modified | string (date-time) | The date and time that the ChannelNamespace was last changed. |
publish_auth_modes | array | The authorization mode to use for publishing messages on the channel namespace. This configuration overrides the default Apiauthorization configuration. |
subscribe_auth_modes | array | The authorization mode to use for subscribing to messages on the channel namespace. This configuration overrides the default Apiauthorization configuration. |
tags | object |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_channel_namespace | select | api_id, name, region | Retrieves the channel namespace for a specified Api. | |
list_channel_namespaces | select | api_id, region | nextToken, maxResults | Lists 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_namespace | insert | api_id, region, name | Creates a ChannelNamespace for an Api. | |
update_channel_namespace | update | api_id, name, region | Updates a ChannelNamespace associated with an Api. | |
delete_channel_namespace | delete | api_id, name, region | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
api_id | string | The ID of the Api associated with the ChannelNamespace. |
name | string | The name of the ChannelNamespace. |
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_channel_namespace
- list_channel_namespaces
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
;
Lists the channel namespaces for a specified Api. ListChannelNamespaces returns only high level details for the channel namespace. To retrieve code handlers, use GetChannelNamespace.
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 region = '{{ region }}' -- required
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
;
INSERT examples
- create_channel_namespace
- Manifest
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
;
# Description fields are for documentation purposes
- name: channel_namespaces
props:
- name: api_id
value: "{{ api_id }}"
description: Required parameter for the channel_namespaces resource.
- name: region
value: "{{ region }}"
description: Required parameter for the channel_namespaces resource.
- name: name
value: "{{ name }}"
- name: subscribeAuthModes
value:
- authType: "{{ authType }}"
- name: publishAuthModes
value:
- authType: "{{ authType }}"
- name: codeHandlers
value: "{{ codeHandlers }}"
- name: tags
value: "{{ tags }}"
description: |
A map with keys of TagKey objects and values of TagValue objects.
- name: handlerConfigs
description: |
The configuration for the OnPublish and OnSubscribe handlers.
value:
onPublish:
behavior: "{{ behavior }}"
integration:
dataSourceName: "{{ dataSourceName }}"
lambdaConfig:
invokeType: "{{ invokeType }}"
onSubscribe:
behavior: "{{ behavior }}"
integration:
dataSourceName: "{{ dataSourceName }}"
lambdaConfig:
invokeType: "{{ invokeType }}"
UPDATE examples
- update_channel_namespace
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
- delete_channel_namespace
Deletes a ChannelNamespace.
DELETE FROM aws.appsync.channel_namespaces
WHERE api_id = '{{ api_id }}' --required
AND name = '{{ name }}' --required
AND region = '{{ region }}' --required
;