importVmImage

Creates an Image Builder image resource from an Amazon EC2 VM import task. The response returns as soon as Image Builder creates the image resource in the PENDING state. Image Builder then monitors the import task asynchronously. When the task completes, Image Builder records the AMI that it produced as the new image's output resource and marks the image AVAILABLE. You can then use the imported image as the base image for your recipes.

To create the VM import task, use the Amazon EC2 API ImportImage operation, or the import-image CLI command.

Samples

// The following example registers the output of an EC2 VM Import Export task (import-ami) as a new
// Image Builder image, so you can use the imported virtual machine as a base image.
val resp = imagebuilderClient.importVmImage {
    name = "my-example-imported-image"
    semanticVersion = "1.0.0"
    platform = Platform.fromValue("Linux")
    osVersion = "Amazon Linux 2"
    vmImportTaskId = "import-ami-1234567890abcdef0"
    clientToken = "a1b2c3d4-5678-90ab-cdef-EXAMPLE00000"
}