Skip to main content

microvms

Creates, updates, deletes, gets or lists a microvms resource.

Overview

Namemicrovms
TypeResource
Idaws.lambda_microvms.microvms

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
egress_network_connectorsarrayThe list of egress network connectors configured for the MicroVM.
endpointstringThe HTTPS endpoint URL for communicating with the MicroVM. Include a valid authentication token in the X-aws-proxy-auth header when sending requests.
execution_role_arnstringThe ARN of an IAM role that the service assumes to perform actions on behalf of the caller. (pattern: <code>arn:aws[a-z-]*:iam::[0-9]{12}:role/?[a-zA-Z_0-9+=,.@-_/]+</code>)
idle_policyobjectThe idle policy configuration of the MicroVM, controlling auto-suspend and auto-resume behavior.
image_arnstringThe ARN of the MicroVM image used to run this MicroVM.
image_versionstringThe version of the MicroVM image used to run this MicroVM. (pattern: <code>[^\s]+</code>)
ingress_network_connectorsarrayThe list of ingress network connectors configured for the MicroVM.
maximum_duration_in_secondsintegerThe maximum duration in seconds that the MicroVM can exist before being terminated by the platform.
microvm_idstringThe ARN or ID of the MicroVm
started_atstring (date-time)The timestamp when the MicroVM first started.
statestringThe current lifecycle state of the MicroVM. (PENDING, RUNNING, SUSPENDING, SUSPENDED, TERMINATING, TERMINATED)
state_reasonstringA string which is not empty or blank (only whitespace). (pattern: <code>[^\s]+</code>)
terminated_atstring (date-time)The timestamp when the MicroVM terminated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_microvmselectmicrovm_identifier, regionRetrieves the details of a specific MicroVM, including its state, endpoint, image information, and configuration. The state field is eventually consistent — determine readiness by connecting to the endpoint.
list_microvmsselectregionmaxResults, nextToken, imageIdentifier, imageVersionLists MicroVMs in the account with optional filtering by image and version. We recommend using pagination to ensure that the operation returns quickly and successfully.
create_microvm_auth_tokeninsertmicrovm_identifier, region, expirationInMinutes, allowedPortsCreates an authentication token for accessing a running MicroVM. The token grants access to the specified ports on the MicroVM endpoint.
create_microvm_shell_auth_tokeninsertmicrovm_identifier, region, expirationInMinutesCreates a shell authentication token for interactive shell access to a running MicroVM. The MicroVM must have been run with the SHELL_INGRESS network connector attached.
terminate_microvmdeletemicrovm_identifier, regionTerminates a MicroVM. This operation is idempotent; terminating a MicroVM that has already been terminated succeeds without error.
suspend_microvmexecmicrovm_identifier, regionSuspends a running MicroVM, preserving its full memory and disk state. The MicroVM transitions through SUSPENDING to SUSPENDED. To restore, call ResumeMicrovm or send traffic to the endpoint if autoResumeEnabled is true.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
microvm_identifierstringThe ID of the MicroVM to suspend.
regionstringAWS region (default: us-east-1)
imageIdentifierstringOptional filter to list only MicroVMs running the specified image.
imageVersionstringOptional filter to list only MicroVMs running the specified image version.
maxResultsintegerThe maximum number of results to return in a single call.
nextTokenstringThe pagination token from a previous call. Use this token to retrieve the next page of results.

SELECT examples

Retrieves the details of a specific MicroVM, including its state, endpoint, image information, and configuration. The state field is eventually consistent — determine readiness by connecting to the endpoint.

SELECT
egress_network_connectors,
endpoint,
execution_role_arn,
idle_policy,
image_arn,
image_version,
ingress_network_connectors,
maximum_duration_in_seconds,
microvm_id,
started_at,
state,
state_reason,
terminated_at
FROM aws.lambda_microvms.microvms
WHERE microvm_identifier = '{{ microvm_identifier }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

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

INSERT INTO aws.lambda_microvms.microvms (
expirationInMinutes,
allowedPorts,
microvm_identifier,
region
)
SELECT
{{ expirationInMinutes }} /* required */,
'{{ allowedPorts }}' /* required */,
'{{ microvm_identifier }}',
'{{ region }}'
RETURNING
auth_token
;

DELETE examples

Terminates a MicroVM. This operation is idempotent; terminating a MicroVM that has already been terminated succeeds without error.

DELETE FROM aws.lambda_microvms.microvms
WHERE microvm_identifier = '{{ microvm_identifier }}' --required
AND region = '{{ region }}' --required
;

Lifecycle Methods

Suspends a running MicroVM, preserving its full memory and disk state. The MicroVM transitions through SUSPENDING to SUSPENDED. To restore, call ResumeMicrovm or send traffic to the endpoint if autoResumeEnabled is true.

EXEC aws.lambda_microvms.microvms.suspend_microvm
@microvm_identifier='{{ microvm_identifier }}' --required,
@region='{{ region }}' --required
;