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", {
name: 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,
});
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",
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)
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{
Name: 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
})
}
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()
{
Name = 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,
});
});
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()
.name(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());
}
}
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 string
- The unique name of the resource.
- args EcsSnapshotArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args 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 string
- The unique name of the resource.
- args EcsSnapshotArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args EcsSnapshotArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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" },
},
});
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"),
},
})
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());
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",
})
const ecsSnapshotResource = new alicloud.ecs.EcsSnapshot("ecsSnapshotResource", {
diskId: "string",
category: "string",
description: "string",
force: false,
resourceGroupId: "string",
retentionDays: 0,
snapshotName: "string",
tags: {
string: "string",
},
});
type: alicloud:ecs:EcsSnapshot
properties:
category: string
description: string
diskId: string
force: false
resourceGroupId: string
retentionDays: 0
snapshotName: string
tags:
string: string
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:
- Disk
Id string - The ID of the disk.
- Category 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:
- Instant
Access bool - Field
instant_access
has been deprecated from provider version 1.231.0. - Instant
Access intRetention Days - 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 fieldsnapshot_name
instead. - Resource
Group stringId - The ID of the resource group.
- Retention
Days int - The retention period of the snapshot. Valid values:
1
to65536
. NOTE: From version 1.231.0,retention_days
can be modified. - Snapshot
Name string - The name of the snapshot.
- Dictionary<string, string>
- A mapping of tags to assign to the resource.
- Disk
Id string - The ID of the disk.
- Category 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:
- Instant
Access bool - Field
instant_access
has been deprecated from provider version 1.231.0. - Instant
Access intRetention Days - 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 fieldsnapshot_name
instead. - Resource
Group stringId - The ID of the resource group.
- Retention
Days int - The retention period of the snapshot. Valid values:
1
to65536
. NOTE: From version 1.231.0,retention_days
can be modified. - Snapshot
Name string - The name of the snapshot.
- map[string]string
- A mapping of tags to assign to the resource.
- disk
Id String - The ID of the disk.
- category 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:
- instant
Access Boolean - Field
instant_access
has been deprecated from provider version 1.231.0. - instant
Access IntegerRetention Days - 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 fieldsnapshot_name
instead. - resource
Group StringId - The ID of the resource group.
- retention
Days Integer - The retention period of the snapshot. Valid values:
1
to65536
. NOTE: From version 1.231.0,retention_days
can be modified. - snapshot
Name String - The name of the snapshot.
- Map<String,String>
- A mapping of tags to assign to the resource.
- disk
Id string - The ID of the disk.
- category 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:
- instant
Access boolean - Field
instant_access
has been deprecated from provider version 1.231.0. - instant
Access numberRetention Days - 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 fieldsnapshot_name
instead. - resource
Group stringId - The ID of the resource group.
- retention
Days number - The retention period of the snapshot. Valid values:
1
to65536
. NOTE: From version 1.231.0,retention_days
can be modified. - snapshot
Name string - The name of the snapshot.
- {[key: string]: string}
- A mapping of tags to assign to the resource.
- disk_
id str - The ID of the disk.
- category 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. - instant_
access_ intretention_ days - 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 fieldsnapshot_name
instead. - resource_
group_ strid - The ID of the resource group.
- retention_
days int - The retention period of the snapshot. Valid values:
1
to65536
. NOTE: From version 1.231.0,retention_days
can be modified. - snapshot_
name str - The name of the snapshot.
- Mapping[str, str]
- A mapping of tags to assign to the resource.
- disk
Id String - The ID of the disk.
- category 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:
- instant
Access Boolean - Field
instant_access
has been deprecated from provider version 1.231.0. - instant
Access NumberRetention Days - 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 fieldsnapshot_name
instead. - resource
Group StringId - The ID of the resource group.
- retention
Days Number - The retention period of the snapshot. Valid values:
1
to65536
. NOTE: From version 1.231.0,retention_days
can be modified. - snapshot
Name String - The name of the snapshot.
- 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:
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,
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,
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)
Resource lookup is not supported in YAML
- 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.
- 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.
- Category string
- The category of the snapshot. Valid values:
- Description string
- The description of the snapshot.
- Disk
Id string - 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. - Instant
Access intRetention Days - 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 fieldsnapshot_name
instead. - Resource
Group stringId - The ID of the resource group.
- Retention
Days int - The retention period of the snapshot. Valid values:
1
to65536
. NOTE: From version 1.231.0,retention_days
can be modified. - Snapshot
Name string - The name of the snapshot.
- Status string
- The status of the Snapshot.
- Dictionary<string, string>
- A mapping of tags to assign to the resource.
- Category string
- The category of the snapshot. Valid values:
- Description string
- The description of the snapshot.
- Disk
Id string - 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. - Instant
Access intRetention Days - 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 fieldsnapshot_name
instead. - Resource
Group stringId - The ID of the resource group.
- Retention
Days int - The retention period of the snapshot. Valid values:
1
to65536
. NOTE: From version 1.231.0,retention_days
can be modified. - Snapshot
Name string - The name of the snapshot.
- Status string
- The status of the Snapshot.
- map[string]string
- A mapping of tags to assign to the resource.
- category String
- The category of the snapshot. Valid values:
- description String
- The description of the snapshot.
- disk
Id String - The ID of the disk.
- force Boolean
- Specifies whether to force delete the snapshot that has been used to create disks. Valid values:
- instant
Access Boolean - Field
instant_access
has been deprecated from provider version 1.231.0. - instant
Access IntegerRetention Days - 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 fieldsnapshot_name
instead. - resource
Group StringId - The ID of the resource group.
- retention
Days Integer - The retention period of the snapshot. Valid values:
1
to65536
. NOTE: From version 1.231.0,retention_days
can be modified. - snapshot
Name String - The name of the snapshot.
- status String
- The status of the Snapshot.
- Map<String,String>
- A mapping of tags to assign to the resource.
- category string
- The category of the snapshot. Valid values:
- description string
- The description of the snapshot.
- disk
Id string - The ID of the disk.
- force boolean
- Specifies whether to force delete the snapshot that has been used to create disks. Valid values:
- instant
Access boolean - Field
instant_access
has been deprecated from provider version 1.231.0. - instant
Access numberRetention Days - 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 fieldsnapshot_name
instead. - resource
Group stringId - The ID of the resource group.
- retention
Days number - The retention period of the snapshot. Valid values:
1
to65536
. NOTE: From version 1.231.0,retention_days
can be modified. - snapshot
Name string - The name of the snapshot.
- status string
- The status of the Snapshot.
- {[key: string]: string}
- A mapping of tags to assign to the resource.
- category str
- The category of the snapshot. Valid values:
- description str
- The description of the snapshot.
- disk_
id 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. - instant_
access_ intretention_ days - 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 fieldsnapshot_name
instead. - resource_
group_ strid - The ID of the resource group.
- retention_
days int - The retention period of the snapshot. Valid values:
1
to65536
. 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.
- Mapping[str, str]
- A mapping of tags to assign to the resource.
- category String
- The category of the snapshot. Valid values:
- description String
- The description of the snapshot.
- disk
Id String - The ID of the disk.
- force Boolean
- Specifies whether to force delete the snapshot that has been used to create disks. Valid values:
- instant
Access Boolean - Field
instant_access
has been deprecated from provider version 1.231.0. - instant
Access NumberRetention Days - 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 fieldsnapshot_name
instead. - resource
Group StringId - The ID of the resource group.
- retention
Days Number - The retention period of the snapshot. Valid values:
1
to65536
. NOTE: From version 1.231.0,retention_days
can be modified. - snapshot
Name String - The name of the snapshot.
- status String
- The status of the Snapshot.
- 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>
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.