Skip to content

update_channel

update_channel(
    channel_arn: ChannelARN,
    *,
    config_overrides: Optional[KinesisClientConfig] = None,
    s3_destination_configuration: Optional[S3DestinationUpdateInput] = None,
    s3_tables_destination_configuration: Optional[
        S3TablesDestinationUpdateInput
    ] = None,
    logging_configuration: Optional[ChannelLoggingUpdateInput] = None,
) -> UpdateChannelOutput

Updates the data freshness interval or the Amazon CloudWatch Logs configuration of an existing channel. You cannot change the destination, source stream, record format, schema, encryption configuration, or service execution role of an existing channel. To change any other setting, delete the channel and create a new one.

Updating a channel is an asynchronous operation. Upon receiving the request, Amazon Kinesis Data Streams sets the channel to the UPDATING state and returns immediately. After the change is applied, Amazon Kinesis Data Streams sets the channel back to the ACTIVE state.

This operation has a call limit of 5 transactions per second (TPS) for each Amazon Web Services account. Exceeding 5 TPS results in a LimitExceededException.

Parameters:

  • channel_arn (ChannelARN) –

    The Amazon Resource Name (ARN) of the channel to update.

  • s3_destination_configuration (Optional[S3DestinationUpdateInput], default: None ) –

    The updated configuration for a general purpose Amazon S3 destination. Specify this parameter when the channel delivers to a general purpose Amazon S3 bucket. Only DataFreshnessInSeconds can be updated.

  • s3_tables_destination_configuration (Optional[S3TablesDestinationUpdateInput], default: None ) –

    The updated configuration for a streaming table destination. Specify this parameter when the channel delivers to streaming tables on Apache Iceberg in Amazon S3 Tables. Only DataFreshnessInSeconds can be updated.

  • logging_configuration (Optional[ChannelLoggingUpdateInput], default: None ) –

    The updated Amazon CloudWatch Logs configuration for the channel.

Raises:

  • AccessDeniedException –

    Specifies that you do not have the permissions required to perform this operation.

  • InvalidArgumentException –

    A specified parameter exceeds its restrictions, is not supported, or can't be used. For more information, see the returned message.

  • LimitExceededException –

    The requested resource exceeds the maximum number allowed, or the number of concurrent stream requests exceeds the maximum number allowed.

  • ResourceInUseException –

    The resource is not available for this operation. For successful operation, the resource must be in the ACTIVE state.

  • ResourceNotFoundException –

    The requested resource could not be found. The stream might not be specified correctly.

  • ValidationException –

    Specifies that you tried to invoke this API for a data stream with the on-demand capacity mode. This API is only supported for data streams with the provisioned capacity mode.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

To update a channel

>>> client.update_channel(channel_arn='arn:aws:kinesis:us-east-1:123456789012:channel/my-channel-id', s3_destination_configuration={'DataFreshnessInSeconds': 600}, logging_configuration={'CloudWatchLogs': {'Enabled': True, 'LogGroupName': '/aws/kinesis/my-channel', 'LogStreamName': 'my-channel-log-stream'}})
Source code in docs_src/capo_kinesis/_services/kinesis.py
def update_channel(
    self,
    channel_arn: "capo_kinesis.types.channel_arn.ChannelARN",
    *,
    config_overrides: Optional[KinesisClientConfig] = None,
    s3_destination_configuration: Optional[
        "capo_kinesis.types.s3_destination_update_input.S3DestinationUpdateInput"
    ] = None,
    s3_tables_destination_configuration: Optional[
        "capo_kinesis.types.s3_tables_destination_update_input.S3TablesDestinationUpdateInput"
    ] = None,
    logging_configuration: Optional[
        "capo_kinesis.types.channel_logging_update_input.ChannelLoggingUpdateInput"
    ] = None,
) -> "capo_kinesis.types.update_channel_output.UpdateChannelOutput":
    """<p>Updates the data freshness interval or the Amazon CloudWatch Logs configuration of an existing channel. You cannot change the destination, source stream, record format, schema, encryption configuration, or service execution role of an existing channel. To change any other setting, delete the channel and create a new one.</p> <p>Updating a channel is an asynchronous operation. Upon receiving the request, Amazon Kinesis Data Streams sets the channel to the <code>UPDATING</code> state and returns immediately. After the change is applied, Amazon Kinesis Data Streams sets the channel back to the <code>ACTIVE</code> state.</p> <p>This operation has a call limit of 5 transactions per second (TPS) for each Amazon Web Services account. Exceeding 5 TPS results in a <code>LimitExceededException</code>.</p>

    Args:
        channel_arn: <p>The Amazon Resource Name (ARN) of the channel to update.</p>
        s3_destination_configuration: <p>The updated configuration for a general purpose Amazon S3 destination. Specify this parameter when the channel delivers to a general purpose Amazon S3 bucket. Only <code>DataFreshnessInSeconds</code> can be updated.</p>
        s3_tables_destination_configuration: <p>The updated configuration for a streaming table destination. Specify this parameter when the channel delivers to streaming tables on Apache Iceberg in Amazon S3 Tables. Only <code>DataFreshnessInSeconds</code> can be updated.</p>
        logging_configuration: <p>The updated Amazon CloudWatch Logs configuration for the channel.</p>

    Raises:
        capo_kinesis.errors.access_denied_exception.AccessDeniedException: <p>Specifies that you do not have the permissions required to perform this operation.</p>
        capo_kinesis.errors.invalid_argument_exception.InvalidArgumentException: <p>A specified parameter exceeds its restrictions, is not supported, or can't be used. For more information, see the returned message.</p>
        capo_kinesis.errors.limit_exceeded_exception.LimitExceededException: <p>The requested resource exceeds the maximum number allowed, or the number of concurrent stream requests exceeds the maximum number allowed. </p>
        capo_kinesis.errors.resource_in_use_exception.ResourceInUseException: <p>The resource is not available for this operation. For successful operation, the resource must be in the <code>ACTIVE</code> state.</p>
        capo_kinesis.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource could not be found. The stream might not be specified correctly.</p>
        capo_kinesis.errors.validation_exception.ValidationException: <p>Specifies that you tried to invoke this API for a data stream with the on-demand capacity mode. This API is only supported for data streams with the provisioned capacity mode. </p>
        capo_kinesis.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To update a channel

        >>> client.update_channel(channel_arn='arn:aws:kinesis:us-east-1:123456789012:channel/my-channel-id', s3_destination_configuration={'DataFreshnessInSeconds': 600}, logging_configuration={'CloudWatchLogs': {'Enabled': True, 'LogGroupName': '/aws/kinesis/my-channel', 'LogStreamName': 'my-channel-log-stream'}})
    """

    def _handler(
        req: "OperationRequest[capo_kinesis.types.update_channel_input.UpdateChannelInput]",
    ) -> OperationResponse[
        "capo_kinesis.types.update_channel_output.UpdateChannelOutput"
    ]:
        import capo_kinesis._operations.kinesis_20131202.update_channel

        output, http_response = (
            capo_kinesis._operations.kinesis_20131202.update_channel.update_channel(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateChannel")
    )
    input_: capo_kinesis.types.update_channel_input.UpdateChannelInput = {
        "channel_arn": channel_arn
    }
    if s3_destination_configuration is not None:
        input_["s3_destination_configuration"] = s3_destination_configuration
    if s3_tables_destination_configuration is not None:
        input_["s3_tables_destination_configuration"] = (
            s3_tables_destination_configuration
        )
    if logging_configuration is not None:
        input_["logging_configuration"] = logging_configuration

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output