Show / Hide Table of Contents

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" },
        },
    });
}

}
Inheritance
System.Object
Resource
CustomResource
ImageCopy
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.AliCloud.Ecs
Assembly: Pulumi.AliCloud.dll
Syntax
public class ImageCopy : CustomResource

Constructors

View Source

ImageCopy(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 Source

Description

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>
View Source

Encrypted

Indicates whether to encrypt the image.

Declaration
public Output<bool?> Encrypted { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

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>>
View Source

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>
View Source

KmsKeyId

Key ID used to encrypt the image.

Declaration
public Output<string> KmsKeyId { get; }
Property Value
Type Description
Output<System.String>
View Source

Name

Declaration
public Output<string> Name { get; }
Property Value
Type Description
Output<System.String>
View Source

SourceImageId

The source image ID.

Declaration
public Output<string> SourceImageId { get; }
Property Value
Type Description
Output<System.String>
View Source

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>
View Source

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 Source

Get(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
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.