Class 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+.
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" },
},
});
}
}
Inherited Members
Namespace: Pulumi.AliCloud.Ecs
Assembly: Pulumi.AliCloud.dll
Syntax
public class ImageCopy : CustomResource
Constructors
View SourceImageCopy(String, ImageCopyArgs, CustomResourceOptions)
Create a ImageCopy resource with the given unique name, arguments, and options.
Declaration
public ImageCopy(string name, ImageCopyArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| ImageCopyArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceDescription
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.
Declaration
public Output<string> Description { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Encrypted
Indicates whether to encrypt the image.
Declaration
public Output<bool?> Encrypted { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
Force
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.
Declaration
public Output<bool?> Force { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
ImageName
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.
Declaration
public Output<string> ImageName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
KmsKeyId
Key ID used to encrypt the image.
Declaration
public Output<string> KmsKeyId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Name
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SourceImageId
The source image ID.
Declaration
public Output<string> SourceImageId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SourceRegionId
The ID of the region to which the source custom image belongs. You can call DescribeRegions to view the latest regions of Alibaba Cloud.
Declaration
public Output<string> SourceRegionId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Tags
The tag value of an image. The value of N ranges from 1 to 20.
Declaration
public Output<ImmutableDictionary<string, object>> Tags { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>> |
Methods
View SourceGet(String, Input<String>, ImageCopyState, CustomResourceOptions)
Get an existing ImageCopy resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static ImageCopy Get(string name, Input<string> id, ImageCopyState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| ImageCopyState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| ImageCopy |