Class 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" },
},
});
}
}
Inherited Members
Namespace: Pulumi.AliCloud.Ecs
Assembly: Pulumi.AliCloud.dll
Syntax
public class Image : CustomResource
Constructors
View SourceImage(String, ImageArgs, CustomResourceOptions)
Create a Image resource with the given unique name, arguments, and options.
Declaration
public Image(string name, ImageArgs args = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| ImageArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceArchitecture
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.
Declaration
public Output<string> Architecture { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
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> |
DiskDeviceMappings
Description of the system with disks and snapshots under the image.
Declaration
public Output<ImmutableArray<ImageDiskDeviceMapping>> DiskDeviceMappings { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<ImageDiskDeviceMapping>> |
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> |
InstanceId
The instance ID.
Declaration
public Output<string> InstanceId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Name
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Platform
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.
Declaration
public Output<string> Platform { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ResourceGroupId
The ID of the enterprise resource group to which a custom image belongs
Declaration
public Output<string> ResourceGroupId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SnapshotId
Specifies a snapshot that is used to create a combined custom image.
Declaration
public Output<string> SnapshotId { 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>, ImageState, CustomResourceOptions)
Get an existing Image resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static Image Get(string name, Input<string> id, ImageState 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. |
| ImageState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| Image |