Skip to main content

channels

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

Overview

Namechannels
TypeResource
Idaws.ivs.channels

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
access_control_allow_originstringSee Access-Control-Allow-Origin in the MDN Web Docs.
access_control_expose_headersstringSee Access-Control-Expose-Headers in the MDN Web Docs.
cache_controlstringSee Cache-Control in the MDN Web Docs.
channelsarray
content_security_policystringSee Content-Security-Policy in the MDN Web Docs.
errorsarrayEach error object is related to a specific ARN in the request.
strict_transport_securitystringSee Strict-Transport-Security in the MDN Web Docs.
x_content_type_optionsstringSee X-Content-Type-Options in the MDN Web Docs.
x_frame_optionsstringSee X-Frame-Options in the MDN Web Docs.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
batch_get_channelselectregionPerforms GetChannel on multiple ARNs simultaneously.
get_channelselectregionGets the channel configuration for the specified channel ARN. See also BatchGetChannel.
list_channelsselectregionGets summary information about all channels in your account, in the Amazon Web Services region where the API request is processed. This list can be filtered to match a specified name or recording-configuration ARN. Filters are mutually exclusive and cannot be used together. If you try to use both filters, you will get an error (409 ConflictException).
create_channelinsertregionCreates a new channel and an associated stream key to start streaming.
update_channelupdateregion, arnUpdates a channel's configuration. Live channels cannot be updated. You must stop the ongoing stream, update the channel, and restart the stream for the changes to take effect.
put_metadatareplaceregion, channelArn, metadataInserts metadata into the active stream of the specified channel. At most 5 requests per second per channel are allowed, each with a maximum 1 KB payload. (If 5 TPS is not sufficient for your needs, we recommend batching your data into a single PutMetadata call.) At most 155 requests per second per account are allowed. Also see Embedding Metadata within a Video Stream in the Amazon IVS User Guide.
delete_channeldeleteregionDeletes the specified channel and its associated stream keys. If you try to delete a live channel, you will get an error (409 ConflictException). To delete a channel that is live, call StopStream, wait for the Amazon EventBridge "Stream End" event (to verify that the stream's state is no longer Live), then call DeleteChannel. (See Using EventBridge with Amazon IVS.)
insert_ad_breakexecregion, channelArn, durationSecondsInserts an ad marker in the playlist for the specified channel and duration using the ad configuration associated with the channel. Note: AWS Elemental MediaTailor (EMT), the service that handles ad requests, provides CloudWatch metrics to help you monitor the success or failure of each InsertAdBreak operation. See Monitoring AWS Elemental MediaTailor with Amazon CloudWatch metrics in the AWS Elemental MediaTailor User Guide for details on available metrics.
start_viewer_session_revocationexecregion, channelArn, viewerIdStarts the process of revoking the viewer session associated with a specified channel ARN and viewer ID. Optionally, you can provide a version to revoke viewer sessions less than and including that version. For instructions on associating a viewer ID with a viewer session, see Setting Up Private Channels.
stop_streamexecregion, channelArnDisconnects the incoming RTMPS stream for the specified channel. Can be used in conjunction with DeleteStreamKey to prevent further streaming to a channel. Many streaming client-software libraries automatically reconnect a dropped RTMPS session, so to stop the stream permanently, you may want to first revoke the streamKey attached to the channel.

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
regionstringAWS region (default: us-east-1)

SELECT examples

Performs GetChannel on multiple ARNs simultaneously.

SELECT
access_control_allow_origin,
access_control_expose_headers,
cache_control,
channels,
content_security_policy,
errors,
strict_transport_security,
x_content_type_options,
x_frame_options
FROM aws.ivs.channels
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a new channel and an associated stream key to start streaming.

INSERT INTO aws.ivs.channels (
name,
latencyMode,
type,
authorized,
recordingConfigurationArn,
tags,
insecureIngest,
preset,
playbackRestrictionPolicyArn,
multitrackInputConfiguration,
containerFormat,
adConfigurationArn,
region
)
SELECT
'{{ name }}',
'{{ latencyMode }}',
'{{ type }}',
{{ authorized }},
'{{ recordingConfigurationArn }}',
'{{ tags }}',
{{ insecureIngest }},
'{{ preset }}',
'{{ playbackRestrictionPolicyArn }}',
'{{ multitrackInputConfiguration }}',
'{{ containerFormat }}',
'{{ adConfigurationArn }}',
'{{ region }}'
RETURNING
channel,
stream_key
;

UPDATE examples

Updates a channel's configuration. Live channels cannot be updated. You must stop the ongoing stream, update the channel, and restart the stream for the changes to take effect.

UPDATE aws.ivs.channels
SET
arn = '{{ arn }}',
name = '{{ name }}',
latencyMode = '{{ latencyMode }}',
type = '{{ type }}',
authorized = {{ authorized }},
recordingConfigurationArn = '{{ recordingConfigurationArn }}',
insecureIngest = {{ insecureIngest }},
preset = '{{ preset }}',
playbackRestrictionPolicyArn = '{{ playbackRestrictionPolicyArn }}',
multitrackInputConfiguration = '{{ multitrackInputConfiguration }}',
containerFormat = '{{ containerFormat }}',
adConfigurationArn = '{{ adConfigurationArn }}'
WHERE
region = '{{ region }}' --required
AND arn = '{{ arn }}' --required
RETURNING
channel;

REPLACE examples

Inserts metadata into the active stream of the specified channel. At most 5 requests per second per channel are allowed, each with a maximum 1 KB payload. (If 5 TPS is not sufficient for your needs, we recommend batching your data into a single PutMetadata call.) At most 155 requests per second per account are allowed. Also see Embedding Metadata within a Video Stream in the Amazon IVS User Guide.

REPLACE aws.ivs.channels
SET
channelArn = '{{ channelArn }}',
metadata = '{{ metadata }}'
WHERE
region = '{{ region }}' --required
AND channelArn = '{{ channelArn }}' --required
AND metadata = '{{ metadata }}' --required;

DELETE examples

Deletes the specified channel and its associated stream keys. If you try to delete a live channel, you will get an error (409 ConflictException). To delete a channel that is live, call StopStream, wait for the Amazon EventBridge "Stream End" event (to verify that the stream's state is no longer Live), then call DeleteChannel. (See Using EventBridge with Amazon IVS.)

DELETE FROM aws.ivs.channels
WHERE region = '{{ region }}' --required
;

Lifecycle Methods

Inserts an ad marker in the playlist for the specified channel and duration using the ad configuration associated with the channel. Note: AWS Elemental MediaTailor (EMT), the service that handles ad requests, provides CloudWatch metrics to help you monitor the success or failure of each InsertAdBreak operation. See Monitoring AWS Elemental MediaTailor with Amazon CloudWatch metrics in the AWS Elemental MediaTailor User Guide for details on available metrics.

EXEC aws.ivs.channels.insert_ad_break
@region='{{ region }}' --required
@@json=
'{
"channelArn": "{{ channelArn }}",
"durationSeconds": {{ durationSeconds }}
}'
;