From c2d3e494b6874e54a28e609f752aacbb7200f8b3 Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Wed, 13 May 2020 15:49:34 +0200 Subject: [PATCH] alicloud: better docs + autogenerated post processor docs --- builder/alicloud/ecs/access_config.go | 26 ++++---- builder/alicloud/ecs/builder.hcl2spec.go | 6 +- builder/alicloud/ecs/image_config.go | 65 +++++++++---------- .../alicloud-import/post-processor.go | 57 ++++++++++++---- .../post-processor.hcl2spec.go | 16 ++--- website/pages/docs/builders/alicloud-ecs.mdx | 2 + .../docs/post-processors/alicloud-import.mdx | 56 ++-------------- .../ecs/AlicloudAccessConfig-not-required.mdx | 17 ++--- .../ecs/AlicloudAccessConfig-required.mdx | 11 ++++ .../ecs/AlicloudImageConfig-not-required.mdx | 57 ++++++++-------- .../ecs/AlicloudImageConfig-required.mdx | 8 +-- .../alicloud-import/Config-not-required.mdx | 31 +++++++++ .../alicloud-import/Config-required.mdx | 15 +++++ .../post-processor/alicloud-import/Config.mdx | 2 + 14 files changed, 200 insertions(+), 169 deletions(-) create mode 100644 website/pages/partials/builder/alicloud/ecs/AlicloudAccessConfig-required.mdx create mode 100644 website/pages/partials/post-processor/alicloud-import/Config-not-required.mdx create mode 100644 website/pages/partials/post-processor/alicloud-import/Config-required.mdx create mode 100644 website/pages/partials/post-processor/alicloud-import/Config.mdx diff --git a/builder/alicloud/ecs/access_config.go b/builder/alicloud/ecs/access_config.go index e34a60ef8..100949691 100644 --- a/builder/alicloud/ecs/access_config.go +++ b/builder/alicloud/ecs/access_config.go @@ -18,26 +18,26 @@ import ( // Config of alicloud type AlicloudAccessConfig struct { - // This is the Alicloud access key. It must be provided when profile not exist, but it can also be - // sourced from the ALICLOUD_ACCESS_KEY environment variable. - AlicloudAccessKey string `mapstructure:"access_key" required:"false"` - // This is the Alicloud secret key. It must be provided when profile not exist, but it can also be - // sourced from the ALICLOUD_SECRET_KEY environment variable. - AlicloudSecretKey string `mapstructure:"secret_key" required:"false"` - // This is the Alicloud region. It must be provided when profile not exist, but it can also be - // sourced from the ALICLOUD_REGION environment variables. - AlicloudRegion string `mapstructure:"region" required:"false"` + // Alicloud access key must be provided unless `profile` is set, but it can + // also be sourced from the ```ALICLOUD_ACCESS_KEY``` environment variable. + AlicloudAccessKey string `mapstructure:"access_key" required:"true"` + // Alicloud secret key must be provided unless `profile` is set, but it can + // also be sourced from the ```ALICLOUD_SECRET_KEY``` environment variable. + AlicloudSecretKey string `mapstructure:"secret_key" required:"true"` + // Alicloud region must be provided unless `profile` is set, but it can + // also be sourced from the ```ALICLOUD_REGION``` environment variable. + AlicloudRegion string `mapstructure:"region" required:"true"` // The region validation can be skipped if this value is true, the default // value is false. AlicloudSkipValidation bool `mapstructure:"skip_region_validation" required:"false"` // The image validation can be skipped if this value is true, the default // value is false. AlicloudSkipImageValidation bool `mapstructure:"skip_image_validation" required:"false"` - // This is th Alicloud profile. If access_key not exist, is must be provided, but it can also be - // sourced from the ALICLOUD_PROFILE environment variables. + // Alicloud profile must be set unless `access_key` is set; it can also be + // sourced from the ```ALICLOUD_PROFILE``` environment variable. AlicloudProfile string `mapstructure:"profile" required:"false"` - // This is the Alicloud shared credentials file path. If this file path exist, os will read access key - // and secret key from this file. + // Alicloud shared credentials file path. If this file exists, access and + // secret keys will be read from this file. AlicloudSharedCredentialsFile string `mapstructure:"shared_credentials_file" required:"false"` // STS access token, can be set through template or by exporting as // environment variable such as `export SECURITY_TOKEN=value`. diff --git a/builder/alicloud/ecs/builder.hcl2spec.go b/builder/alicloud/ecs/builder.hcl2spec.go index fb2361912..780e8ee13 100644 --- a/builder/alicloud/ecs/builder.hcl2spec.go +++ b/builder/alicloud/ecs/builder.hcl2spec.go @@ -54,9 +54,9 @@ type FlatConfig struct { PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables"` - AlicloudAccessKey *string `mapstructure:"access_key" required:"false" cty:"access_key"` - AlicloudSecretKey *string `mapstructure:"secret_key" required:"false" cty:"secret_key"` - AlicloudRegion *string `mapstructure:"region" required:"false" cty:"region"` + AlicloudAccessKey *string `mapstructure:"access_key" required:"true" cty:"access_key"` + AlicloudSecretKey *string `mapstructure:"secret_key" required:"true" cty:"secret_key"` + AlicloudRegion *string `mapstructure:"region" required:"true" cty:"region"` AlicloudSkipValidation *bool `mapstructure:"skip_region_validation" required:"false" cty:"skip_region_validation"` AlicloudSkipImageValidation *bool `mapstructure:"skip_image_validation" required:"false" cty:"skip_image_validation"` AlicloudProfile *string `mapstructure:"profile" required:"false" cty:"profile"` diff --git a/builder/alicloud/ecs/image_config.go b/builder/alicloud/ecs/image_config.go index f1ba17246..9da9ae996 100644 --- a/builder/alicloud/ecs/image_config.go +++ b/builder/alicloud/ecs/image_config.go @@ -136,59 +136,58 @@ type AlicloudDiskDevices struct { } type AlicloudImageConfig struct { - // The name of the user-defined image, [2, 128] - // English or Chinese characters. It must begin with an uppercase/lowercase - // letter or a Chinese character, and may contain numbers, _ or -. It - // cannot begin with `http://` or `https://`. + // The name of the user-defined image, [2, 128] English or Chinese + // characters. It must begin with an uppercase/lowercase letter or a + // Chinese character, and may contain numbers, `_` or `-`. It cannot begin + // with `http://` or `https://`. AlicloudImageName string `mapstructure:"image_name" required:"true"` - // The version number of the image, with a length - // limit of 1 to 40 English characters. + // The version number of the image, with a length limit of 1 to 40 English + // characters. AlicloudImageVersion string `mapstructure:"image_version" required:"false"` - // The description of the image, with a length - // limit of 0 to 256 characters. Leaving it blank means null, which is the - // default value. It cannot begin with `http://` or `https://`. + // The description of the image, with a length limit of 0 to 256 + // characters. Leaving it blank means null, which is the default value. It + // cannot begin with `http://` or `https://`. AlicloudImageDescription string `mapstructure:"image_description" required:"false"` - // The IDs of to-be-added Aliyun - // accounts to which the image is shared. The number of accounts is 1 to 10. - // If number of accounts is greater than 10, this parameter is ignored. + // The IDs of to-be-added Aliyun accounts to which the image is shared. The + // number of accounts is 1 to 10. If number of accounts is greater than 10, + // this parameter is ignored. AlicloudImageShareAccounts []string `mapstructure:"image_share_account" required:"false"` AlicloudImageUNShareAccounts []string `mapstructure:"image_unshare_account"` // Copy to the destination regionIds. AlicloudImageDestinationRegions []string `mapstructure:"image_copy_regions" required:"false"` - // The name of the destination image, - // [2, 128] English or Chinese characters. It must begin with an - // uppercase/lowercase letter or a Chinese character, and may contain numbers, - // _ or -. It cannot begin with `http://` or `https://`. + // The name of the destination image, [2, 128] English or Chinese + // characters. It must begin with an uppercase/lowercase letter or a + // Chinese character, and may contain numbers, _ or -. It cannot begin with + // `http://` or `https://`. AlicloudImageDestinationNames []string `mapstructure:"image_copy_names" required:"false"` - // Whether or not to encrypt the target images, including those copied if image_copy_regions is specified. If this option - // is set to true, a temporary image will be created from the provisioned - // instance in the main region and an encrypted copy will be generated in the - // same region. By default, Packer will keep the encryption setting to what - // it was in the source image. + // Whether or not to encrypt the target images, including those + // copied if image_copy_regions is specified. If this option is set to + // true, a temporary image will be created from the provisioned instance in + // the main region and an encrypted copy will be generated in the same + // region. By default, Packer will keep the encryption setting to what it + // was in the source image. ImageEncrypted config.Trilean `mapstructure:"image_encrypted" required:"false"` // If this value is true, when the target image names including those // copied are duplicated with existing images, it will delete the existing // images and then create the target images, otherwise, the creation will // fail. The default value is false. Check `image_name` and // `image_copy_names` options for names of target images. If - // [-force](/docs/commands/build#force) option is - // provided in `build` command, this option can be omitted and taken as - // true. + // [-force](/docs/commands/build#force) option is provided in `build` + // command, this option can be omitted and taken as true. AlicloudImageForceDelete bool `mapstructure:"image_force_delete" required:"false"` // If this value is true, when delete the duplicated existing images, the // source snapshots of those images will be delete either. If - // [-force](/docs/commands/build#force) option is - // provided in `build` command, this option can be omitted and taken as - // true. + // [-force](/docs/commands/build#force) option is provided in `build` + // command, this option can be omitted and taken as true. AlicloudImageForceDeleteSnapshots bool `mapstructure:"image_force_delete_snapshots" required:"false"` AlicloudImageForceDeleteInstances bool `mapstructure:"image_force_delete_instances"` - // If this value is true, the image - // created will not include any snapshot of data disks. This option would be - // useful for any circumstance that default data disks with instance types are - // not concerned. The default value is false. + // If this value is true, the image created will not include any snapshot + // of data disks. This option would be useful for any circumstance that + // default data disks with instance types are not concerned. The default + // value is false. AlicloudImageIgnoreDataDisks bool `mapstructure:"image_ignore_data_disks" required:"false"` - // The region validation can be skipped - // if this value is true, the default value is false. + // The region validation can be skipped if this value is true, the default + // value is false. AlicloudImageSkipRegionValidation bool `mapstructure:"skip_region_validation" required:"false"` // Key/value pair tags applied to the destination image and relevant // snapshots. diff --git a/post-processor/alicloud-import/post-processor.go b/post-processor/alicloud-import/post-processor.go index f2e4bb76b..2b2eed42d 100644 --- a/post-processor/alicloud-import/post-processor.go +++ b/post-processor/alicloud-import/post-processor.go @@ -1,4 +1,5 @@ //go:generate mapstructure-to-hcl2 -type Config +//go:generate struct-markdown package alicloudimport @@ -57,20 +58,48 @@ const ( type Config struct { packerecs.Config `mapstructure:",squash"` - // Variables specific to this post processor - OSSBucket string `mapstructure:"oss_bucket_name"` - OSSKey string `mapstructure:"oss_key_name"` - SkipClean bool `mapstructure:"skip_clean"` - Tags map[string]string `mapstructure:"tags"` - AlicloudImageDescription string `mapstructure:"image_description"` - AlicloudImageShareAccounts []string `mapstructure:"image_share_account"` - AlicloudImageDestinationRegions []string `mapstructure:"image_copy_regions"` - OSType string `mapstructure:"image_os_type"` - Platform string `mapstructure:"image_platform"` - Architecture string `mapstructure:"image_architecture"` - Size string `mapstructure:"image_system_size"` - Format string `mapstructure:"format"` - AlicloudImageForceDelete bool `mapstructure:"image_force_delete"` + // The name of the OSS bucket where the RAW or VHD file will be copied to + // for import. If the Bucket isn't exist, post-process will create it for + // you. + OSSBucket string `mapstructure:"oss_bucket_name" required:"true"` + // The name of the object key in `oss_bucket_name` where the RAW or VHD + // file will be copied to for import. This is treated as a [template + // engine](/docs/templates/engine), and you may access any of the variables + // stored in the generated data using the [build](/docs/templates/engine) + // template function. + OSSKey string `mapstructure:"oss_key_name"` + // Whether we should skip removing the RAW or VHD file uploaded to OSS + // after the import process has completed. `true` means that we should + // leave it in the OSS bucket, `false` means to clean it out. Defaults to + // `false`. + SkipClean bool `mapstructure:"skip_clean"` + Tags map[string]string `mapstructure:"tags"` + // The description of the image, with a length limit of `0` to `256` + // characters. Leaving it blank means null, which is the default value. It + // cannot begin with `http://` or `https://`. + AlicloudImageDescription string `mapstructure:"image_description"` + AlicloudImageShareAccounts []string `mapstructure:"image_share_account"` + AlicloudImageDestinationRegions []string `mapstructure:"image_copy_regions"` + // Type of the OS, like linux/windows + OSType string `mapstructure:"image_os_type" required:"true"` + // Platform such as `CentOS` + Platform string `mapstructure:"image_platform" required:"true"` + // Platform type of the image system: `i386` or `x86_64` + Architecture string `mapstructure:"image_architecture" required:"true"` + // Size of the system disk, in GB, values + // range: + // - cloud - 5 \~ 2000 + // - cloud_efficiency - 20 \~ 2048 + // - cloud_ssd - 20 \~ 2048 + Size string `mapstructure:"image_system_size"` + // The format of the image for import, now alicloud only support RAW and + // VHD. + Format string `mapstructure:"format" required:"true"` + // If this value is true, when the target image name is duplicated with an + // existing image, it will delete the existing image and then create the + // target image, otherwise, the creation will fail. The default value is + // false. + AlicloudImageForceDelete bool `mapstructure:"image_force_delete"` ctx interpolate.Context } diff --git a/post-processor/alicloud-import/post-processor.hcl2spec.go b/post-processor/alicloud-import/post-processor.hcl2spec.go index c49ad3b8d..b22c0e13a 100644 --- a/post-processor/alicloud-import/post-processor.hcl2spec.go +++ b/post-processor/alicloud-import/post-processor.hcl2spec.go @@ -18,9 +18,9 @@ type FlatConfig struct { PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables"` - AlicloudAccessKey *string `mapstructure:"access_key" required:"false" cty:"access_key"` - AlicloudSecretKey *string `mapstructure:"secret_key" required:"false" cty:"secret_key"` - AlicloudRegion *string `mapstructure:"region" required:"false" cty:"region"` + AlicloudAccessKey *string `mapstructure:"access_key" required:"true" cty:"access_key"` + AlicloudSecretKey *string `mapstructure:"secret_key" required:"true" cty:"secret_key"` + AlicloudRegion *string `mapstructure:"region" required:"true" cty:"region"` AlicloudSkipValidation *bool `mapstructure:"skip_region_validation" required:"false" cty:"skip_region_validation"` AlicloudSkipImageValidation *bool `mapstructure:"skip_image_validation" required:"false" cty:"skip_image_validation"` AlicloudProfile *string `mapstructure:"profile" required:"false" cty:"profile"` @@ -106,14 +106,14 @@ type FlatConfig struct { WinRMInsecure *bool `mapstructure:"winrm_insecure" cty:"winrm_insecure"` WinRMUseNTLM *bool `mapstructure:"winrm_use_ntlm" cty:"winrm_use_ntlm"` SSHPrivateIp *bool `mapstructure:"ssh_private_ip" required:"false" cty:"ssh_private_ip"` - OSSBucket *string `mapstructure:"oss_bucket_name" cty:"oss_bucket_name"` + OSSBucket *string `mapstructure:"oss_bucket_name" required:"true" cty:"oss_bucket_name"` OSSKey *string `mapstructure:"oss_key_name" cty:"oss_key_name"` SkipClean *bool `mapstructure:"skip_clean" cty:"skip_clean"` - OSType *string `mapstructure:"image_os_type" cty:"image_os_type"` - Platform *string `mapstructure:"image_platform" cty:"image_platform"` - Architecture *string `mapstructure:"image_architecture" cty:"image_architecture"` + OSType *string `mapstructure:"image_os_type" required:"true" cty:"image_os_type"` + Platform *string `mapstructure:"image_platform" required:"true" cty:"image_platform"` + Architecture *string `mapstructure:"image_architecture" required:"true" cty:"image_architecture"` Size *string `mapstructure:"image_system_size" cty:"image_system_size"` - Format *string `mapstructure:"format" cty:"format"` + Format *string `mapstructure:"format" required:"true" cty:"format"` } // FlatMapstructure returns a new FlatConfig. diff --git a/website/pages/docs/builders/alicloud-ecs.mdx b/website/pages/docs/builders/alicloud-ecs.mdx index 95fecd8b7..26a6cf352 100644 --- a/website/pages/docs/builders/alicloud-ecs.mdx +++ b/website/pages/docs/builders/alicloud-ecs.mdx @@ -23,6 +23,8 @@ builder. ### Required: +@include 'builder/alicloud/ecs/AlicloudAccessConfig-required.mdx' + @include 'builder/alicloud/ecs/RunConfig-required.mdx' @include 'builder/alicloud/ecs/AlicloudImageConfig-required.mdx' diff --git a/website/pages/docs/post-processors/alicloud-import.mdx b/website/pages/docs/post-processors/alicloud-import.mdx index 049142bf7..a9ce5a9ce 100644 --- a/website/pages/docs/post-processors/alicloud-import.mdx +++ b/website/pages/docs/post-processors/alicloud-import.mdx @@ -28,66 +28,18 @@ are two categories: required and optional parameters. ### Required: -- `access_key` (string) - This is the Alicloud access key. It must be - provided, but it can also be sourced from the `ALICLOUD_ACCESS_KEY` - environment variable. +@include 'builder/alicloud/ecs/AlicloudAccessConfig-required.mdx' -- `secret_key` (string) - This is the Alicloud secret key. It must be - provided, but it can also be sourced from the `ALICLOUD_SECRET_KEY` - environment variable. +@include 'builder/alicloud/ecs/AlicloudImageConfig-required.mdx' -- `region` (string) - This is the Alicloud region. It must be provided, but - it can also be sourced from the `ALICLOUD_REGION` environment variables. - -- `image_name` (string) - The name of the user-defined image, \[2, 128\] - English or Chinese characters. It must begin with an uppercase/lowercase - letter or a Chinese character, and may contain numbers, `_` or `-`. It - cannot begin with `http://` or `https://` - -- `oss_bucket_name` (string) - The name of the OSS bucket where the RAW or - VHD file will be copied to for import. If the Bucket isn't exist, - post-process will create it for you. - -- `image_os_type` (string) - Type of the OS linux/windows - -- `image_platform` (string) - platform such `CentOS` - -- `image_architecture` (string) - Platform type of the image system: `i386` or - `x86_64` - -- `format` (string) - The format of the image for import, now alicloud only - support RAW and VHD. +@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. -- `oss_key_name` (string) - The name of the object key in `oss_bucket_name` - where the RAW or VHD file will be copied to for import. This is treated as - a [template engine](/docs/templates/engine), and you may access any of - the variables stored in the generated data using the - [build](/docs/templates/engine) template function. - -- `skip_clean` (boolean) - Whether we should skip removing the RAW or VHD - file uploaded to OSS after the import process has completed. `true` means - that we should leave it in the OSS bucket, `false` means to clean it out. - Defaults to `false`. - -- `image_description` (string) - The description of the image, with a length - limit of 0 to 256 characters. Leaving it blank means null, which is the - default value. It cannot begin with `http://` or `https://`. - -- `image_force_delete` (boolean) - If this value is true, when the target - image name is duplicated with an existing image, it will delete the - existing image and then create the target image, otherwise, the creation - will fail. The default value is false. - -- `image_system_size` (number) - Size of the system disk, in GB, values - range: - - cloud - 5 \~ 2000 - - cloud_efficiency - 20 \~ 2048 - - cloud_ssd - 20 \~ 2048 +@include 'post-processor/alicloud-import/Config-not-required.mdx' ## Basic Example diff --git a/website/pages/partials/builder/alicloud/ecs/AlicloudAccessConfig-not-required.mdx b/website/pages/partials/builder/alicloud/ecs/AlicloudAccessConfig-not-required.mdx index 6127059b2..311426cf7 100644 --- a/website/pages/partials/builder/alicloud/ecs/AlicloudAccessConfig-not-required.mdx +++ b/website/pages/partials/builder/alicloud/ecs/AlicloudAccessConfig-not-required.mdx @@ -1,25 +1,16 @@ -- `access_key` (string) - This is the Alicloud access key. It must be provided when profile not exist, but it can also be - sourced from the ALICLOUD_ACCESS_KEY environment variable. - -- `secret_key` (string) - This is the Alicloud secret key. It must be provided when profile not exist, but it can also be - sourced from the ALICLOUD_SECRET_KEY environment variable. - -- `region` (string) - This is the Alicloud region. It must be provided when profile not exist, but it can also be - sourced from the ALICLOUD_REGION environment variables. - - `skip_region_validation` (bool) - The region validation can be skipped if this value is true, the default value is false. - `skip_image_validation` (bool) - The image validation can be skipped if this value is true, the default value is false. -- `profile` (string) - This is th Alicloud profile. If access_key not exist, is must be provided, but it can also be - sourced from the ALICLOUD_PROFILE environment variables. +- `profile` (string) - Alicloud profile must be set unless `access_key` is set; it can also be + sourced from the ```ALICLOUD_PROFILE``` environment variable. -- `shared_credentials_file` (string) - This is the Alicloud shared credentials file path. If this file path exist, os will read access key - and secret key from this file. +- `shared_credentials_file` (string) - Alicloud shared credentials file path. If this file exists, access and + secret keys will be read from this file. - `security_token` (string) - STS access token, can be set through template or by exporting as environment variable such as `export SECURITY_TOKEN=value`. diff --git a/website/pages/partials/builder/alicloud/ecs/AlicloudAccessConfig-required.mdx b/website/pages/partials/builder/alicloud/ecs/AlicloudAccessConfig-required.mdx new file mode 100644 index 000000000..f7c31fb99 --- /dev/null +++ b/website/pages/partials/builder/alicloud/ecs/AlicloudAccessConfig-required.mdx @@ -0,0 +1,11 @@ + + +- `access_key` (string) - Alicloud access key must be provided unless `profile` is set, but it can + also be sourced from the ```ALICLOUD_ACCESS_KEY``` environment variable. + +- `secret_key` (string) - Alicloud secret key must be provided unless `profile` is set, but it can + also be sourced from the ```ALICLOUD_SECRET_KEY``` environment variable. + +- `region` (string) - Alicloud region must be provided unless `profile` is set, but it can + also be sourced from the ```ALICLOUD_REGION``` environment variable. + \ No newline at end of file diff --git a/website/pages/partials/builder/alicloud/ecs/AlicloudImageConfig-not-required.mdx b/website/pages/partials/builder/alicloud/ecs/AlicloudImageConfig-not-required.mdx index 88dfdf41a..047e10355 100644 --- a/website/pages/partials/builder/alicloud/ecs/AlicloudImageConfig-not-required.mdx +++ b/website/pages/partials/builder/alicloud/ecs/AlicloudImageConfig-not-required.mdx @@ -1,53 +1,52 @@ -- `image_version` (string) - The version number of the image, with a length - limit of 1 to 40 English characters. +- `image_version` (string) - The version number of the image, with a length limit of 1 to 40 English + characters. -- `image_description` (string) - The description of the image, with a length - limit of 0 to 256 characters. Leaving it blank means null, which is the - default value. It cannot begin with `http://` or `https://`. +- `image_description` (string) - The description of the image, with a length limit of 0 to 256 + characters. Leaving it blank means null, which is the default value. It + cannot begin with `http://` or `https://`. -- `image_share_account` ([]string) - The IDs of to-be-added Aliyun - accounts to which the image is shared. The number of accounts is 1 to 10. - If number of accounts is greater than 10, this parameter is ignored. +- `image_share_account` ([]string) - The IDs of to-be-added Aliyun accounts to which the image is shared. The + number of accounts is 1 to 10. If number of accounts is greater than 10, + this parameter is ignored. - `image_unshare_account` ([]string) - Alicloud Image UN Share Accounts - `image_copy_regions` ([]string) - Copy to the destination regionIds. -- `image_copy_names` ([]string) - The name of the destination image, - [2, 128] English or Chinese characters. It must begin with an - uppercase/lowercase letter or a Chinese character, and may contain numbers, - _ or -. It cannot begin with `http://` or `https://`. +- `image_copy_names` ([]string) - The name of the destination image, [2, 128] English or Chinese + characters. It must begin with an uppercase/lowercase letter or a + Chinese character, and may contain numbers, _ or -. It cannot begin with + `http://` or `https://`. -- `image_encrypted` (boolean) - Whether or not to encrypt the target images, including those copied if image_copy_regions is specified. If this option - is set to true, a temporary image will be created from the provisioned - instance in the main region and an encrypted copy will be generated in the - same region. By default, Packer will keep the encryption setting to what - it was in the source image. +- `image_encrypted` (boolean) - Whether or not to encrypt the target images, including those + copied if image_copy_regions is specified. If this option is set to + true, a temporary image will be created from the provisioned instance in + the main region and an encrypted copy will be generated in the same + region. By default, Packer will keep the encryption setting to what it + was in the source image. - `image_force_delete` (bool) - If this value is true, when the target image names including those copied are duplicated with existing images, it will delete the existing images and then create the target images, otherwise, the creation will fail. The default value is false. Check `image_name` and `image_copy_names` options for names of target images. If - [-force](/docs/commands/build#force) option is - provided in `build` command, this option can be omitted and taken as - true. + [-force](/docs/commands/build#force) option is provided in `build` + command, this option can be omitted and taken as true. - `image_force_delete_snapshots` (bool) - If this value is true, when delete the duplicated existing images, the source snapshots of those images will be delete either. If - [-force](/docs/commands/build#force) option is - provided in `build` command, this option can be omitted and taken as - true. + [-force](/docs/commands/build#force) option is provided in `build` + command, this option can be omitted and taken as true. - `image_force_delete_instances` (bool) - Alicloud Image Force Delete Instances -- `image_ignore_data_disks` (bool) - If this value is true, the image - created will not include any snapshot of data disks. This option would be - useful for any circumstance that default data disks with instance types are - not concerned. The default value is false. +- `image_ignore_data_disks` (bool) - If this value is true, the image created will not include any snapshot + of data disks. This option would be useful for any circumstance that + default data disks with instance types are not concerned. The default + value is false. -- `skip_region_validation` (bool) - The region validation can be skipped - if this value is true, the default value is false. +- `skip_region_validation` (bool) - The region validation can be skipped if this value is true, the default + value is false. - `tags` (map[string]string) - Key/value pair tags applied to the destination image and relevant snapshots. diff --git a/website/pages/partials/builder/alicloud/ecs/AlicloudImageConfig-required.mdx b/website/pages/partials/builder/alicloud/ecs/AlicloudImageConfig-required.mdx index 15f5e260f..d6a1723fd 100644 --- a/website/pages/partials/builder/alicloud/ecs/AlicloudImageConfig-required.mdx +++ b/website/pages/partials/builder/alicloud/ecs/AlicloudImageConfig-required.mdx @@ -1,7 +1,7 @@ -- `image_name` (string) - The name of the user-defined image, [2, 128] - English or Chinese characters. It must begin with an uppercase/lowercase - letter or a Chinese character, and may contain numbers, _ or -. It - cannot begin with `http://` or `https://`. +- `image_name` (string) - The name of the user-defined image, [2, 128] English or Chinese + characters. It must begin with an uppercase/lowercase letter or a + Chinese character, and may contain numbers, `_` or `-`. It cannot begin + with `http://` or `https://`. \ No newline at end of file diff --git a/website/pages/partials/post-processor/alicloud-import/Config-not-required.mdx b/website/pages/partials/post-processor/alicloud-import/Config-not-required.mdx new file mode 100644 index 000000000..05f16b42d --- /dev/null +++ b/website/pages/partials/post-processor/alicloud-import/Config-not-required.mdx @@ -0,0 +1,31 @@ + + +- `oss_key_name` (string) - The name of the object key in `oss_bucket_name` where the RAW or VHD + file will be copied to for import. This is treated as a [template + engine](/docs/templates/engine), and you may access any of the variables + stored in the generated data using the [build](/docs/templates/engine) + template function. + +- `skip_clean` (bool) - Whether we should skip removing the RAW or VHD file uploaded to OSS + after the import process has completed. `true` means that we should + leave it in the OSS bucket, `false` means to clean it out. Defaults to + `false`. + +- `tags` (map[string]string) - Tags +- `image_description` (string) - The description of the image, with a length limit of `0` to `256` + characters. Leaving it blank means null, which is the default value. It + cannot begin with `http://` or `https://`. + +- `image_share_account` ([]string) - Alicloud Image Share Accounts +- `image_copy_regions` ([]string) - Alicloud Image Destination Regions +- `image_system_size` (string) - Size of the system disk, in GB, values + range: + - cloud - 5 \~ 2000 + - cloud_efficiency - 20 \~ 2048 + - cloud_ssd - 20 \~ 2048 + +- `image_force_delete` (bool) - If this value is true, when the target image name is duplicated with an + existing image, it will delete the existing image and then create the + target image, otherwise, the creation will fail. The default value is + false. + \ No newline at end of file diff --git a/website/pages/partials/post-processor/alicloud-import/Config-required.mdx b/website/pages/partials/post-processor/alicloud-import/Config-required.mdx new file mode 100644 index 000000000..a45ae3c73 --- /dev/null +++ b/website/pages/partials/post-processor/alicloud-import/Config-required.mdx @@ -0,0 +1,15 @@ + + +- `oss_bucket_name` (string) - The name of the OSS bucket where the RAW or VHD file will be copied to + for import. If the Bucket isn't exist, post-process will create it for + you. + +- `image_os_type` (string) - Type of the OS, like linux/windows + +- `image_platform` (string) - Platform such as `CentOS` + +- `image_architecture` (string) - Platform type of the image system: `i386` or `x86_64` + +- `format` (string) - The format of the image for import, now alicloud only support RAW and + VHD. + \ No newline at end of file diff --git a/website/pages/partials/post-processor/alicloud-import/Config.mdx b/website/pages/partials/post-processor/alicloud-import/Config.mdx new file mode 100644 index 000000000..f6de1b236 --- /dev/null +++ b/website/pages/partials/post-processor/alicloud-import/Config.mdx @@ -0,0 +1,2 @@ + +Configuration of this post processor