ImageCopy
Copies a custom image from one region to another. You can use copied images to perform operations in the target region, such as creating instances (RunInstances) and replacing system disks (ReplaceSystemDisk).
NOTE: You can only copy the custom image when it is in the Available state.
NOTE: You can only copy the image belonging to your Alibaba Cloud account. Images cannot be copied from one account to another.
NOTE: If the copying is not completed, you cannot call DeleteImage to delete the image but you can call CancelCopyImage to cancel the copying.
NOTE: Available in 1.66.0+.
Attributes Reference0
The following attributes are exported:
id- ID of the image.
Example Usage
using Pulumi;
using AliCloud = Pulumi.AliCloud;
class MyStack : Stack
{
public MyStack()
{
var @default = new AliCloud.Ecs.ImageCopy("default", new AliCloud.Ecs.ImageCopyArgs
{
Description = "test-image",
ImageName = "test-image",
SourceImageId = "m-bp1gxyhdswlsn18tu***",
SourceRegionId = "cn-hangzhou",
Tags =
{
{ "FinanceDept", "FinanceDeptJoshua" },
},
});
}
}
Coming soon!
import pulumi
import pulumi_alicloud as alicloud
default = alicloud.ecs.ImageCopy("default",
description="test-image",
image_name="test-image",
source_image_id="m-bp1gxyhdswlsn18tu***",
source_region_id="cn-hangzhou",
tags={
"FinanceDept": "FinanceDeptJoshua",
})import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const defaultImageCopy = new alicloud.ecs.ImageCopy("default", {
description: "test-image",
imageName: "test-image",
sourceImageId: "m-bp1gxyhdswlsn18tu***",
sourceRegionId: "cn-hangzhou",
tags: {
FinanceDept: "FinanceDeptJoshua",
},
});Create a ImageCopy Resource
new ImageCopy(name: string, args: ImageCopyArgs, opts?: CustomResourceOptions);def ImageCopy(resource_name, opts=None, description=None, encrypted=None, force=None, image_name=None, kms_key_id=None, name=None, source_image_id=None, source_region_id=None, tags=None, __props__=None);func NewImageCopy(ctx *Context, name string, args ImageCopyArgs, opts ...ResourceOption) (*ImageCopy, error)public ImageCopy(string name, ImageCopyArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args ImageCopyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ImageCopyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ImageCopyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
ImageCopy Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The ImageCopy resource accepts the following input properties:
- Source
Image stringId The source image ID.
- Source
Region stringId The ID of the region to which the source custom image belongs. You can call DescribeRegions to view the latest regions of Alibaba Cloud.
- Description string
The description of the image. It must be 2 to 256 characters in length and must not start with http:// or https://. Default value: null.
- Encrypted bool
Indicates whether to encrypt the image.
- Force bool
Indicates whether to force delete the custom image, Default is
false. - true:Force deletes the custom image, regardless of whether the image is currently being used by other instances. - false:Verifies that the image is not currently in use by any other instances before deleting the image.- Image
Name string The image name. It must be 2 to 128 characters in length, and must begin with a letter or Chinese character (beginning with http:// or https:// is not allowed). It can contain digits, colons (:), underscores (_), or hyphens (-). Default value: null.
- Kms
Key stringId Key ID used to encrypt the image.
- Name string
- Dictionary<string, object>
The tag value of an image. The value of N ranges from 1 to 20.
- Source
Image stringId The source image ID.
- Source
Region stringId The ID of the region to which the source custom image belongs. You can call DescribeRegions to view the latest regions of Alibaba Cloud.
- Description string
The description of the image. It must be 2 to 256 characters in length and must not start with http:// or https://. Default value: null.
- Encrypted bool
Indicates whether to encrypt the image.
- Force bool
Indicates whether to force delete the custom image, Default is
false. - true:Force deletes the custom image, regardless of whether the image is currently being used by other instances. - false:Verifies that the image is not currently in use by any other instances before deleting the image.- Image
Name string The image name. It must be 2 to 128 characters in length, and must begin with a letter or Chinese character (beginning with http:// or https:// is not allowed). It can contain digits, colons (:), underscores (_), or hyphens (-). Default value: null.
- Kms
Key stringId Key ID used to encrypt the image.
- Name string
- map[string]interface{}
The tag value of an image. The value of N ranges from 1 to 20.
- source
Image stringId The source image ID.
- source
Region stringId The ID of the region to which the source custom image belongs. You can call DescribeRegions to view the latest regions of Alibaba Cloud.
- description string
The description of the image. It must be 2 to 256 characters in length and must not start with http:// or https://. Default value: null.
- encrypted boolean
Indicates whether to encrypt the image.
- force boolean
Indicates whether to force delete the custom image, Default is
false. - true:Force deletes the custom image, regardless of whether the image is currently being used by other instances. - false:Verifies that the image is not currently in use by any other instances before deleting the image.- image
Name string The image name. It must be 2 to 128 characters in length, and must begin with a letter or Chinese character (beginning with http:// or https:// is not allowed). It can contain digits, colons (:), underscores (_), or hyphens (-). Default value: null.
- kms
Key stringId Key ID used to encrypt the image.
- name string
- {[key: string]: any}
The tag value of an image. The value of N ranges from 1 to 20.
- source_
image_ strid The source image ID.
- source_
region_ strid The ID of the region to which the source custom image belongs. You can call DescribeRegions to view the latest regions of Alibaba Cloud.
- description str
The description of the image. It must be 2 to 256 characters in length and must not start with http:// or https://. Default value: null.
- encrypted bool
Indicates whether to encrypt the image.
- force bool
Indicates whether to force delete the custom image, Default is
false. - true:Force deletes the custom image, regardless of whether the image is currently being used by other instances. - false:Verifies that the image is not currently in use by any other instances before deleting the image.- image_
name str The image name. It must be 2 to 128 characters in length, and must begin with a letter or Chinese character (beginning with http:// or https:// is not allowed). It can contain digits, colons (:), underscores (_), or hyphens (-). Default value: null.
- kms_
key_ strid Key ID used to encrypt the image.
- name str
- Dict[str, Any]
The tag value of an image. The value of N ranges from 1 to 20.
Outputs
All input properties are implicitly available as output properties. Additionally, the ImageCopy resource produces the following output properties:
Look up an Existing ImageCopy Resource
Get an existing ImageCopy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ImageCopyState, opts?: CustomResourceOptions): ImageCopystatic get(resource_name, id, opts=None, description=None, encrypted=None, force=None, image_name=None, kms_key_id=None, name=None, source_image_id=None, source_region_id=None, tags=None, __props__=None);func GetImageCopy(ctx *Context, name string, id IDInput, state *ImageCopyState, opts ...ResourceOption) (*ImageCopy, error)public static ImageCopy Get(string name, Input<string> id, ImageCopyState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Description string
The description of the image. It must be 2 to 256 characters in length and must not start with http:// or https://. Default value: null.
- Encrypted bool
Indicates whether to encrypt the image.
- Force bool
Indicates whether to force delete the custom image, Default is
false. - true:Force deletes the custom image, regardless of whether the image is currently being used by other instances. - false:Verifies that the image is not currently in use by any other instances before deleting the image.- Image
Name string The image name. It must be 2 to 128 characters in length, and must begin with a letter or Chinese character (beginning with http:// or https:// is not allowed). It can contain digits, colons (:), underscores (_), or hyphens (-). Default value: null.
- Kms
Key stringId Key ID used to encrypt the image.
- Name string
- Source
Image stringId The source image ID.
- Source
Region stringId The ID of the region to which the source custom image belongs. You can call DescribeRegions to view the latest regions of Alibaba Cloud.
- Dictionary<string, object>
The tag value of an image. The value of N ranges from 1 to 20.
- Description string
The description of the image. It must be 2 to 256 characters in length and must not start with http:// or https://. Default value: null.
- Encrypted bool
Indicates whether to encrypt the image.
- Force bool
Indicates whether to force delete the custom image, Default is
false. - true:Force deletes the custom image, regardless of whether the image is currently being used by other instances. - false:Verifies that the image is not currently in use by any other instances before deleting the image.- Image
Name string The image name. It must be 2 to 128 characters in length, and must begin with a letter or Chinese character (beginning with http:// or https:// is not allowed). It can contain digits, colons (:), underscores (_), or hyphens (-). Default value: null.
- Kms
Key stringId Key ID used to encrypt the image.
- Name string
- Source
Image stringId The source image ID.
- Source
Region stringId The ID of the region to which the source custom image belongs. You can call DescribeRegions to view the latest regions of Alibaba Cloud.
- map[string]interface{}
The tag value of an image. The value of N ranges from 1 to 20.
- description string
The description of the image. It must be 2 to 256 characters in length and must not start with http:// or https://. Default value: null.
- encrypted boolean
Indicates whether to encrypt the image.
- force boolean
Indicates whether to force delete the custom image, Default is
false. - true:Force deletes the custom image, regardless of whether the image is currently being used by other instances. - false:Verifies that the image is not currently in use by any other instances before deleting the image.- image
Name string The image name. It must be 2 to 128 characters in length, and must begin with a letter or Chinese character (beginning with http:// or https:// is not allowed). It can contain digits, colons (:), underscores (_), or hyphens (-). Default value: null.
- kms
Key stringId Key ID used to encrypt the image.
- name string
- source
Image stringId The source image ID.
- source
Region stringId The ID of the region to which the source custom image belongs. You can call DescribeRegions to view the latest regions of Alibaba Cloud.
- {[key: string]: any}
The tag value of an image. The value of N ranges from 1 to 20.
- description str
The description of the image. It must be 2 to 256 characters in length and must not start with http:// or https://. Default value: null.
- encrypted bool
Indicates whether to encrypt the image.
- force bool
Indicates whether to force delete the custom image, Default is
false. - true:Force deletes the custom image, regardless of whether the image is currently being used by other instances. - false:Verifies that the image is not currently in use by any other instances before deleting the image.- image_
name str The image name. It must be 2 to 128 characters in length, and must begin with a letter or Chinese character (beginning with http:// or https:// is not allowed). It can contain digits, colons (:), underscores (_), or hyphens (-). Default value: null.
- kms_
key_ strid Key ID used to encrypt the image.
- name str
- source_
image_ strid The source image ID.
- source_
region_ strid The ID of the region to which the source custom image belongs. You can call DescribeRegions to view the latest regions of Alibaba Cloud.
- Dict[str, Any]
The tag value of an image. The value of N ranges from 1 to 20.
Package Details
- Repository
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.