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

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.ecs.ImageCopy;
import com.pulumi.alicloud.ecs.ImageCopyArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var default_ = new ImageCopy("default", ImageCopyArgs.builder()
.description("test-image")
.imageName("test-image")
.sourceImageId("m-bp1gxyhdswlsn18tu***")
.sourceRegionId("cn-hangzhou")
.tags(Map.of("FinanceDept", "FinanceDeptJoshua"))
.build());
}
}

Attributes Reference0

The following attributes are exported:

  • id - ID of the image.

Import

image can be imported using the id, e.g.

$ pulumi import alicloud:ecs/imageCopy:ImageCopy default m-uf66871ape***yg1q***

Properties

Link copied to clipboard
Link copied to clipboard
val description: Output<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.

Link copied to clipboard
val encrypted: Output<Boolean>?

Indicates whether to encrypt the image.

Link copied to clipboard
val force: Output<Boolean>?

Indicates whether to force delete the custom image, Default is false.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val imageName: Output<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.

Link copied to clipboard
val kmsKeyId: Output<String>?

Key ID used to encrypt the image.

Link copied to clipboard
val name: Output<String>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val sourceImageId: Output<String>

The source image ID.

Link copied to clipboard
val sourceRegionId: Output<String>

The ID of the region to which the source custom image belongs. You can call DescribeRegions to view the latest regions of Alibaba Cloud.

Link copied to clipboard
val tags: Output<Map<String, Any>>?

The tag value of an image. The value of N ranges from 1 to 20.

Link copied to clipboard
val urn: Output<String>