Skip to content

create_stream_session_admin_shell

create_stream_session_admin_shell(
    identifier: Identifier,
    stream_session_identifier: Identifier,
    *,
    config_overrides: Optional[GameLiftStreamsClientConfig] = None,
) -> CreateStreamSessionAdminShellOutput

Creates an administrative terminal session with full access to the live runtime environment of the Amazon GameLift Streams stream session. Use the returned credentials (SessionId, StreamUrl and TokenValue) with the Amazon Web Services Systems Manager Session Manager plugin for the CLI to access the terminal session.

The stream session must be in one of the following statuses: ACTIVE, CONNECTED, PENDING_CLIENT_RECONNECTION, or RECONNECTING.

The StreamUrl is valid for 60 seconds. After it expires, call this operation again to get a new URL.

The returned credentials grant full access to the live runtime environment of the Amazon GameLift Streams stream session. The operator who connects to the terminal session has the same level of access that your Amazon GameLift Streams applications have, including potentially user input, screen images, and application data files. Grant permissions to call this operation only to trusted IAM identities that require live runtime environment access.

Parameters:

  • identifier (Identifier) –

    The stream group that runs this stream session.

    This value is an Amazon Resource Name (ARN) or ID that uniquely identifies the stream group resource. Example ARN: arn:aws:gameliftstreams:us-west-2:111122223333:streamgroup/sg-1AB2C3De4. Example ID: sg-1AB2C3De4.

  • stream_session_identifier (Identifier) –

    An Amazon Resource Name (ARN) or ID that uniquely identifies the stream session resource. Example ARN: arn:aws:gameliftstreams:us-west-2:111122223333:streamsession/sg-1AB2C3De4/ABC123def4567. Example ID: ABC123def4567.

Raises:

  • AccessDeniedException –

    You don't have the required permissions to access this Amazon GameLift Streams resource. Correct the permissions before you try again.

  • InternalServerException –

    The service encountered an internal error and is unable to complete the request.

  • ResourceNotFoundException –

    The resource specified in the request was not found. Correct the request before you try again.

  • StreamSessionAccessNotReadyException –

    The terminal connection to the stream session is not yet available. Wait before retrying the request.

  • ThrottlingException –

    The request was denied due to request throttling. Retry the request after the suggested wait time.

  • ValidationException –

    One or more parameter values in the request fail to satisfy the specified constraints. Correct the invalid parameter values before retrying the request.

  • UnknownServiceError –

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

Source code in docs_src/capo_gameliftstreams/_services/game_lift_streams.py
def create_stream_session_admin_shell(
    self,
    identifier: "capo_gameliftstreams.types.identifier.Identifier",
    stream_session_identifier: "capo_gameliftstreams.types.identifier.Identifier",
    *,
    config_overrides: Optional[GameLiftStreamsClientConfig] = None,
) -> "capo_gameliftstreams.types.create_stream_session_admin_shell_output.CreateStreamSessionAdminShellOutput":
    """<p>Creates an administrative terminal session with full access to the live runtime environment of the Amazon GameLift Streams stream session. Use the returned credentials (<code>SessionId</code>, <code>StreamUrl</code> and <code>TokenValue</code>) with the Amazon Web Services Systems Manager <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html">Session Manager plugin</a> for the CLI to access the terminal session.</p> <p>The stream session must be in one of the following statuses: <code>ACTIVE</code>, <code>CONNECTED</code>, <code>PENDING_CLIENT_RECONNECTION</code>, or <code>RECONNECTING</code>.</p> <p>The <code>StreamUrl</code> is valid for 60 seconds. After it expires, call this operation again to get a new URL.</p> <important> <p>The returned credentials grant full access to the live runtime environment of the Amazon GameLift Streams stream session. The operator who connects to the terminal session has the same level of access that your Amazon GameLift Streams applications have, including potentially user input, screen images, and application data files. Grant permissions to call this operation only to trusted IAM identities that require live runtime environment access.</p> </important>

    Args:
        identifier: <p>The stream group that runs this stream session.</p> <p>This value is an <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html">Amazon Resource Name (ARN)</a> or ID that uniquely identifies the stream group resource. Example ARN: <code>arn:aws:gameliftstreams:us-west-2:111122223333:streamgroup/sg-1AB2C3De4</code>. Example ID: <code>sg-1AB2C3De4</code>. </p>
        stream_session_identifier: <p>An <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html">Amazon Resource Name (ARN)</a> or ID that uniquely identifies the stream session resource. Example ARN: <code>arn:aws:gameliftstreams:us-west-2:111122223333:streamsession/sg-1AB2C3De4/ABC123def4567</code>. Example ID: <code>ABC123def4567</code>. </p>

    Raises:
        capo_gameliftstreams.errors.access_denied_exception.AccessDeniedException: <p>You don't have the required permissions to access this Amazon GameLift Streams resource. Correct the permissions before you try again.</p>
        capo_gameliftstreams.errors.internal_server_exception.InternalServerException: <p>The service encountered an internal error and is unable to complete the request.</p>
        capo_gameliftstreams.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request was not found. Correct the request before you try again.</p>
        capo_gameliftstreams.errors.stream_session_access_not_ready_exception.StreamSessionAccessNotReadyException: <p>The terminal connection to the stream session is not yet available. Wait before retrying the request.</p>
        capo_gameliftstreams.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Retry the request after the suggested wait time.</p>
        capo_gameliftstreams.errors.validation_exception.ValidationException: <p>One or more parameter values in the request fail to satisfy the specified constraints. Correct the invalid parameter values before retrying the request.</p>
        capo_gameliftstreams.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_gameliftstreams.types.create_stream_session_admin_shell_input.CreateStreamSessionAdminShellInput]",
    ) -> OperationResponse[
        "capo_gameliftstreams.types.create_stream_session_admin_shell_output.CreateStreamSessionAdminShellOutput"
    ]:
        import capo_gameliftstreams._operations.game_lift_streams.create_stream_session_admin_shell

        output, http_response = (
            capo_gameliftstreams._operations.game_lift_streams.create_stream_session_admin_shell.create_stream_session_admin_shell(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_gameliftstreams.types.create_stream_session_admin_shell_output.CreateStreamSessionAdminShellOutput",
    ) -> dict[str, Any]:
        import capo_gameliftstreams.types.create_stream_session_admin_shell_output

        return capo_gameliftstreams.types.create_stream_session_admin_shell_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateStreamSessionAdminShell", redact_output=_redact_output
        ),
    )
    input_: capo_gameliftstreams.types.create_stream_session_admin_shell_input.CreateStreamSessionAdminShellInput = {
        "identifier": identifier,
        "stream_session_identifier": stream_session_identifier,
    }

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