run_microvm
async
¶
run_microvm(
image_identifier: MicrovmImageIdentifier,
*,
config_overrides: Optional[AsyncLambdaMicrovmsClientConfig] = None,
ingress_network_connectors: Optional[NetworkConnectorList] = None,
egress_network_connectors: Optional[NetworkConnectorList] = None,
image_version: Optional[Version] = None,
execution_role_arn: Optional[RoleArn] = None,
idle_policy: Optional[IdlePolicy] = None,
logging: Optional[Logging] = None,
run_hook_payload: Optional[RunHookPayload] = None,
maximum_duration_in_seconds: Optional[int] = None,
client_token: Optional[str] = None,
) -> RunMicrovmResponse
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.
Parameters:
-
ingress_network_connectors(Optional[NetworkConnectorList], default:None) –The list of ingress network connectors to configure for the MicroVM.
-
egress_network_connectors(Optional[NetworkConnectorList], default:None) –The list of egress network connectors to configure for the MicroVM.
-
image_identifier(MicrovmImageIdentifier) –The identifier (ARN or ID) of the MicroVM image to run.
-
image_version(Optional[Version], default:None) –The version of the MicroVM image to run.
-
execution_role_arn(Optional[RoleArn], default:None) –The ARN of the IAM role to be assumed by the MicroVM during execution.
-
idle_policy(Optional[IdlePolicy], default:None) –Configuration to control auto-suspend and auto-resume behavior.
-
logging(Optional[Logging], default:None) –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.
-
run_hook_payload(Optional[RunHookPayload], default:None) –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.
-
maximum_duration_in_seconds(Optional[int], default:None) –The maximum duration in seconds that the MicroVM can exist before being terminated by the platform. Valid range: 1–28,800 (8 hours).
-
client_token(Optional[str], default:None) –A unique, case-sensitive identifier you provide to ensure the idempotency of the request.
Raises:
-
AccessDeniedException–You do not have sufficient access to perform this action.
-
InternalServerException–An internal server error occurred. Retry the request later.
-
ThrottlingException–The request was denied due to request throttling. Retry the request later.
-
ValidationException–The input does not satisfy the constraints specified by the service.
-
ConflictException–The request could not be completed due to a conflict with the current state of the resource.
-
InsufficientCapacityException–There is insufficient capacity to fulfill the request. Retry the request later.
-
ResourceNotFoundException–The specified resource does not exist.
-
ServiceQuotaExceededException–You have exceeded a service quota for Lambda MicroVMs.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_lambda_microvms/_services/async_lambda_microvms.py
608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 | |