LambdaMicroVMs / Client / create_microvm_auth_token

create_microvm_auth_token

LambdaMicroVMs.Client.create_microvm_auth_token(**kwargs)

Creates an authentication token for accessing a running MicroVM. The token grants access to the specified ports on the MicroVM endpoint.

See also: AWS API Documentation

Request Syntax

response = client.create_microvm_auth_token(
    microvmIdentifier='string',
    expirationInMinutes=123,
    allowedPorts=[
        {
            'port': 123,
            'range': {
                'startPort': 123,
                'endPort': 123
            },
            'allPorts': {}

        },
    ]
)
Parameters:
  • microvmIdentifier (string) –

    [REQUIRED]

    The ID of the MicroVM to create an authentication token for.

  • expirationInMinutes (integer) –

    [REQUIRED]

    The duration in minutes before the authentication token expires. Maximum: 60 minutes.

  • allowedPorts (list) –

    [REQUIRED]

    The list of port specifications that the authentication token grants access to on the MicroVM.

    • (dict) –

      Specifies which ports are accessible on a MicroVM. Only one of the port specification options can be set.

      Note

      This is a Tagged Union structure. Only one of the following top level keys can be set: port, range, allPorts.

      • port (integer) –

        A single port number.

      • range (dict) –

        A range of ports.

        • startPort (integer) – [REQUIRED]

          The starting port number of the range.

        • endPort (integer) – [REQUIRED]

          The ending port number of the range.

      • allPorts (dict) –

        Indicates that all ports are accessible.

Return type:

dict

Returns:

Response Syntax

{
    'authToken': {
        'string': 'string'
    }
}

Response Structure

  • (dict) –

    • authToken (dict) –

      A map containing the authentication token. Use the value at key “X-aws-proxy-auth” as the header value when connecting to the MicroVM endpoint.

      • (string) –

        • (string) –

Exceptions

  • LambdaMicroVMs.Client.exceptions.InternalServerException

  • LambdaMicroVMs.Client.exceptions.AccessDeniedException

  • LambdaMicroVMs.Client.exceptions.ResourceNotFoundException

  • LambdaMicroVMs.Client.exceptions.ThrottlingException

  • LambdaMicroVMs.Client.exceptions.ValidationException