Skip to content

create_stream_key

create_stream_key(
    channel_arn: ChannelArn,
    *,
    config_overrides: Optional[ivsClientConfig] = None,
    tags: Optional[Tags] = None,
) -> CreateStreamKeyResponse

Creates a stream key, used to initiate a stream, for the specified channel ARN.

Note that CreateChannel creates a stream key. If you subsequently use CreateStreamKey on the same channel, it will fail because a stream key already exists and there is a limit of 1 stream key per channel. To reset the stream key on a channel, use DeleteStreamKey and then CreateStreamKey.

Parameters:

  • channel_arn (ChannelArn) –

    ARN of the channel for which to create the stream key.

  • tags (Optional[Tags], default: None ) –

    Array of 1-50 maps, each of the form string:string (key:value). See Best practices and strategies in Tagging Amazon Web Services Resources and Tag Editor for details, including restrictions that apply to tags and "Tag naming limits and requirements"; Amazon IVS has no service-specific constraints beyond what is documented there.

Raises:

Source code in docs_src/capo_ivs/_services/ivs.py
def create_stream_key(
    self,
    channel_arn: "capo_ivs.types.channel_arn.ChannelArn",
    *,
    config_overrides: Optional[ivsClientConfig] = None,
    tags: Optional["capo_ivs.types.tags.Tags"] = None,
) -> "capo_ivs.types.create_stream_key_response.CreateStreamKeyResponse":
    """<p>Creates a stream key, used to initiate a stream, for the specified channel ARN.</p> <p>Note that <a>CreateChannel</a> creates a stream key. If you subsequently use CreateStreamKey on the same channel, it will fail because a stream key already exists and there is a limit of 1 stream key per channel. To reset the stream key on a channel, use <a>DeleteStreamKey</a> and then CreateStreamKey.</p>

    Args:
        channel_arn: <p>ARN of the channel for which to create the stream key.</p>
        tags: <p>Array of 1-50 maps, each of the form <code>string:string (key:value)</code>. See <a href="https://docs.aws.amazon.com/tag-editor/latest/userguide/best-practices-and-strats.html">Best practices and strategies</a> in <i>Tagging Amazon Web Services Resources and Tag Editor</i> for details, including restrictions that apply to tags and "Tag naming limits and requirements"; Amazon IVS has no service-specific constraints beyond what is documented there.</p>

    Raises:
        capo_ivs.errors.access_denied_exception.AccessDeniedException: <p>User does not have sufficient access to perform this action.</p>
        capo_ivs.errors.pending_verification.PendingVerification: <p>Your account is pending verification.</p>
        capo_ivs.errors.resource_not_found_exception.ResourceNotFoundException: <p>Request references a resource which does not exist.</p>
        capo_ivs.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>Request would cause a service quota to be exceeded.</p>
        capo_ivs.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_ivs.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_ivs.types.create_stream_key_request.CreateStreamKeyRequest]",
    ) -> OperationResponse[
        "capo_ivs.types.create_stream_key_response.CreateStreamKeyResponse"
    ]:
        import capo_ivs._operations.amazon_interactive_video_service.create_stream_key

        output, http_response = (
            capo_ivs._operations.amazon_interactive_video_service.create_stream_key.create_stream_key(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_ivs.types.create_stream_key_response.CreateStreamKeyResponse",
    ) -> dict[str, Any]:
        import capo_ivs.types.create_stream_key_response

        return capo_ivs.types.create_stream_key_response.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateStreamKey", redact_output=_redact_output),
    )
    input_: capo_ivs.types.create_stream_key_request.CreateStreamKeyRequest = {
        "channel_arn": channel_arn
    }
    if tags is not None:
        input_["tags"] = tags

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