LambdaMicroVMs / Client / run_microvm

run_microvm

LambdaMicroVMs.Client.run_microvm(**kwargs)

Runs a new MicroVM from the specified image. The MicroVM starts in PENDING state and transitions to RUNNING once provisioning completes. To connect, generate an authentication token using CreateMicrovmAuthToken.

See also: AWS API Documentation

Request Syntax

response = client.run_microvm(
    ingressNetworkConnectors=[
        'string',
    ],
    egressNetworkConnectors=[
        'string',
    ],
    imageIdentifier='string',
    imageVersion='string',
    executionRoleArn='string',
    idlePolicy={
        'maxIdleDurationSeconds': 123,
        'suspendedDurationSeconds': 123,
        'autoResumeEnabled': True|False
    },
    logging={
        'disabled': {}
        ,
        'cloudWatch': {
            'logGroup': 'string',
            'logStream': 'string'
        }
    },
    runHookPayload='string',
    maximumDurationInSeconds=123,
    clientToken='string'
)
Parameters:
  • ingressNetworkConnectors (list) –

    The list of ingress network connectors to configure for the MicroVM.

    • (string) –

  • egressNetworkConnectors (list) –

    The list of egress network connectors to configure for the MicroVM.

    • (string) –

  • imageIdentifier (string) –

    [REQUIRED]

    The identifier (ARN or ID) of the MicroVM image to run.

  • imageVersion (string) – The version of the MicroVM image to run.

  • executionRoleArn (string) – The ARN of the IAM role to be assumed by the MicroVM during execution.

  • idlePolicy (dict) –

    Configuration to control auto-suspend and auto-resume behavior.

    • maxIdleDurationSeconds (integer) – [REQUIRED]

      The maximum time in seconds that a MicroVM can remain idle before it is automatically suspended.

    • suspendedDurationSeconds (integer) – [REQUIRED]

      The maximum time in seconds that a MicroVM can remain suspended before it is automatically terminated.

    • autoResumeEnabled (boolean) – [REQUIRED]

      Indicates whether the MicroVM automatically resumes when it receives a request while suspended.

  • logging (dict) –

    The logging configuration for this MicroVM instance. Specify {“cloudWatch”: {“logGroup”: “…”}} to stream application logs to a custom CloudWatch log group, or {“disabled”: {}} to turn off logging.

    Note

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

    • disabled (dict) –

      Specifies that logging is disabled.

    • cloudWatch (dict) –

      Configuration for sending logs to Amazon CloudWatch Logs.

      • logGroup (string) –

        The name of the CloudWatch Logs log group to send logs to.

      • logStream (string) –

        The name of the CloudWatch Logs log stream within the log group.

  • runHookPayload (string) – Per-MicroVM initialization data delivered as the request body of the /run lifecycle hook. Use to pass tenant-specific configuration such as session IDs or secret references. Maximum: 16,384 bytes.

  • maximumDurationInSeconds (integer) – The maximum duration in seconds that the MicroVM can exist before being terminated by the platform. Valid range: 1–28,800 (8 hours).

  • clientToken (string) –

    A unique, case-sensitive identifier you provide to ensure the idempotency of the request.

    This field is autopopulated if not provided.

Return type:

dict

Returns:

Response Syntax

{
    'microvmId': 'string',
    'state': 'PENDING'|'RUNNING'|'SUSPENDING'|'SUSPENDED'|'TERMINATING'|'TERMINATED',
    'endpoint': 'string',
    'imageArn': 'string',
    'imageVersion': 'string',
    'executionRoleArn': 'string',
    'idlePolicy': {
        'maxIdleDurationSeconds': 123,
        'suspendedDurationSeconds': 123,
        'autoResumeEnabled': True|False
    },
    'maximumDurationInSeconds': 123,
    'startedAt': datetime(2015, 1, 1),
    'terminatedAt': datetime(2015, 1, 1),
    'stateReason': 'string',
    'ingressNetworkConnectors': [
        'string',
    ],
    'egressNetworkConnectors': [
        'string',
    ]
}

Response Structure

  • (dict) –

    • microvmId (string) –

      The unique identifier of the MicroVM.

    • state (string) –

      The current lifecycle state of the MicroVM.

    • endpoint (string) –

      The HTTPS endpoint URL for communicating with the MicroVM. Include a valid authentication token in the X-aws-proxy-auth header when sending requests.

    • imageArn (string) –

      The ARN of the MicroVM image used to run this MicroVM.

    • imageVersion (string) –

      The version of the MicroVM image used to run this MicroVM.

    • executionRoleArn (string) –

      The ARN of the IAM execution role assumed by the MicroVM.

    • idlePolicy (dict) –

      The idle policy configuration of the MicroVM.

      • maxIdleDurationSeconds (integer) –

        The maximum time in seconds that a MicroVM can remain idle before it is automatically suspended.

      • suspendedDurationSeconds (integer) –

        The maximum time in seconds that a MicroVM can remain suspended before it is automatically terminated.

      • autoResumeEnabled (boolean) –

        Indicates whether the MicroVM automatically resumes when it receives a request while suspended.

    • maximumDurationInSeconds (integer) –

      The maximum duration in seconds that the MicroVM can exist.

    • startedAt (datetime) –

      The timestamp when the MicroVM first started.

    • terminatedAt (datetime) –

      The timestamp when the MicroVM terminated.

    • stateReason (string) –

      The reason for why the MicroVM is in the current state.

    • ingressNetworkConnectors (list) –

      The list of ingress network connectors configured for the MicroVM.

      • (string) –

    • egressNetworkConnectors (list) –

      The list of egress network connectors configured for the MicroVM.

      • (string) –

Exceptions

  • LambdaMicroVMs.Client.exceptions.InternalServerException

  • LambdaMicroVMs.Client.exceptions.AccessDeniedException

  • LambdaMicroVMs.Client.exceptions.ResourceNotFoundException

  • LambdaMicroVMs.Client.exceptions.ThrottlingException

  • LambdaMicroVMs.Client.exceptions.ConflictException

  • LambdaMicroVMs.Client.exceptions.ValidationException

  • LambdaMicroVMs.Client.exceptions.ServiceQuotaExceededException