imagebuilder / Client / import_vm_image
import_vm_image¶
- imagebuilder.Client.import_vm_image(**kwargs)¶
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
PENDINGstate. 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 imageAVAILABLE. 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.
See also: AWS API Documentation
Request Syntax
response = client.import_vm_image( name='string', semanticVersion='string', description='string', platform='Windows'|'Linux'|'macOS', osVersion='string', vmImportTaskId='string', loggingConfiguration={ 'logGroupName': 'string' }, tags={ 'string': 'string' }, clientToken='string' )
- Parameters:
name (string) –
[REQUIRED]
The name of the base image that is created by the import process. Image Builder generates the image ARN from a normalized form of the name, so names that differ only in case, spaces, or underscores count as the same name. If an image with the same name and semantic version already exists in your account in the same Amazon Web Services Region, the import creates a new build version for it.
semanticVersion (string) –
[REQUIRED]
The semantic version to attach to the base image that was created during the import process. This version follows the semantic version syntax.
Note
The semantic version has four nodes: <major>.<minor>.<patch>/<build>. You can assign values for the first three, and can filter on all of them.
Assignment: For the first three nodes, you can assign any positive integer value, including zero. The upper limit is 2^30-1, or 1073741823, for each node. Image Builder automatically assigns the build number to the fourth node.
Patterns: You can use any numeric pattern that adheres to the assignment requirements for the nodes that you can assign. For example, you might choose a software version pattern, such as 1.0.0, or a date, such as 2021.01.01.
description (string) – The description for the base image that is created by the import process.
platform (string) –
[REQUIRED]
The operating system platform for the imported VM.
osVersion (string) – The operating system version for the imported VM.
vmImportTaskId (string) –
[REQUIRED]
The
importTaskId(API) orImportTaskId(CLI) from the Amazon EC2 VM import process. The import task doesn’t need to be complete when you call ImportVmImage - Image Builder monitors the task and finishes creating the image when the task completes.loggingConfiguration (dict) –
The CloudWatch Logs log group where Image Builder sends the import logs. For ImportVmImage, the log group name must be within the
/aws/imagebuilder/namespace.logGroupName (string) –
The log group name that Image Builder uses for image creation. If not specified, the log group name defaults to
/aws/imagebuilder/image-name.
tags (dict) –
Tags that are attached to the import resources.
(string) –
(string) –
clientToken (string) –
[REQUIRED]
A unique, case-sensitive identifier you provide to ensure that the operation runs no more than one time. If you retry a request with the same client token, Image Builder returns the original response without running the operation again. For more information, see Ensuring idempotency in the Amazon EC2 API Reference.
This field is autopopulated if not provided.
- Return type:
dict
- Returns:
Response Syntax
{ 'requestId': 'string', 'imageArn': 'string', 'clientToken': 'string' }
Response Structure
(dict) –
requestId (string) –
The request ID that uniquely identifies this request.
imageArn (string) –
The Amazon Resource Name (ARN) of the Image Builder image resource that this request created. Image Builder records the AMI from the VM import task in the image’s output resources after the task completes.
clientToken (string) –
The client token that uniquely identifies the request.
Exceptions