»Yandex.Cloud Compute Image Import Post-Processor

Type: yandex-import

The Yandex.Cloud Compute Image Import post-processor create new Compute Image from a qcow2 file. As Compute service support image creation from Storage service object just before request to create its upload file into Storage service.

Assigned Service Account must have write permissions to the Yandex Object Storage. A new temporary static access keys from assigned Service Account used to upload file.

»Configuration

»Required:

  • folder_id (string) - The folder ID that will be used to store imported Image.

  • service_account_id (string) - Service Account ID with proper permission to use Storage service for operations 'upload' and 'delete' object to bucket

»Optional:

  • token (string) - OAuth token to use to authenticate to Yandex.Cloud.

  • service_account_key_file (string) - Path to file with Service Account key in json format. This is an alternative method to authenticate to Yandex.Cloud.

  • bucket (string) - The name of the bucket where the qcow2 file will be uploaded to for import. This bucket must exist when the post-processor is run.

    If import occurred after Yandex-Export post-processor, artifact already in storage service and first paths (URL) is used to, so no need to set this param.

  • object_name (string) - The name of the object key in bucket where the qcow2 file will be copied to import. This is a template engine. Therefore, you may use user variables and template functions in this field.

  • skip_clean (bool) - Whether skip removing the qcow2 file uploaded to Storage after the import process has completed. Possible values are: true to leave it in the bucket, false to remove it. (Default: false).

  • image_name (string) - The name of the image, which contains 1-63 characters and only supports lowercase English characters, numbers and hyphen.

  • image_description (string) - The description of the image.

  • image_family (string) - The family name of the imported image.

  • image_labels (map[string]string) - Key/value pair labels to apply to the imported image.

»Basic Example

TBD

{
  "variables": {
    "token": "{{env `YC_TOKEN`}}"
  },
  "sensitive-variables": ["token"],
  "builders": [
    {
      "type": "file",
      "source": "xenial-server-cloudimg-amd64-disk1.img",
      "target": "test_artifact.qcow2"
    }
  ],
  "post-processors": [
    {
      "type": "yandex-import",
      "token": "{{user `token`}}",
      "folder_id": "b1g8jvfcgmitdrslcn86",
      "service_account_id": "ajeui8kdvg8qs44fbrbr",

      "bucket": "bucket1",

      "image_name": "my-first-imported-image-{{isotime \"02-Jan-06-03-04-05\" | lower }}",

      "keep_input_artifact": false
    }
  ]
}