Skip to content

get_compute_access async

get_compute_access(
    *,
    config_overrides: Optional[AsyncGameLiftClientConfig] = None,
    fleet_id: Optional[FleetIdOrArn] = None,
    compute_name: Optional[ComputeNameOrArn] = None,
) -> GetComputeAccessOutput

This API works with the following fleet types: EC2, Container

Requests authorization to remotely connect to a hosting resource in a Amazon GameLift Servers managed fleet. This operation is not used with Amazon GameLift Servers Anywhere fleets.

Request options

Provide the fleet ID and compute name. The compute name varies depending on the type of fleet.

  • For a compute in a managed EC2 fleet, provide an instance ID. Each instance in the fleet is a compute.

  • For a compute in a managed container fleet, provide a compute name. In a container fleet, each game server container group on a fleet instance is assigned a compute name.

Results

If successful, this operation returns a set of temporary Amazon Web Services credentials, including a two-part access key and a session token.

  • With a managed EC2 fleet (where compute type is EC2), use these credentials with Amazon EC2 Systems Manager (SSM) to start a session with the compute. For more details, see Starting a session (CLI) in the Amazon EC2 Systems Manager User Guide.

Parameters:

  • fleet_id (Optional[FleetIdOrArn], default: None ) –

    A unique identifier for the fleet that holds the compute resource that you want to connect to. You can use either the fleet ID or ARN value.

  • compute_name (Optional[ComputeNameOrArn], default: None ) –

    A unique identifier for the compute resource that you want to connect to. For an EC2 fleet, use an instance ID. For a managed container fleet, use a compute name. You can retrieve a fleet's compute names by calling ListCompute.

Raises:

  • InternalServiceException –

    The service encountered an unrecoverable internal failure while processing the request. Clients can retry such requests immediately or after a waiting period.

  • InvalidRequestException –

    One or more parameter values in the request are invalid. Correct the invalid parameter values before retrying.

  • NotFoundException –

    The requested resource was not found. The resource was either not created yet or deleted.

  • UnauthorizedException –

    The client failed authentication. Clients should not retry such requests.

  • UnsupportedRegionException –

    The requested operation is not supported in the Region specified.

  • UnknownServiceError –

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

Source code in docs_src/capo_gamelift/_services/async_game_lift.py
async def get_compute_access(
    self,
    *,
    config_overrides: Optional[AsyncGameLiftClientConfig] = None,
    fleet_id: Optional["capo_gamelift.types.fleet_id_or_arn.FleetIdOrArn"] = None,
    compute_name: Optional[
        "capo_gamelift.types.compute_name_or_arn.ComputeNameOrArn"
    ] = None,
) -> "capo_gamelift.types.get_compute_access_output.GetComputeAccessOutput":
    """<p> <b>This API works with the following fleet types:</b> EC2, Container</p> <p>Requests authorization to remotely connect to a hosting resource in a Amazon GameLift Servers managed fleet. This operation is not used with Amazon GameLift Servers Anywhere fleets.</p> <p> <b>Request options</b> </p> <p>Provide the fleet ID and compute name. The compute name varies depending on the type of fleet.</p> <ul> <li> <p>For a compute in a managed EC2 fleet, provide an instance ID. Each instance in the fleet is a compute.</p> </li> <li> <p>For a compute in a managed container fleet, provide a compute name. In a container fleet, each game server container group on a fleet instance is assigned a compute name. </p> </li> </ul> <p> <b>Results</b> </p> <p>If successful, this operation returns a set of temporary Amazon Web Services credentials, including a two-part access key and a session token.</p> <ul> <li> <p>With a managed EC2 fleet (where compute type is <code>EC2</code>), use these credentials with Amazon EC2 Systems Manager (SSM) to start a session with the compute. For more details, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-sessions-start.html#sessions-start-cli"> Starting a session (CLI)</a> in the <i>Amazon EC2 Systems Manager User Guide</i>.</p> </li> </ul>

    Args:
        fleet_id: <p>A unique identifier for the fleet that holds the compute resource that you want to connect to. You can use either the fleet ID or ARN value.</p>
        compute_name: <p>A unique identifier for the compute resource that you want to connect to. For an EC2 fleet, use an instance ID. For a managed container fleet, use a compute name. You can retrieve a fleet's compute names by calling <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_ListCompute.html">ListCompute</a>.</p>

    Raises:
        capo_gamelift.errors.internal_service_exception.InternalServiceException: <p>The service encountered an unrecoverable internal failure while processing the request. Clients can retry such requests immediately or after a waiting period.</p>
        capo_gamelift.errors.invalid_request_exception.InvalidRequestException: <p>One or more parameter values in the request are invalid. Correct the invalid parameter values before retrying.</p>
        capo_gamelift.errors.not_found_exception.NotFoundException: <p>The requested resource was not found. The resource was either not created yet or deleted.</p>
        capo_gamelift.errors.unauthorized_exception.UnauthorizedException: <p>The client failed authentication. Clients should not retry such requests.</p>
        capo_gamelift.errors.unsupported_region_exception.UnsupportedRegionException: <p>The requested operation is not supported in the Region specified.</p>
        capo_gamelift.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_gamelift.types.get_compute_access_input.GetComputeAccessInput]",
    ) -> AsyncOperationResponse[
        "capo_gamelift.types.get_compute_access_output.GetComputeAccessOutput"
    ]:
        import capo_gamelift._operations.game_lift.get_compute_access

        (
            output,
            http_response,
        ) = await capo_gamelift._operations.game_lift.get_compute_access.async_get_compute_access(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_gamelift.types.get_compute_access_output.GetComputeAccessOutput",
    ) -> dict[str, Any]:
        import capo_gamelift.types.get_compute_access_output

        return capo_gamelift.types.get_compute_access_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("GetComputeAccess", redact_output=_redact_output),
    )
    input_: capo_gamelift.types.get_compute_access_input.GetComputeAccessInput = {}
    if fleet_id is not None:
        input_["fleet_id"] = fleet_id
    if compute_name is not None:
        input_["compute_name"] = compute_name

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output