---
description: |
  The Packer Alicloud Import post-processor takes a RAW or VHD artifact from
  various builders and imports it to an Alicloud customized image list.
layout: docs
page_title: Alicloud Import Post-Processor
sidebar_title: Alicloud Import
---

# Alicloud Import Post-Processor

Type: `alicloud-import`

The Packer Alicloud Import post-processor takes a RAW or VHD artifact from
various builders and imports it to an Alicloud ECS Image.

## How Does it Work?

The import process operates by making a temporary copy of the RAW or VHD to an
OSS bucket, and calling an import task in ECS on the RAW or VHD file. Once
completed, an Alicloud ECS Image is returned. The temporary RAW or VHD copy in
OSS can be discarded after the import is complete.

## Configuration

There are some configuration options available for the post-processor. There
are two categories: required and optional parameters.

### Required:

@include 'builder/alicloud/ecs/AlicloudAccessConfig-required.mdx'

@include 'builder/alicloud/ecs/AlicloudImageConfig-required.mdx'

@include 'post-processor/alicloud-import/Config-required.mdx'

### Optional:

- `keep_input_artifact` (boolean) - if true, do not delete the RAW or VHD
  disk image after importing it to the cloud. Defaults to false.

@include 'post-processor/alicloud-import/Config-not-required.mdx'

## Basic Example

Here is a basic example. This assumes that the builder has produced a RAW
artifact. The user must have the role `AliyunECSImageImportDefaultRole` with
`AliyunECSImageImportRolePolicy`, post-process will automatically configure the
role and policy for you if you have the privilege, otherwise, you have to ask
the administrator configure for you in advance.

```json
"post-processors":[
    {
      "access_key":"{{user `access_key`}}",
      "secret_key":"{{user `secret_key`}}",
      "type":"alicloud-import",
      "oss_bucket_name": "packer",
      "image_name": "packer_import",
      "image_os_type": "linux",
      "image_platform": "CentOS",
      "image_architecture": "x86_64",
      "image_system_size": "40",
      "region":"cn-beijing"
    }
  ]
```

This will take the RAW generated by a builder and upload it to OSS. In this
case, an existing bucket called `packer` in the `cn-beijing` region will be
where the copy is placed.

Once uploaded, the import process will start, creating an Alicloud ECS image in
the `cn-beijing` region with the name you specified in template file.
