Skip to content

Creates an Image Builder image resource from an Amazon EC2 VM import task

Description

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.

Usage

imagebuilder_import_vm_image(name, semanticVersion, description,
  platform, osVersion, vmImportTaskId, loggingConfiguration, tags,
  clientToken)

Arguments

  • name

    [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

    [required] The semantic version to attach to the base image that was created during the import process. This version follows the semantic version syntax.

    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

    The description for the base image that is created by the import process.

  • platform

    [required] The operating system platform for the imported VM.

  • osVersion

    The operating system version for the imported VM.

  • vmImportTaskId

    [required] The importTaskId (API) or ImportTaskId (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

    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.

  • tags

    Tags that are attached to the import resources.

  • clientToken

    [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.

Value

A list with the following syntax:

list(
  requestId = "string",
  imageArn = "string",
  clientToken = "string"
)

Request syntax

svc$import_vm_image(
  name = "string",
  semanticVersion = "string",
  description = "string",
  platform = "Windows"|"Linux"|"macOS",
  osVersion = "string",
  vmImportTaskId = "string",
  loggingConfiguration = list(
    logGroupName = "string"
  ),
  tags = list(
    "string"
  ),
  clientToken = "string"
)