Image

Creates a custom image. You can then use a custom image to create ECS instances (RunInstances) or change the system disk for an existing instance (ReplaceSystemDisk).

NOTE: If you want to create a template from an ECS instance, you can specify the instance ID (InstanceId) to create a custom image. You must make sure that the status of the specified instance is Running or Stopped. After a successful invocation, each disk of the specified instance has a new snapshot created.

NOTE: If you want to create a custom image based on the system disk of your ECS instance, you can specify one of the system disk snapshots (SnapshotId) to create a custom image. However, the specified snapshot cannot be created on or before July 15, 2013.

NOTE: If you want to combine snapshots of multiple disks into an image template, you can specify DiskDeviceMapping to create a custom image.

NOTE: Available in 1.64.0+

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var @default = new AliCloud.Ecs.Image("default", new AliCloud.Ecs.ImageArgs
        {
            Architecture = "x86_64",
            Description = "test-image",
            ImageName = "test-image",
            InstanceId = "i-bp1g6zv0ce8oghu7k***",
            Platform = "CentOS",
            ResourceGroupId = "rg-bp67acfmxazb4ph***",
            Tags = 
            {
                { "FinanceDept", "FinanceDeptJoshua" },
            },
        });
    }

}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

default = alicloud.ecs.Image("default",
    architecture="x86_64",
    description="test-image",
    image_name="test-image",
    instance_id="i-bp1g6zv0ce8oghu7k***",
    platform="CentOS",
    resource_group_id="rg-bp67acfmxazb4ph***",
    tags={
        "FinanceDept": "FinanceDeptJoshua",
    })
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const defaultImage = new alicloud.ecs.Image("default", {
    architecture: "x86_64",
    description: "test-image",
    imageName: "test-image",
    instanceId: "i-bp1g6zv0ce8oghu7k***",
    platform: "CentOS",
    resourceGroupId: "rg-bp67acfmxazb4ph***",
    tags: {
        FinanceDept: "FinanceDeptJoshua",
    },
});

Create a Image Resource

new Image(name: string, args?: ImageArgs, opts?: CustomResourceOptions);
def Image(resource_name, opts=None, architecture=None, description=None, disk_device_mappings=None, force=None, image_name=None, instance_id=None, name=None, platform=None, resource_group_id=None, snapshot_id=None, tags=None, __props__=None);
func NewImage(ctx *Context, name string, args *ImageArgs, opts ...ResourceOption) (*Image, error)
public Image(string name, ImageArgs? args = null, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args ImageArgs
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 ImageArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ImageArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Image Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Image resource accepts the following input properties:

Architecture string

Specifies the architecture of the system disk after you specify a data disk snapshot as the data source of the system disk for creating an image. Valid values: i386 , Default is x86_64.

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.

DiskDeviceMappings List<Pulumi.AliCloud.Ecs.Inputs.ImageDiskDeviceMappingArgs>

Description of the system with disks and snapshots under 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.

ImageName 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.

InstanceId string

The instance ID.

Name string

Deprecated: Attribute 'name' has been deprecated from version 1.69.0. Use image_name instead.

Platform string

Specifies the operating system platform of the system disk after you specify a data disk snapshot as the data source of the system disk for creating an image. Valid values: CentOS, Ubuntu, SUSE, OpenSUSE, RedHat, Debian, CoreOS, Aliyun Linux, Windows Server 2003, Windows Server 2008, Windows Server 2012, Windows 7, Default is Others Linux, Customized Linux.

ResourceGroupId string

The ID of the enterprise resource group to which a custom image belongs

SnapshotId string

Specifies a snapshot that is used to create a combined custom image.

Tags Dictionary<string, object>

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

Architecture string

Specifies the architecture of the system disk after you specify a data disk snapshot as the data source of the system disk for creating an image. Valid values: i386 , Default is x86_64.

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.

DiskDeviceMappings []ImageDiskDeviceMapping

Description of the system with disks and snapshots under 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.

ImageName 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.

InstanceId string

The instance ID.

Name string

Deprecated: Attribute 'name' has been deprecated from version 1.69.0. Use image_name instead.

Platform string

Specifies the operating system platform of the system disk after you specify a data disk snapshot as the data source of the system disk for creating an image. Valid values: CentOS, Ubuntu, SUSE, OpenSUSE, RedHat, Debian, CoreOS, Aliyun Linux, Windows Server 2003, Windows Server 2008, Windows Server 2012, Windows 7, Default is Others Linux, Customized Linux.

ResourceGroupId string

The ID of the enterprise resource group to which a custom image belongs

SnapshotId string

Specifies a snapshot that is used to create a combined custom image.

Tags map[string]interface{}

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

architecture string

Specifies the architecture of the system disk after you specify a data disk snapshot as the data source of the system disk for creating an image. Valid values: i386 , Default is x86_64.

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.

diskDeviceMappings ImageDiskDeviceMapping[]

Description of the system with disks and snapshots under 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.

imageName 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.

instanceId string

The instance ID.

name string

Deprecated: Attribute 'name' has been deprecated from version 1.69.0. Use image_name instead.

platform string

Specifies the operating system platform of the system disk after you specify a data disk snapshot as the data source of the system disk for creating an image. Valid values: CentOS, Ubuntu, SUSE, OpenSUSE, RedHat, Debian, CoreOS, Aliyun Linux, Windows Server 2003, Windows Server 2008, Windows Server 2012, Windows 7, Default is Others Linux, Customized Linux.

resourceGroupId string

The ID of the enterprise resource group to which a custom image belongs

snapshotId string

Specifies a snapshot that is used to create a combined custom image.

tags {[key: string]: any}

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

architecture str

Specifies the architecture of the system disk after you specify a data disk snapshot as the data source of the system disk for creating an image. Valid values: i386 , Default is x86_64.

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.

disk_device_mappings List[ImageDiskDeviceMapping]

Description of the system with disks and snapshots under 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.

instance_id str

The instance ID.

name str

Deprecated: Attribute 'name' has been deprecated from version 1.69.0. Use image_name instead.

platform str

Specifies the operating system platform of the system disk after you specify a data disk snapshot as the data source of the system disk for creating an image. Valid values: CentOS, Ubuntu, SUSE, OpenSUSE, RedHat, Debian, CoreOS, Aliyun Linux, Windows Server 2003, Windows Server 2008, Windows Server 2012, Windows 7, Default is Others Linux, Customized Linux.

resource_group_id str

The ID of the enterprise resource group to which a custom image belongs

snapshot_id str

Specifies a snapshot that is used to create a combined custom image.

tags 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 Image resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing Image Resource

Get an existing Image 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?: ImageState, opts?: CustomResourceOptions): Image
static get(resource_name, id, opts=None, architecture=None, description=None, disk_device_mappings=None, force=None, image_name=None, instance_id=None, name=None, platform=None, resource_group_id=None, snapshot_id=None, tags=None, __props__=None);
func GetImage(ctx *Context, name string, id IDInput, state *ImageState, opts ...ResourceOption) (*Image, error)
public static Image Get(string name, Input<string> id, ImageState? 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:

Architecture string

Specifies the architecture of the system disk after you specify a data disk snapshot as the data source of the system disk for creating an image. Valid values: i386 , Default is x86_64.

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.

DiskDeviceMappings List<Pulumi.AliCloud.Ecs.Inputs.ImageDiskDeviceMappingArgs>

Description of the system with disks and snapshots under 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.

ImageName 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.

InstanceId string

The instance ID.

Name string

Deprecated: Attribute 'name' has been deprecated from version 1.69.0. Use image_name instead.

Platform string

Specifies the operating system platform of the system disk after you specify a data disk snapshot as the data source of the system disk for creating an image. Valid values: CentOS, Ubuntu, SUSE, OpenSUSE, RedHat, Debian, CoreOS, Aliyun Linux, Windows Server 2003, Windows Server 2008, Windows Server 2012, Windows 7, Default is Others Linux, Customized Linux.

ResourceGroupId string

The ID of the enterprise resource group to which a custom image belongs

SnapshotId string

Specifies a snapshot that is used to create a combined custom image.

Tags Dictionary<string, object>

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

Architecture string

Specifies the architecture of the system disk after you specify a data disk snapshot as the data source of the system disk for creating an image. Valid values: i386 , Default is x86_64.

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.

DiskDeviceMappings []ImageDiskDeviceMapping

Description of the system with disks and snapshots under 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.

ImageName 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.

InstanceId string

The instance ID.

Name string

Deprecated: Attribute 'name' has been deprecated from version 1.69.0. Use image_name instead.

Platform string

Specifies the operating system platform of the system disk after you specify a data disk snapshot as the data source of the system disk for creating an image. Valid values: CentOS, Ubuntu, SUSE, OpenSUSE, RedHat, Debian, CoreOS, Aliyun Linux, Windows Server 2003, Windows Server 2008, Windows Server 2012, Windows 7, Default is Others Linux, Customized Linux.

ResourceGroupId string

The ID of the enterprise resource group to which a custom image belongs

SnapshotId string

Specifies a snapshot that is used to create a combined custom image.

Tags map[string]interface{}

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

architecture string

Specifies the architecture of the system disk after you specify a data disk snapshot as the data source of the system disk for creating an image. Valid values: i386 , Default is x86_64.

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.

diskDeviceMappings ImageDiskDeviceMapping[]

Description of the system with disks and snapshots under 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.

imageName 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.

instanceId string

The instance ID.

name string

Deprecated: Attribute 'name' has been deprecated from version 1.69.0. Use image_name instead.

platform string

Specifies the operating system platform of the system disk after you specify a data disk snapshot as the data source of the system disk for creating an image. Valid values: CentOS, Ubuntu, SUSE, OpenSUSE, RedHat, Debian, CoreOS, Aliyun Linux, Windows Server 2003, Windows Server 2008, Windows Server 2012, Windows 7, Default is Others Linux, Customized Linux.

resourceGroupId string

The ID of the enterprise resource group to which a custom image belongs

snapshotId string

Specifies a snapshot that is used to create a combined custom image.

tags {[key: string]: any}

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

architecture str

Specifies the architecture of the system disk after you specify a data disk snapshot as the data source of the system disk for creating an image. Valid values: i386 , Default is x86_64.

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.

disk_device_mappings List[ImageDiskDeviceMapping]

Description of the system with disks and snapshots under 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.

instance_id str

The instance ID.

name str

Deprecated: Attribute 'name' has been deprecated from version 1.69.0. Use image_name instead.

platform str

Specifies the operating system platform of the system disk after you specify a data disk snapshot as the data source of the system disk for creating an image. Valid values: CentOS, Ubuntu, SUSE, OpenSUSE, RedHat, Debian, CoreOS, Aliyun Linux, Windows Server 2003, Windows Server 2008, Windows Server 2012, Windows 7, Default is Others Linux, Customized Linux.

resource_group_id str

The ID of the enterprise resource group to which a custom image belongs

snapshot_id str

Specifies a snapshot that is used to create a combined custom image.

tags Dict[str, Any]

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

Supporting Types

ImageDiskDeviceMapping

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Device string

Specifies the name of a disk in the combined custom image. Value range: /dev/xvda to /dev/xvdz.

DiskType string

Specifies the type of a disk in the combined custom image. If you specify this parameter, you can use a data disk snapshot as the data source of a system disk for creating an image. If it is not specified, the disk type is determined by the corresponding snapshot. Valid values: system, data,

Size int

Specifies the size of a disk in the combined custom image, in GiB. Value range: 5 to 2000.

SnapshotId string

Specifies a snapshot that is used to create a combined custom image.

Device string

Specifies the name of a disk in the combined custom image. Value range: /dev/xvda to /dev/xvdz.

DiskType string

Specifies the type of a disk in the combined custom image. If you specify this parameter, you can use a data disk snapshot as the data source of a system disk for creating an image. If it is not specified, the disk type is determined by the corresponding snapshot. Valid values: system, data,

Size int

Specifies the size of a disk in the combined custom image, in GiB. Value range: 5 to 2000.

SnapshotId string

Specifies a snapshot that is used to create a combined custom image.

device string

Specifies the name of a disk in the combined custom image. Value range: /dev/xvda to /dev/xvdz.

diskType string

Specifies the type of a disk in the combined custom image. If you specify this parameter, you can use a data disk snapshot as the data source of a system disk for creating an image. If it is not specified, the disk type is determined by the corresponding snapshot. Valid values: system, data,

size number

Specifies the size of a disk in the combined custom image, in GiB. Value range: 5 to 2000.

snapshotId string

Specifies a snapshot that is used to create a combined custom image.

device str

Specifies the name of a disk in the combined custom image. Value range: /dev/xvda to /dev/xvdz.

disk_type str

Specifies the type of a disk in the combined custom image. If you specify this parameter, you can use a data disk snapshot as the data source of a system disk for creating an image. If it is not specified, the disk type is determined by the corresponding snapshot. Valid values: system, data,

size float

Specifies the size of a disk in the combined custom image, in GiB. Value range: 5 to 2000.

snapshot_id str

Specifies a snapshot that is used to create a combined custom image.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.