1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. ecs
  5. EcsSnapshot
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.ecs.EcsSnapshot

Explore with Pulumi AI

Provides a ECS Snapshot resource.

For information about ECS Snapshot and how to use it, see What is Snapshot.

NOTE: Available since v1.120.0.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const config = new pulumi.Config();
const name = config.get("name") || "terraform-example";
const _default = alicloud.getZones({
    availableDiskCategory: "cloud_essd",
    availableResourceCreation: "VSwitch",
});
const defaultGetImages = alicloud.ecs.getImages({
    mostRecent: true,
    owners: "system",
});
const defaultGetInstanceTypes = Promise.all([_default, defaultGetImages]).then(([_default, defaultGetImages]) => alicloud.ecs.getInstanceTypes({
    availabilityZone: _default.zones?.[0]?.id,
    imageId: defaultGetImages.images?.[0]?.id,
    systemDiskCategory: "cloud_essd",
}));
const defaultNetwork = new alicloud.vpc.Network("default", {
    vpcName: name,
    cidrBlock: "192.168.0.0/16",
});
const defaultSwitch = new alicloud.vpc.Switch("default", {
    vswitchName: name,
    vpcId: defaultNetwork.id,
    cidrBlock: "192.168.192.0/24",
    zoneId: _default.then(_default => _default.zones?.[0]?.id),
});
const defaultSecurityGroup = new alicloud.ecs.SecurityGroup("default", {
    securityGroupName: name,
    vpcId: defaultNetwork.id,
});
const defaultInstance = new alicloud.ecs.Instance("default", {
    imageId: defaultGetImages.then(defaultGetImages => defaultGetImages.images?.[0]?.id),
    instanceType: defaultGetInstanceTypes.then(defaultGetInstanceTypes => defaultGetInstanceTypes.instanceTypes?.[0]?.id),
    securityGroups: [defaultSecurityGroup].map(__item => __item.id),
    internetChargeType: "PayByTraffic",
    internetMaxBandwidthOut: 10,
    availabilityZone: defaultGetInstanceTypes.then(defaultGetInstanceTypes => defaultGetInstanceTypes.instanceTypes?.[0]?.availabilityZones?.[0]),
    instanceChargeType: "PostPaid",
    systemDiskCategory: "cloud_essd",
    vswitchId: defaultSwitch.id,
    instanceName: name,
    dataDisks: [{
        category: "cloud_essd",
        size: 20,
    }],
});
const defaultEcsDisk = new alicloud.ecs.EcsDisk("default", {
    diskName: name,
    zoneId: defaultGetInstanceTypes.then(defaultGetInstanceTypes => defaultGetInstanceTypes.instanceTypes?.[0]?.availabilityZones?.[0]),
    category: "cloud_essd",
    size: 500,
});
const defaultEcsDiskAttachment = new alicloud.ecs.EcsDiskAttachment("default", {
    diskId: defaultEcsDisk.id,
    instanceId: defaultInstance.id,
});
const defaultEcsSnapshot = new alicloud.ecs.EcsSnapshot("default", {
    diskId: defaultEcsDiskAttachment.diskId,
    category: "standard",
    retentionDays: 20,
});
Copy
import pulumi
import pulumi_alicloud as alicloud

config = pulumi.Config()
name = config.get("name")
if name is None:
    name = "terraform-example"
default = alicloud.get_zones(available_disk_category="cloud_essd",
    available_resource_creation="VSwitch")
default_get_images = alicloud.ecs.get_images(most_recent=True,
    owners="system")
default_get_instance_types = alicloud.ecs.get_instance_types(availability_zone=default.zones[0].id,
    image_id=default_get_images.images[0].id,
    system_disk_category="cloud_essd")
default_network = alicloud.vpc.Network("default",
    vpc_name=name,
    cidr_block="192.168.0.0/16")
default_switch = alicloud.vpc.Switch("default",
    vswitch_name=name,
    vpc_id=default_network.id,
    cidr_block="192.168.192.0/24",
    zone_id=default.zones[0].id)
default_security_group = alicloud.ecs.SecurityGroup("default",
    security_group_name=name,
    vpc_id=default_network.id)
default_instance = alicloud.ecs.Instance("default",
    image_id=default_get_images.images[0].id,
    instance_type=default_get_instance_types.instance_types[0].id,
    security_groups=[__item.id for __item in [default_security_group]],
    internet_charge_type="PayByTraffic",
    internet_max_bandwidth_out=10,
    availability_zone=default_get_instance_types.instance_types[0].availability_zones[0],
    instance_charge_type="PostPaid",
    system_disk_category="cloud_essd",
    vswitch_id=default_switch.id,
    instance_name=name,
    data_disks=[{
        "category": "cloud_essd",
        "size": 20,
    }])
default_ecs_disk = alicloud.ecs.EcsDisk("default",
    disk_name=name,
    zone_id=default_get_instance_types.instance_types[0].availability_zones[0],
    category="cloud_essd",
    size=500)
default_ecs_disk_attachment = alicloud.ecs.EcsDiskAttachment("default",
    disk_id=default_ecs_disk.id,
    instance_id=default_instance.id)
default_ecs_snapshot = alicloud.ecs.EcsSnapshot("default",
    disk_id=default_ecs_disk_attachment.disk_id,
    category="standard",
    retention_days=20)
Copy
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
name := "terraform-example";
if param := cfg.Get("name"); param != ""{
name = param
}
_default, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
AvailableDiskCategory: pulumi.StringRef("cloud_essd"),
AvailableResourceCreation: pulumi.StringRef("VSwitch"),
}, nil);
if err != nil {
return err
}
defaultGetImages, err := ecs.GetImages(ctx, &ecs.GetImagesArgs{
MostRecent: pulumi.BoolRef(true),
Owners: pulumi.StringRef("system"),
}, nil);
if err != nil {
return err
}
defaultGetInstanceTypes, err := ecs.GetInstanceTypes(ctx, &ecs.GetInstanceTypesArgs{
AvailabilityZone: pulumi.StringRef(_default.Zones[0].Id),
ImageId: pulumi.StringRef(defaultGetImages.Images[0].Id),
SystemDiskCategory: pulumi.StringRef("cloud_essd"),
}, nil);
if err != nil {
return err
}
defaultNetwork, err := vpc.NewNetwork(ctx, "default", &vpc.NetworkArgs{
VpcName: pulumi.String(name),
CidrBlock: pulumi.String("192.168.0.0/16"),
})
if err != nil {
return err
}
defaultSwitch, err := vpc.NewSwitch(ctx, "default", &vpc.SwitchArgs{
VswitchName: pulumi.String(name),
VpcId: defaultNetwork.ID(),
CidrBlock: pulumi.String("192.168.192.0/24"),
ZoneId: pulumi.String(_default.Zones[0].Id),
})
if err != nil {
return err
}
defaultSecurityGroup, err := ecs.NewSecurityGroup(ctx, "default", &ecs.SecurityGroupArgs{
SecurityGroupName: pulumi.String(name),
VpcId: defaultNetwork.ID(),
})
if err != nil {
return err
}
var splat0 pulumi.StringArray
for _, val0 := range %!v(PANIC=Format method: fatal: An assertion has failed: tok: ) {
splat0 = append(splat0, val0.ID())
}
defaultInstance, err := ecs.NewInstance(ctx, "default", &ecs.InstanceArgs{
ImageId: pulumi.String(defaultGetImages.Images[0].Id),
InstanceType: pulumi.String(defaultGetInstanceTypes.InstanceTypes[0].Id),
SecurityGroups: splat0,
InternetChargeType: pulumi.String("PayByTraffic"),
InternetMaxBandwidthOut: pulumi.Int(10),
AvailabilityZone: pulumi.String(defaultGetInstanceTypes.InstanceTypes[0].AvailabilityZones[0]),
InstanceChargeType: pulumi.String("PostPaid"),
SystemDiskCategory: pulumi.String("cloud_essd"),
VswitchId: defaultSwitch.ID(),
InstanceName: pulumi.String(name),
DataDisks: ecs.InstanceDataDiskArray{
&ecs.InstanceDataDiskArgs{
Category: pulumi.String("cloud_essd"),
Size: pulumi.Int(20),
},
},
})
if err != nil {
return err
}
defaultEcsDisk, err := ecs.NewEcsDisk(ctx, "default", &ecs.EcsDiskArgs{
DiskName: pulumi.String(name),
ZoneId: pulumi.String(defaultGetInstanceTypes.InstanceTypes[0].AvailabilityZones[0]),
Category: pulumi.String("cloud_essd"),
Size: pulumi.Int(500),
})
if err != nil {
return err
}
defaultEcsDiskAttachment, err := ecs.NewEcsDiskAttachment(ctx, "default", &ecs.EcsDiskAttachmentArgs{
DiskId: defaultEcsDisk.ID(),
InstanceId: defaultInstance.ID(),
})
if err != nil {
return err
}
_, err = ecs.NewEcsSnapshot(ctx, "default", &ecs.EcsSnapshotArgs{
DiskId: defaultEcsDiskAttachment.DiskId,
Category: pulumi.String("standard"),
RetentionDays: pulumi.Int(20),
})
if err != nil {
return err
}
return nil
})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var name = config.Get("name") ?? "terraform-example";
    var @default = AliCloud.GetZones.Invoke(new()
    {
        AvailableDiskCategory = "cloud_essd",
        AvailableResourceCreation = "VSwitch",
    });

    var defaultGetImages = AliCloud.Ecs.GetImages.Invoke(new()
    {
        MostRecent = true,
        Owners = "system",
    });

    var defaultGetInstanceTypes = AliCloud.Ecs.GetInstanceTypes.Invoke(new()
    {
        AvailabilityZone = @default.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
        ImageId = defaultGetImages.Apply(getImagesResult => getImagesResult.Images[0]?.Id),
        SystemDiskCategory = "cloud_essd",
    });

    var defaultNetwork = new AliCloud.Vpc.Network("default", new()
    {
        VpcName = name,
        CidrBlock = "192.168.0.0/16",
    });

    var defaultSwitch = new AliCloud.Vpc.Switch("default", new()
    {
        VswitchName = name,
        VpcId = defaultNetwork.Id,
        CidrBlock = "192.168.192.0/24",
        ZoneId = @default.Apply(@default => @default.Apply(getZonesResult => getZonesResult.Zones[0]?.Id)),
    });

    var defaultSecurityGroup = new AliCloud.Ecs.SecurityGroup("default", new()
    {
        SecurityGroupName = name,
        VpcId = defaultNetwork.Id,
    });

    var defaultInstance = new AliCloud.Ecs.Instance("default", new()
    {
        ImageId = defaultGetImages.Apply(getImagesResult => getImagesResult.Images[0]?.Id),
        InstanceType = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.InstanceTypes[0]?.Id),
        SecurityGroups = new[]
        {
            defaultSecurityGroup,
        }.Select(__item => __item.Id).ToList(),
        InternetChargeType = "PayByTraffic",
        InternetMaxBandwidthOut = 10,
        AvailabilityZone = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.InstanceTypes[0]?.AvailabilityZones[0]),
        InstanceChargeType = "PostPaid",
        SystemDiskCategory = "cloud_essd",
        VswitchId = defaultSwitch.Id,
        InstanceName = name,
        DataDisks = new[]
        {
            new AliCloud.Ecs.Inputs.InstanceDataDiskArgs
            {
                Category = "cloud_essd",
                Size = 20,
            },
        },
    });

    var defaultEcsDisk = new AliCloud.Ecs.EcsDisk("default", new()
    {
        DiskName = name,
        ZoneId = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.InstanceTypes[0]?.AvailabilityZones[0]),
        Category = "cloud_essd",
        Size = 500,
    });

    var defaultEcsDiskAttachment = new AliCloud.Ecs.EcsDiskAttachment("default", new()
    {
        DiskId = defaultEcsDisk.Id,
        InstanceId = defaultInstance.Id,
    });

    var defaultEcsSnapshot = new AliCloud.Ecs.EcsSnapshot("default", new()
    {
        DiskId = defaultEcsDiskAttachment.DiskId,
        Category = "standard",
        RetentionDays = 20,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.AlicloudFunctions;
import com.pulumi.alicloud.inputs.GetZonesArgs;
import com.pulumi.alicloud.ecs.EcsFunctions;
import com.pulumi.alicloud.ecs.inputs.GetImagesArgs;
import com.pulumi.alicloud.ecs.inputs.GetInstanceTypesArgs;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
import com.pulumi.alicloud.ecs.SecurityGroup;
import com.pulumi.alicloud.ecs.SecurityGroupArgs;
import com.pulumi.alicloud.ecs.Instance;
import com.pulumi.alicloud.ecs.InstanceArgs;
import com.pulumi.alicloud.ecs.inputs.InstanceDataDiskArgs;
import com.pulumi.alicloud.ecs.EcsDisk;
import com.pulumi.alicloud.ecs.EcsDiskArgs;
import com.pulumi.alicloud.ecs.EcsDiskAttachment;
import com.pulumi.alicloud.ecs.EcsDiskAttachmentArgs;
import com.pulumi.alicloud.ecs.EcsSnapshot;
import com.pulumi.alicloud.ecs.EcsSnapshotArgs;
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) {
        final var config = ctx.config();
        final var name = config.get("name").orElse("terraform-example");
        final var default = AlicloudFunctions.getZones(GetZonesArgs.builder()
            .availableDiskCategory("cloud_essd")
            .availableResourceCreation("VSwitch")
            .build());

        final var defaultGetImages = EcsFunctions.getImages(GetImagesArgs.builder()
            .mostRecent(true)
            .owners("system")
            .build());

        final var defaultGetInstanceTypes = EcsFunctions.getInstanceTypes(GetInstanceTypesArgs.builder()
            .availabilityZone(default_.zones()[0].id())
            .imageId(defaultGetImages.applyValue(getImagesResult -> getImagesResult.images()[0].id()))
            .systemDiskCategory("cloud_essd")
            .build());

        var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
            .vpcName(name)
            .cidrBlock("192.168.0.0/16")
            .build());

        var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
            .vswitchName(name)
            .vpcId(defaultNetwork.id())
            .cidrBlock("192.168.192.0/24")
            .zoneId(default_.zones()[0].id())
            .build());

        var defaultSecurityGroup = new SecurityGroup("defaultSecurityGroup", SecurityGroupArgs.builder()
            .securityGroupName(name)
            .vpcId(defaultNetwork.id())
            .build());

        var defaultInstance = new Instance("defaultInstance", InstanceArgs.builder()
            .imageId(defaultGetImages.applyValue(getImagesResult -> getImagesResult.images()[0].id()))
            .instanceType(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.instanceTypes()[0].id()))
            .securityGroups(defaultSecurityGroup.stream().map(element -> element.id()).collect(toList()))
            .internetChargeType("PayByTraffic")
            .internetMaxBandwidthOut("10")
            .availabilityZone(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.instanceTypes()[0].availabilityZones()[0]))
            .instanceChargeType("PostPaid")
            .systemDiskCategory("cloud_essd")
            .vswitchId(defaultSwitch.id())
            .instanceName(name)
            .dataDisks(InstanceDataDiskArgs.builder()
                .category("cloud_essd")
                .size(20)
                .build())
            .build());

        var defaultEcsDisk = new EcsDisk("defaultEcsDisk", EcsDiskArgs.builder()
            .diskName(name)
            .zoneId(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.instanceTypes()[0].availabilityZones()[0]))
            .category("cloud_essd")
            .size(500)
            .build());

        var defaultEcsDiskAttachment = new EcsDiskAttachment("defaultEcsDiskAttachment", EcsDiskAttachmentArgs.builder()
            .diskId(defaultEcsDisk.id())
            .instanceId(defaultInstance.id())
            .build());

        var defaultEcsSnapshot = new EcsSnapshot("defaultEcsSnapshot", EcsSnapshotArgs.builder()
            .diskId(defaultEcsDiskAttachment.diskId())
            .category("standard")
            .retentionDays(20)
            .build());

    }
}
Copy
Coming soon!

Create EcsSnapshot Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new EcsSnapshot(name: string, args: EcsSnapshotArgs, opts?: CustomResourceOptions);
@overload
def EcsSnapshot(resource_name: str,
                args: EcsSnapshotArgs,
                opts: Optional[ResourceOptions] = None)

@overload
def EcsSnapshot(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                disk_id: Optional[str] = None,
                category: Optional[str] = None,
                description: Optional[str] = None,
                force: Optional[bool] = None,
                instant_access: Optional[bool] = None,
                instant_access_retention_days: Optional[int] = None,
                name: Optional[str] = None,
                resource_group_id: Optional[str] = None,
                retention_days: Optional[int] = None,
                snapshot_name: Optional[str] = None,
                tags: Optional[Mapping[str, str]] = None)
func NewEcsSnapshot(ctx *Context, name string, args EcsSnapshotArgs, opts ...ResourceOption) (*EcsSnapshot, error)
public EcsSnapshot(string name, EcsSnapshotArgs args, CustomResourceOptions? opts = null)
public EcsSnapshot(String name, EcsSnapshotArgs args)
public EcsSnapshot(String name, EcsSnapshotArgs args, CustomResourceOptions options)
type: alicloud:ecs:EcsSnapshot
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. EcsSnapshotArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. EcsSnapshotArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. EcsSnapshotArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. EcsSnapshotArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. EcsSnapshotArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var ecsSnapshotResource = new AliCloud.Ecs.EcsSnapshot("ecsSnapshotResource", new()
{
    DiskId = "string",
    Category = "string",
    Description = "string",
    Force = false,
    ResourceGroupId = "string",
    RetentionDays = 0,
    SnapshotName = "string",
    Tags = 
    {
        { "string", "string" },
    },
});
Copy
example, err := ecs.NewEcsSnapshot(ctx, "ecsSnapshotResource", &ecs.EcsSnapshotArgs{
	DiskId:          pulumi.String("string"),
	Category:        pulumi.String("string"),
	Description:     pulumi.String("string"),
	Force:           pulumi.Bool(false),
	ResourceGroupId: pulumi.String("string"),
	RetentionDays:   pulumi.Int(0),
	SnapshotName:    pulumi.String("string"),
	Tags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
})
Copy
var ecsSnapshotResource = new EcsSnapshot("ecsSnapshotResource", EcsSnapshotArgs.builder()
    .diskId("string")
    .category("string")
    .description("string")
    .force(false)
    .resourceGroupId("string")
    .retentionDays(0)
    .snapshotName("string")
    .tags(Map.of("string", "string"))
    .build());
Copy
ecs_snapshot_resource = alicloud.ecs.EcsSnapshot("ecsSnapshotResource",
    disk_id="string",
    category="string",
    description="string",
    force=False,
    resource_group_id="string",
    retention_days=0,
    snapshot_name="string",
    tags={
        "string": "string",
    })
Copy
const ecsSnapshotResource = new alicloud.ecs.EcsSnapshot("ecsSnapshotResource", {
    diskId: "string",
    category: "string",
    description: "string",
    force: false,
    resourceGroupId: "string",
    retentionDays: 0,
    snapshotName: "string",
    tags: {
        string: "string",
    },
});
Copy
type: alicloud:ecs:EcsSnapshot
properties:
    category: string
    description: string
    diskId: string
    force: false
    resourceGroupId: string
    retentionDays: 0
    snapshotName: string
    tags:
        string: string
Copy

EcsSnapshot Resource Properties

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

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The EcsSnapshot resource accepts the following input properties:

DiskId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the disk.
Category Changes to this property will trigger replacement. string
The category of the snapshot. Valid values:
Description string
The description of the snapshot.
Force bool
Specifies whether to force delete the snapshot that has been used to create disks. Valid values:
InstantAccess bool
Field instant_access has been deprecated from provider version 1.231.0.

Deprecated: Field instant_access has been deprecated from provider version 1.231.0.

InstantAccessRetentionDays int
Field instant_access_retention_days has been deprecated from provider version 1.231.0.

Deprecated: Field instant_access_retention_days has been deprecated from provider version 1.231.0.

Name string
Field name has been deprecated from provider version 1.120.0. New field snapshot_name instead.

Deprecated: Field name has been deprecated from provider version 1.120.0. New field snapshot_name instead.

ResourceGroupId string
The ID of the resource group. NOTE: From version 1.239.0, resource_group_id can be modified.
RetentionDays int
The retention period of the snapshot. Valid values: 1 to 65536. NOTE: From version 1.231.0, retention_days can be modified.
SnapshotName string
The name of the snapshot.
Tags Dictionary<string, string>
A mapping of tags to assign to the resource.
DiskId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the disk.
Category Changes to this property will trigger replacement. string
The category of the snapshot. Valid values:
Description string
The description of the snapshot.
Force bool
Specifies whether to force delete the snapshot that has been used to create disks. Valid values:
InstantAccess bool
Field instant_access has been deprecated from provider version 1.231.0.

Deprecated: Field instant_access has been deprecated from provider version 1.231.0.

InstantAccessRetentionDays int
Field instant_access_retention_days has been deprecated from provider version 1.231.0.

Deprecated: Field instant_access_retention_days has been deprecated from provider version 1.231.0.

Name string
Field name has been deprecated from provider version 1.120.0. New field snapshot_name instead.

Deprecated: Field name has been deprecated from provider version 1.120.0. New field snapshot_name instead.

ResourceGroupId string
The ID of the resource group. NOTE: From version 1.239.0, resource_group_id can be modified.
RetentionDays int
The retention period of the snapshot. Valid values: 1 to 65536. NOTE: From version 1.231.0, retention_days can be modified.
SnapshotName string
The name of the snapshot.
Tags map[string]string
A mapping of tags to assign to the resource.
diskId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the disk.
category Changes to this property will trigger replacement. String
The category of the snapshot. Valid values:
description String
The description of the snapshot.
force Boolean
Specifies whether to force delete the snapshot that has been used to create disks. Valid values:
instantAccess Boolean
Field instant_access has been deprecated from provider version 1.231.0.

Deprecated: Field instant_access has been deprecated from provider version 1.231.0.

instantAccessRetentionDays Integer
Field instant_access_retention_days has been deprecated from provider version 1.231.0.

Deprecated: Field instant_access_retention_days has been deprecated from provider version 1.231.0.

name String
Field name has been deprecated from provider version 1.120.0. New field snapshot_name instead.

Deprecated: Field name has been deprecated from provider version 1.120.0. New field snapshot_name instead.

resourceGroupId String
The ID of the resource group. NOTE: From version 1.239.0, resource_group_id can be modified.
retentionDays Integer
The retention period of the snapshot. Valid values: 1 to 65536. NOTE: From version 1.231.0, retention_days can be modified.
snapshotName String
The name of the snapshot.
tags Map<String,String>
A mapping of tags to assign to the resource.
diskId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the disk.
category Changes to this property will trigger replacement. string
The category of the snapshot. Valid values:
description string
The description of the snapshot.
force boolean
Specifies whether to force delete the snapshot that has been used to create disks. Valid values:
instantAccess boolean
Field instant_access has been deprecated from provider version 1.231.0.

Deprecated: Field instant_access has been deprecated from provider version 1.231.0.

instantAccessRetentionDays number
Field instant_access_retention_days has been deprecated from provider version 1.231.0.

Deprecated: Field instant_access_retention_days has been deprecated from provider version 1.231.0.

name string
Field name has been deprecated from provider version 1.120.0. New field snapshot_name instead.

Deprecated: Field name has been deprecated from provider version 1.120.0. New field snapshot_name instead.

resourceGroupId string
The ID of the resource group. NOTE: From version 1.239.0, resource_group_id can be modified.
retentionDays number
The retention period of the snapshot. Valid values: 1 to 65536. NOTE: From version 1.231.0, retention_days can be modified.
snapshotName string
The name of the snapshot.
tags {[key: string]: string}
A mapping of tags to assign to the resource.
disk_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the disk.
category Changes to this property will trigger replacement. str
The category of the snapshot. Valid values:
description str
The description of the snapshot.
force bool
Specifies whether to force delete the snapshot that has been used to create disks. Valid values:
instant_access bool
Field instant_access has been deprecated from provider version 1.231.0.

Deprecated: Field instant_access has been deprecated from provider version 1.231.0.

instant_access_retention_days int
Field instant_access_retention_days has been deprecated from provider version 1.231.0.

Deprecated: Field instant_access_retention_days has been deprecated from provider version 1.231.0.

name str
Field name has been deprecated from provider version 1.120.0. New field snapshot_name instead.

Deprecated: Field name has been deprecated from provider version 1.120.0. New field snapshot_name instead.

resource_group_id str
The ID of the resource group. NOTE: From version 1.239.0, resource_group_id can be modified.
retention_days int
The retention period of the snapshot. Valid values: 1 to 65536. NOTE: From version 1.231.0, retention_days can be modified.
snapshot_name str
The name of the snapshot.
tags Mapping[str, str]
A mapping of tags to assign to the resource.
diskId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the disk.
category Changes to this property will trigger replacement. String
The category of the snapshot. Valid values:
description String
The description of the snapshot.
force Boolean
Specifies whether to force delete the snapshot that has been used to create disks. Valid values:
instantAccess Boolean
Field instant_access has been deprecated from provider version 1.231.0.

Deprecated: Field instant_access has been deprecated from provider version 1.231.0.

instantAccessRetentionDays Number
Field instant_access_retention_days has been deprecated from provider version 1.231.0.

Deprecated: Field instant_access_retention_days has been deprecated from provider version 1.231.0.

name String
Field name has been deprecated from provider version 1.120.0. New field snapshot_name instead.

Deprecated: Field name has been deprecated from provider version 1.120.0. New field snapshot_name instead.

resourceGroupId String
The ID of the resource group. NOTE: From version 1.239.0, resource_group_id can be modified.
retentionDays Number
The retention period of the snapshot. Valid values: 1 to 65536. NOTE: From version 1.231.0, retention_days can be modified.
snapshotName String
The name of the snapshot.
tags Map<String>
A mapping of tags to assign to the resource.

Outputs

All input properties are implicitly available as output properties. Additionally, the EcsSnapshot resource produces the following output properties:

CreateTime string
(Available since v1.239.0) The time when the snapshot was created.
Id string
The provider-assigned unique ID for this managed resource.
RegionId string
(Available since v1.239.0) The region ID of the snapshot.
Status string
The status of the Snapshot.
CreateTime string
(Available since v1.239.0) The time when the snapshot was created.
Id string
The provider-assigned unique ID for this managed resource.
RegionId string
(Available since v1.239.0) The region ID of the snapshot.
Status string
The status of the Snapshot.
createTime String
(Available since v1.239.0) The time when the snapshot was created.
id String
The provider-assigned unique ID for this managed resource.
regionId String
(Available since v1.239.0) The region ID of the snapshot.
status String
The status of the Snapshot.
createTime string
(Available since v1.239.0) The time when the snapshot was created.
id string
The provider-assigned unique ID for this managed resource.
regionId string
(Available since v1.239.0) The region ID of the snapshot.
status string
The status of the Snapshot.
create_time str
(Available since v1.239.0) The time when the snapshot was created.
id str
The provider-assigned unique ID for this managed resource.
region_id str
(Available since v1.239.0) The region ID of the snapshot.
status str
The status of the Snapshot.
createTime String
(Available since v1.239.0) The time when the snapshot was created.
id String
The provider-assigned unique ID for this managed resource.
regionId String
(Available since v1.239.0) The region ID of the snapshot.
status String
The status of the Snapshot.

Look up Existing EcsSnapshot Resource

Get an existing EcsSnapshot 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?: EcsSnapshotState, opts?: CustomResourceOptions): EcsSnapshot
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        category: Optional[str] = None,
        create_time: Optional[str] = None,
        description: Optional[str] = None,
        disk_id: Optional[str] = None,
        force: Optional[bool] = None,
        instant_access: Optional[bool] = None,
        instant_access_retention_days: Optional[int] = None,
        name: Optional[str] = None,
        region_id: Optional[str] = None,
        resource_group_id: Optional[str] = None,
        retention_days: Optional[int] = None,
        snapshot_name: Optional[str] = None,
        status: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None) -> EcsSnapshot
func GetEcsSnapshot(ctx *Context, name string, id IDInput, state *EcsSnapshotState, opts ...ResourceOption) (*EcsSnapshot, error)
public static EcsSnapshot Get(string name, Input<string> id, EcsSnapshotState? state, CustomResourceOptions? opts = null)
public static EcsSnapshot get(String name, Output<String> id, EcsSnapshotState state, CustomResourceOptions options)
resources:  _:    type: alicloud:ecs:EcsSnapshot    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Category Changes to this property will trigger replacement. string
The category of the snapshot. Valid values:
CreateTime string
(Available since v1.239.0) The time when the snapshot was created.
Description string
The description of the snapshot.
DiskId Changes to this property will trigger replacement. string
The ID of the disk.
Force bool
Specifies whether to force delete the snapshot that has been used to create disks. Valid values:
InstantAccess bool
Field instant_access has been deprecated from provider version 1.231.0.

Deprecated: Field instant_access has been deprecated from provider version 1.231.0.

InstantAccessRetentionDays int
Field instant_access_retention_days has been deprecated from provider version 1.231.0.

Deprecated: Field instant_access_retention_days has been deprecated from provider version 1.231.0.

Name string
Field name has been deprecated from provider version 1.120.0. New field snapshot_name instead.

Deprecated: Field name has been deprecated from provider version 1.120.0. New field snapshot_name instead.

RegionId string
(Available since v1.239.0) The region ID of the snapshot.
ResourceGroupId string
The ID of the resource group. NOTE: From version 1.239.0, resource_group_id can be modified.
RetentionDays int
The retention period of the snapshot. Valid values: 1 to 65536. NOTE: From version 1.231.0, retention_days can be modified.
SnapshotName string
The name of the snapshot.
Status string
The status of the Snapshot.
Tags Dictionary<string, string>
A mapping of tags to assign to the resource.
Category Changes to this property will trigger replacement. string
The category of the snapshot. Valid values:
CreateTime string
(Available since v1.239.0) The time when the snapshot was created.
Description string
The description of the snapshot.
DiskId Changes to this property will trigger replacement. string
The ID of the disk.
Force bool
Specifies whether to force delete the snapshot that has been used to create disks. Valid values:
InstantAccess bool
Field instant_access has been deprecated from provider version 1.231.0.

Deprecated: Field instant_access has been deprecated from provider version 1.231.0.

InstantAccessRetentionDays int
Field instant_access_retention_days has been deprecated from provider version 1.231.0.

Deprecated: Field instant_access_retention_days has been deprecated from provider version 1.231.0.

Name string
Field name has been deprecated from provider version 1.120.0. New field snapshot_name instead.

Deprecated: Field name has been deprecated from provider version 1.120.0. New field snapshot_name instead.

RegionId string
(Available since v1.239.0) The region ID of the snapshot.
ResourceGroupId string
The ID of the resource group. NOTE: From version 1.239.0, resource_group_id can be modified.
RetentionDays int
The retention period of the snapshot. Valid values: 1 to 65536. NOTE: From version 1.231.0, retention_days can be modified.
SnapshotName string
The name of the snapshot.
Status string
The status of the Snapshot.
Tags map[string]string
A mapping of tags to assign to the resource.
category Changes to this property will trigger replacement. String
The category of the snapshot. Valid values:
createTime String
(Available since v1.239.0) The time when the snapshot was created.
description String
The description of the snapshot.
diskId Changes to this property will trigger replacement. String
The ID of the disk.
force Boolean
Specifies whether to force delete the snapshot that has been used to create disks. Valid values:
instantAccess Boolean
Field instant_access has been deprecated from provider version 1.231.0.

Deprecated: Field instant_access has been deprecated from provider version 1.231.0.

instantAccessRetentionDays Integer
Field instant_access_retention_days has been deprecated from provider version 1.231.0.

Deprecated: Field instant_access_retention_days has been deprecated from provider version 1.231.0.

name String
Field name has been deprecated from provider version 1.120.0. New field snapshot_name instead.

Deprecated: Field name has been deprecated from provider version 1.120.0. New field snapshot_name instead.

regionId String
(Available since v1.239.0) The region ID of the snapshot.
resourceGroupId String
The ID of the resource group. NOTE: From version 1.239.0, resource_group_id can be modified.
retentionDays Integer
The retention period of the snapshot. Valid values: 1 to 65536. NOTE: From version 1.231.0, retention_days can be modified.
snapshotName String
The name of the snapshot.
status String
The status of the Snapshot.
tags Map<String,String>
A mapping of tags to assign to the resource.
category Changes to this property will trigger replacement. string
The category of the snapshot. Valid values:
createTime string
(Available since v1.239.0) The time when the snapshot was created.
description string
The description of the snapshot.
diskId Changes to this property will trigger replacement. string
The ID of the disk.
force boolean
Specifies whether to force delete the snapshot that has been used to create disks. Valid values:
instantAccess boolean
Field instant_access has been deprecated from provider version 1.231.0.

Deprecated: Field instant_access has been deprecated from provider version 1.231.0.

instantAccessRetentionDays number
Field instant_access_retention_days has been deprecated from provider version 1.231.0.

Deprecated: Field instant_access_retention_days has been deprecated from provider version 1.231.0.

name string
Field name has been deprecated from provider version 1.120.0. New field snapshot_name instead.

Deprecated: Field name has been deprecated from provider version 1.120.0. New field snapshot_name instead.

regionId string
(Available since v1.239.0) The region ID of the snapshot.
resourceGroupId string
The ID of the resource group. NOTE: From version 1.239.0, resource_group_id can be modified.
retentionDays number
The retention period of the snapshot. Valid values: 1 to 65536. NOTE: From version 1.231.0, retention_days can be modified.
snapshotName string
The name of the snapshot.
status string
The status of the Snapshot.
tags {[key: string]: string}
A mapping of tags to assign to the resource.
category Changes to this property will trigger replacement. str
The category of the snapshot. Valid values:
create_time str
(Available since v1.239.0) The time when the snapshot was created.
description str
The description of the snapshot.
disk_id Changes to this property will trigger replacement. str
The ID of the disk.
force bool
Specifies whether to force delete the snapshot that has been used to create disks. Valid values:
instant_access bool
Field instant_access has been deprecated from provider version 1.231.0.

Deprecated: Field instant_access has been deprecated from provider version 1.231.0.

instant_access_retention_days int
Field instant_access_retention_days has been deprecated from provider version 1.231.0.

Deprecated: Field instant_access_retention_days has been deprecated from provider version 1.231.0.

name str
Field name has been deprecated from provider version 1.120.0. New field snapshot_name instead.

Deprecated: Field name has been deprecated from provider version 1.120.0. New field snapshot_name instead.

region_id str
(Available since v1.239.0) The region ID of the snapshot.
resource_group_id str
The ID of the resource group. NOTE: From version 1.239.0, resource_group_id can be modified.
retention_days int
The retention period of the snapshot. Valid values: 1 to 65536. NOTE: From version 1.231.0, retention_days can be modified.
snapshot_name str
The name of the snapshot.
status str
The status of the Snapshot.
tags Mapping[str, str]
A mapping of tags to assign to the resource.
category Changes to this property will trigger replacement. String
The category of the snapshot. Valid values:
createTime String
(Available since v1.239.0) The time when the snapshot was created.
description String
The description of the snapshot.
diskId Changes to this property will trigger replacement. String
The ID of the disk.
force Boolean
Specifies whether to force delete the snapshot that has been used to create disks. Valid values:
instantAccess Boolean
Field instant_access has been deprecated from provider version 1.231.0.

Deprecated: Field instant_access has been deprecated from provider version 1.231.0.

instantAccessRetentionDays Number
Field instant_access_retention_days has been deprecated from provider version 1.231.0.

Deprecated: Field instant_access_retention_days has been deprecated from provider version 1.231.0.

name String
Field name has been deprecated from provider version 1.120.0. New field snapshot_name instead.

Deprecated: Field name has been deprecated from provider version 1.120.0. New field snapshot_name instead.

regionId String
(Available since v1.239.0) The region ID of the snapshot.
resourceGroupId String
The ID of the resource group. NOTE: From version 1.239.0, resource_group_id can be modified.
retentionDays Number
The retention period of the snapshot. Valid values: 1 to 65536. NOTE: From version 1.231.0, retention_days can be modified.
snapshotName String
The name of the snapshot.
status String
The status of the Snapshot.
tags Map<String>
A mapping of tags to assign to the resource.

Import

ECS Snapshot can be imported using the id, e.g.

$ pulumi import alicloud:ecs/ecsSnapshot:EcsSnapshot example <id>
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.