channel_namespaces
Creates, updates, deletes or gets a channel_namespace resource or lists channel_namespaces in a region
Overview
| Name | channel_namespaces |
| Type | Resource |
| Description | Resource schema for AppSync ChannelNamespace |
| Id | awscc.appsync.channel_namespaces |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
api_id | string | AppSync Api Id that this Channel Namespace belongs to. |
name | string | Namespace indentifier. |
subscribe_auth_modes | array | List of AuthModes supported for Subscribe operations. |
code_handlers | string | String of APPSYNC_JS code to be used by the handlers. |
code_s3_location | string | The Amazon S3 endpoint where the code is located. |
channel_namespace_arn | string | The Amazon Resource Name (ARN) for the Channel Namespace. |
tags | array | An arbitrary set of tags (key-value pairs) for this Domain Name. |
handler_configs | object | |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
name | string | Namespace indentifier. |
channel_namespace_arn | string | The Amazon Resource Name (ARN) for the Channel Namespace. |
region | string | AWS region. |
For more information, see AWS::AppSync::ChannelNamespace.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | channel_namespaces | INSERT | ApiId, Name, region |
delete_resource | channel_namespaces | DELETE | Identifier, region |
update_resource | channel_namespaces | UPDATE | Identifier, PatchDocument, region |
list_resources | channel_namespaces_list_only | SELECT | region |
get_resource | channel_namespaces | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual channel_namespace.
SELECT
region,
api_id,
name,
subscribe_auth_modes,
publish_auth_modes,
code_handlers,
code_s3_location,
channel_namespace_arn,
tags,
handler_configs
FROM awscc.appsync.channel_namespaces
WHERE
region = '{{ region }}' AND
Identifier = '{{ channel_namespace_arn }}';
Lists all channel_namespaces in a region.
SELECT
region,
channel_namespace_arn
FROM awscc.appsync.channel_namespaces_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new channel_namespace resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.appsync.channel_namespaces (
ApiId,
Name,
region
)
SELECT
'{{ api_id }}',
'{{ name }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.appsync.channel_namespaces (
ApiId,
Name,
SubscribeAuthModes,
PublishAuthModes,
CodeHandlers,
CodeS3Location,
Tags,
HandlerConfigs,
region
)
SELECT
'{{ api_id }}',
'{{ name }}',
'{{ subscribe_auth_modes }}',
'{{ publish_auth_modes }}',
'{{ code_handlers }}',
'{{ code_s3_location }}',
'{{ tags }}',
'{{ handler_configs }}',
'{{ 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: channel_namespace
props:
- name: api_id
value: '{{ api_id }}'
- name: name
value: '{{ name }}'
- name: subscribe_auth_modes
value:
- auth_type: '{{ auth_type }}'
- name: publish_auth_modes
value: null
- name: code_handlers
value: '{{ code_handlers }}'
- name: code_s3_location
value: '{{ code_s3_location }}'
- name: tags
value:
- value: '{{ value }}'
key: '{{ key }}'
- name: handler_configs
value:
on_publish:
behavior: '{{ behavior }}'
integration:
data_source_name: '{{ data_source_name }}'
lambda_config:
lambda_function_arn: '{{ lambda_function_arn }}'
on_subscribe: null
UPDATE example
Use the following StackQL query and manifest file to update a channel_namespace resource, using stack-deploy.
/*+ update */
UPDATE awscc.appsync.channel_namespaces
SET PatchDocument = string('{{ {
"SubscribeAuthModes": subscribe_auth_modes,
"PublishAuthModes": publish_auth_modes,
"CodeHandlers": code_handlers,
"CodeS3Location": code_s3_location,
"Tags": tags,
"HandlerConfigs": handler_configs
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ channel_namespace_arn }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.appsync.channel_namespaces
WHERE
Identifier = '{{ channel_namespace_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 channel_namespaces resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
appsync:CreateChannelNamespace,
appsync:TagResource,
appsync:GetChannelNamespace,
s3:GetObject
appsync:GetChannelNamespace,
appsync:ListTagsForResource
appsync:UpdateChannelNamespace,
appsync:TagResource,
appsync:UntagResource,
appsync:GetChannelNamespace,
s3:GetObject
appsync:DeleteChannelNamespace,
appsync:UntagResource
appsync:ListChannelNamespaces