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 in v1.120.0+.
Example Usage
Basic Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var exampleZones = AliCloud.GetZones.Invoke(new()
{
AvailableResourceCreation = "Instance",
});
var exampleInstanceTypes = AliCloud.Ecs.GetInstanceTypes.Invoke(new()
{
AvailabilityZone = exampleZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
CpuCoreCount = 1,
MemorySize = 2,
});
var exampleNetwork = new AliCloud.Vpc.Network("exampleNetwork", new()
{
VpcName = "terraform-example",
CidrBlock = "172.17.3.0/24",
});
var exampleSwitch = new AliCloud.Vpc.Switch("exampleSwitch", new()
{
VswitchName = "terraform-example",
CidrBlock = "172.17.3.0/24",
VpcId = exampleNetwork.Id,
ZoneId = exampleZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
});
var exampleSecurityGroup = new AliCloud.Ecs.SecurityGroup("exampleSecurityGroup", new()
{
Description = "New security group",
VpcId = exampleNetwork.Id,
});
var exampleEcsDisk = new AliCloud.Ecs.EcsDisk("exampleEcsDisk", new()
{
DiskName = "terraform-example",
ZoneId = exampleInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.InstanceTypes[0]?.AvailabilityZones[0]),
Category = "cloud_efficiency",
Size = 20,
});
var exampleImages = AliCloud.Ecs.GetImages.Invoke(new()
{
NameRegex = "^ubuntu_[0-9]+_[0-9]+_x64*",
Owners = "system",
});
var exampleInstance = new AliCloud.Ecs.Instance("exampleInstance", new()
{
AvailabilityZone = exampleZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
InstanceName = "terraform-example",
ImageId = exampleImages.Apply(getImagesResult => getImagesResult.Images[0]?.Id),
InstanceType = exampleInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.InstanceTypes[0]?.Id),
SecurityGroups = new[]
{
exampleSecurityGroup.Id,
},
VswitchId = exampleSwitch.Id,
});
var exampleEcsDiskAttachment = new AliCloud.Ecs.EcsDiskAttachment("exampleEcsDiskAttachment", new()
{
DiskId = exampleEcsDisk.Id,
InstanceId = exampleInstance.Id,
});
var exampleEcsSnapshot = new AliCloud.Ecs.EcsSnapshot("exampleEcsSnapshot", new()
{
Category = "standard",
Description = "terraform-example",
DiskId = exampleEcsDisk.Id,
RetentionDays = 20,
SnapshotName = "terraform-example",
Tags =
{
{ "Created", "TF" },
{ "For", "example" },
},
});
});
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"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleZones, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
AvailableResourceCreation: pulumi.StringRef("Instance"),
}, nil)
if err != nil {
return err
}
exampleInstanceTypes, err := ecs.GetInstanceTypes(ctx, &ecs.GetInstanceTypesArgs{
AvailabilityZone: pulumi.StringRef(exampleZones.Zones[0].Id),
CpuCoreCount: pulumi.IntRef(1),
MemorySize: pulumi.Float64Ref(2),
}, nil)
if err != nil {
return err
}
exampleNetwork, err := vpc.NewNetwork(ctx, "exampleNetwork", &vpc.NetworkArgs{
VpcName: pulumi.String("terraform-example"),
CidrBlock: pulumi.String("172.17.3.0/24"),
})
if err != nil {
return err
}
exampleSwitch, err := vpc.NewSwitch(ctx, "exampleSwitch", &vpc.SwitchArgs{
VswitchName: pulumi.String("terraform-example"),
CidrBlock: pulumi.String("172.17.3.0/24"),
VpcId: exampleNetwork.ID(),
ZoneId: *pulumi.String(exampleZones.Zones[0].Id),
})
if err != nil {
return err
}
exampleSecurityGroup, err := ecs.NewSecurityGroup(ctx, "exampleSecurityGroup", &ecs.SecurityGroupArgs{
Description: pulumi.String("New security group"),
VpcId: exampleNetwork.ID(),
})
if err != nil {
return err
}
exampleEcsDisk, err := ecs.NewEcsDisk(ctx, "exampleEcsDisk", &ecs.EcsDiskArgs{
DiskName: pulumi.String("terraform-example"),
ZoneId: *pulumi.String(exampleInstanceTypes.InstanceTypes[0].AvailabilityZones[0]),
Category: pulumi.String("cloud_efficiency"),
Size: pulumi.Int(20),
})
if err != nil {
return err
}
exampleImages, err := ecs.GetImages(ctx, &ecs.GetImagesArgs{
NameRegex: pulumi.StringRef("^ubuntu_[0-9]+_[0-9]+_x64*"),
Owners: pulumi.StringRef("system"),
}, nil)
if err != nil {
return err
}
exampleInstance, err := ecs.NewInstance(ctx, "exampleInstance", &ecs.InstanceArgs{
AvailabilityZone: *pulumi.String(exampleZones.Zones[0].Id),
InstanceName: pulumi.String("terraform-example"),
ImageId: *pulumi.String(exampleImages.Images[0].Id),
InstanceType: *pulumi.String(exampleInstanceTypes.InstanceTypes[0].Id),
SecurityGroups: pulumi.StringArray{
exampleSecurityGroup.ID(),
},
VswitchId: exampleSwitch.ID(),
})
if err != nil {
return err
}
_, err = ecs.NewEcsDiskAttachment(ctx, "exampleEcsDiskAttachment", &ecs.EcsDiskAttachmentArgs{
DiskId: exampleEcsDisk.ID(),
InstanceId: exampleInstance.ID(),
})
if err != nil {
return err
}
_, err = ecs.NewEcsSnapshot(ctx, "exampleEcsSnapshot", &ecs.EcsSnapshotArgs{
Category: pulumi.String("standard"),
Description: pulumi.String("terraform-example"),
DiskId: exampleEcsDisk.ID(),
RetentionDays: pulumi.Int(20),
SnapshotName: pulumi.String("terraform-example"),
Tags: pulumi.AnyMap{
"Created": pulumi.Any("TF"),
"For": pulumi.Any("example"),
},
})
if err != nil {
return err
}
return nil
})
}
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.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.EcsDisk;
import com.pulumi.alicloud.ecs.EcsDiskArgs;
import com.pulumi.alicloud.ecs.inputs.GetImagesArgs;
import com.pulumi.alicloud.ecs.Instance;
import com.pulumi.alicloud.ecs.InstanceArgs;
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 exampleZones = AlicloudFunctions.getZones(GetZonesArgs.builder()
.availableResourceCreation("Instance")
.build());
final var exampleInstanceTypes = EcsFunctions.getInstanceTypes(GetInstanceTypesArgs.builder()
.availabilityZone(exampleZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.cpuCoreCount(1)
.memorySize(2)
.build());
var exampleNetwork = new Network("exampleNetwork", NetworkArgs.builder()
.vpcName("terraform-example")
.cidrBlock("172.17.3.0/24")
.build());
var exampleSwitch = new Switch("exampleSwitch", SwitchArgs.builder()
.vswitchName("terraform-example")
.cidrBlock("172.17.3.0/24")
.vpcId(exampleNetwork.id())
.zoneId(exampleZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.build());
var exampleSecurityGroup = new SecurityGroup("exampleSecurityGroup", SecurityGroupArgs.builder()
.description("New security group")
.vpcId(exampleNetwork.id())
.build());
var exampleEcsDisk = new EcsDisk("exampleEcsDisk", EcsDiskArgs.builder()
.diskName("terraform-example")
.zoneId(exampleInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.instanceTypes()[0].availabilityZones()[0]))
.category("cloud_efficiency")
.size("20")
.build());
final var exampleImages = EcsFunctions.getImages(GetImagesArgs.builder()
.nameRegex("^ubuntu_[0-9]+_[0-9]+_x64*")
.owners("system")
.build());
var exampleInstance = new Instance("exampleInstance", InstanceArgs.builder()
.availabilityZone(exampleZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.instanceName("terraform-example")
.imageId(exampleImages.applyValue(getImagesResult -> getImagesResult.images()[0].id()))
.instanceType(exampleInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.instanceTypes()[0].id()))
.securityGroups(exampleSecurityGroup.id())
.vswitchId(exampleSwitch.id())
.build());
var exampleEcsDiskAttachment = new EcsDiskAttachment("exampleEcsDiskAttachment", EcsDiskAttachmentArgs.builder()
.diskId(exampleEcsDisk.id())
.instanceId(exampleInstance.id())
.build());
var exampleEcsSnapshot = new EcsSnapshot("exampleEcsSnapshot", EcsSnapshotArgs.builder()
.category("standard")
.description("terraform-example")
.diskId(exampleEcsDisk.id())
.retentionDays("20")
.snapshotName("terraform-example")
.tags(Map.ofEntries(
Map.entry("Created", "TF"),
Map.entry("For", "example")
))
.build());
}
}
import pulumi
import pulumi_alicloud as alicloud
example_zones = alicloud.get_zones(available_resource_creation="Instance")
example_instance_types = alicloud.ecs.get_instance_types(availability_zone=example_zones.zones[0].id,
cpu_core_count=1,
memory_size=2)
example_network = alicloud.vpc.Network("exampleNetwork",
vpc_name="terraform-example",
cidr_block="172.17.3.0/24")
example_switch = alicloud.vpc.Switch("exampleSwitch",
vswitch_name="terraform-example",
cidr_block="172.17.3.0/24",
vpc_id=example_network.id,
zone_id=example_zones.zones[0].id)
example_security_group = alicloud.ecs.SecurityGroup("exampleSecurityGroup",
description="New security group",
vpc_id=example_network.id)
example_ecs_disk = alicloud.ecs.EcsDisk("exampleEcsDisk",
disk_name="terraform-example",
zone_id=example_instance_types.instance_types[0].availability_zones[0],
category="cloud_efficiency",
size=20)
example_images = alicloud.ecs.get_images(name_regex="^ubuntu_[0-9]+_[0-9]+_x64*",
owners="system")
example_instance = alicloud.ecs.Instance("exampleInstance",
availability_zone=example_zones.zones[0].id,
instance_name="terraform-example",
image_id=example_images.images[0].id,
instance_type=example_instance_types.instance_types[0].id,
security_groups=[example_security_group.id],
vswitch_id=example_switch.id)
example_ecs_disk_attachment = alicloud.ecs.EcsDiskAttachment("exampleEcsDiskAttachment",
disk_id=example_ecs_disk.id,
instance_id=example_instance.id)
example_ecs_snapshot = alicloud.ecs.EcsSnapshot("exampleEcsSnapshot",
category="standard",
description="terraform-example",
disk_id=example_ecs_disk.id,
retention_days=20,
snapshot_name="terraform-example",
tags={
"Created": "TF",
"For": "example",
})
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const exampleZones = alicloud.getZones({
availableResourceCreation: "Instance",
});
const exampleInstanceTypes = exampleZones.then(exampleZones => alicloud.ecs.getInstanceTypes({
availabilityZone: exampleZones.zones?.[0]?.id,
cpuCoreCount: 1,
memorySize: 2,
}));
const exampleNetwork = new alicloud.vpc.Network("exampleNetwork", {
vpcName: "terraform-example",
cidrBlock: "172.17.3.0/24",
});
const exampleSwitch = new alicloud.vpc.Switch("exampleSwitch", {
vswitchName: "terraform-example",
cidrBlock: "172.17.3.0/24",
vpcId: exampleNetwork.id,
zoneId: exampleZones.then(exampleZones => exampleZones.zones?.[0]?.id),
});
const exampleSecurityGroup = new alicloud.ecs.SecurityGroup("exampleSecurityGroup", {
description: "New security group",
vpcId: exampleNetwork.id,
});
const exampleEcsDisk = new alicloud.ecs.EcsDisk("exampleEcsDisk", {
diskName: "terraform-example",
zoneId: exampleInstanceTypes.then(exampleInstanceTypes => exampleInstanceTypes.instanceTypes?.[0]?.availabilityZones?.[0]),
category: "cloud_efficiency",
size: 20,
});
const exampleImages = alicloud.ecs.getImages({
nameRegex: "^ubuntu_[0-9]+_[0-9]+_x64*",
owners: "system",
});
const exampleInstance = new alicloud.ecs.Instance("exampleInstance", {
availabilityZone: exampleZones.then(exampleZones => exampleZones.zones?.[0]?.id),
instanceName: "terraform-example",
imageId: exampleImages.then(exampleImages => exampleImages.images?.[0]?.id),
instanceType: exampleInstanceTypes.then(exampleInstanceTypes => exampleInstanceTypes.instanceTypes?.[0]?.id),
securityGroups: [exampleSecurityGroup.id],
vswitchId: exampleSwitch.id,
});
const exampleEcsDiskAttachment = new alicloud.ecs.EcsDiskAttachment("exampleEcsDiskAttachment", {
diskId: exampleEcsDisk.id,
instanceId: exampleInstance.id,
});
const exampleEcsSnapshot = new alicloud.ecs.EcsSnapshot("exampleEcsSnapshot", {
category: "standard",
description: "terraform-example",
diskId: exampleEcsDisk.id,
retentionDays: 20,
snapshotName: "terraform-example",
tags: {
Created: "TF",
For: "example",
},
});
resources:
exampleNetwork:
type: alicloud:vpc:Network
properties:
vpcName: terraform-example
cidrBlock: 172.17.3.0/24
exampleSwitch:
type: alicloud:vpc:Switch
properties:
vswitchName: terraform-example
cidrBlock: 172.17.3.0/24
vpcId: ${exampleNetwork.id}
zoneId: ${exampleZones.zones[0].id}
exampleSecurityGroup:
type: alicloud:ecs:SecurityGroup
properties:
description: New security group
vpcId: ${exampleNetwork.id}
exampleEcsDisk:
type: alicloud:ecs:EcsDisk
properties:
diskName: terraform-example
zoneId: ${exampleInstanceTypes.instanceTypes[0].availabilityZones[0]}
category: cloud_efficiency
size: '20'
exampleInstance:
type: alicloud:ecs:Instance
properties:
availabilityZone: ${exampleZones.zones[0].id}
instanceName: terraform-example
imageId: ${exampleImages.images[0].id}
instanceType: ${exampleInstanceTypes.instanceTypes[0].id}
securityGroups:
- ${exampleSecurityGroup.id}
vswitchId: ${exampleSwitch.id}
exampleEcsDiskAttachment:
type: alicloud:ecs:EcsDiskAttachment
properties:
diskId: ${exampleEcsDisk.id}
instanceId: ${exampleInstance.id}
exampleEcsSnapshot:
type: alicloud:ecs:EcsSnapshot
properties:
category: standard
description: terraform-example
diskId: ${exampleEcsDisk.id}
retentionDays: '20'
snapshotName: terraform-example
tags:
Created: TF
For: example
variables:
exampleZones:
fn::invoke:
Function: alicloud:getZones
Arguments:
availableResourceCreation: Instance
exampleInstanceTypes:
fn::invoke:
Function: alicloud:ecs:getInstanceTypes
Arguments:
availabilityZone: ${exampleZones.zones[0].id}
cpuCoreCount: 1
memorySize: 2
exampleImages:
fn::invoke:
Function: alicloud:ecs:getImages
Arguments:
nameRegex: ^ubuntu_[0-9]+_[0-9]+_x64*
owners: system
Create EcsSnapshot Resource
new EcsSnapshot(name: string, args: EcsSnapshotArgs, opts?: CustomResourceOptions);
@overload
def EcsSnapshot(resource_name: 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,
tags: Optional[Mapping[str, Any]] = None)
@overload
def EcsSnapshot(resource_name: str,
args: EcsSnapshotArgs,
opts: Optional[ResourceOptions] = 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.
- 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.
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
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:
standard
andflash
.- Description string
The description of the snapshot.
- Force bool
Specifies whether to forcibly delete the snapshot that has been used to create disks.
- Instant
Access bool Specifies whether to enable the instant access feature.
- Instant
Access intRetention Days Specifies the retention period of the instant access feature. After the retention period ends, the snapshot is automatically released.
- Name string
Field
name
has been deprecated from provider version 1.120.0. New fieldsnapshot_name
instead.Field 'name' has been deprecated from provider version 1.120.0. New field 'snapshot_name' instead.
- Resource
Group stringId The resource group id.
- Retention
Days int The retention period of the snapshot.
- Snapshot
Name string The name of the snapshot.
- Dictionary<string, object>
A mapping of tags to assign to the snapshot.
NOTE: If
force
is true, After an snapshot is deleted, the disks created from this snapshot cannot be re-initialized.
- Disk
Id string The ID of the disk.
- Category string
The category of the snapshot. Valid Values:
standard
andflash
.- Description string
The description of the snapshot.
- Force bool
Specifies whether to forcibly delete the snapshot that has been used to create disks.
- Instant
Access bool Specifies whether to enable the instant access feature.
- Instant
Access intRetention Days Specifies the retention period of the instant access feature. After the retention period ends, the snapshot is automatically released.
- Name string
Field
name
has been deprecated from provider version 1.120.0. New fieldsnapshot_name
instead.Field 'name' has been deprecated from provider version 1.120.0. New field 'snapshot_name' instead.
- Resource
Group stringId The resource group id.
- Retention
Days int The retention period of the snapshot.
- Snapshot
Name string The name of the snapshot.
- map[string]interface{}
A mapping of tags to assign to the snapshot.
NOTE: If
force
is true, After an snapshot is deleted, the disks created from this snapshot cannot be re-initialized.
- disk
Id String The ID of the disk.
- category String
The category of the snapshot. Valid Values:
standard
andflash
.- description String
The description of the snapshot.
- force Boolean
Specifies whether to forcibly delete the snapshot that has been used to create disks.
- instant
Access Boolean Specifies whether to enable the instant access feature.
- instant
Access IntegerRetention Days Specifies the retention period of the instant access feature. After the retention period ends, the snapshot is automatically released.
- name String
Field
name
has been deprecated from provider version 1.120.0. New fieldsnapshot_name
instead.Field 'name' has been deprecated from provider version 1.120.0. New field 'snapshot_name' instead.
- resource
Group StringId The resource group id.
- retention
Days Integer The retention period of the snapshot.
- snapshot
Name String The name of the snapshot.
- Map<String,Object>
A mapping of tags to assign to the snapshot.
NOTE: If
force
is true, After an snapshot is deleted, the disks created from this snapshot cannot be re-initialized.
- disk
Id string The ID of the disk.
- category string
The category of the snapshot. Valid Values:
standard
andflash
.- description string
The description of the snapshot.
- force boolean
Specifies whether to forcibly delete the snapshot that has been used to create disks.
- instant
Access boolean Specifies whether to enable the instant access feature.
- instant
Access numberRetention Days Specifies the retention period of the instant access feature. After the retention period ends, the snapshot is automatically released.
- name string
Field
name
has been deprecated from provider version 1.120.0. New fieldsnapshot_name
instead.Field 'name' has been deprecated from provider version 1.120.0. New field 'snapshot_name' instead.
- resource
Group stringId The resource group id.
- retention
Days number The retention period of the snapshot.
- snapshot
Name string The name of the snapshot.
- {[key: string]: any}
A mapping of tags to assign to the snapshot.
NOTE: If
force
is true, After an snapshot is deleted, the disks created from this snapshot cannot be re-initialized.
- disk_
id str The ID of the disk.
- category str
The category of the snapshot. Valid Values:
standard
andflash
.- description str
The description of the snapshot.
- force bool
Specifies whether to forcibly delete the snapshot that has been used to create disks.
- instant_
access bool Specifies whether to enable the instant access feature.
- instant_
access_ intretention_ days Specifies the retention period of the instant access feature. After the retention period ends, the snapshot is automatically released.
- name str
Field
name
has been deprecated from provider version 1.120.0. New fieldsnapshot_name
instead.Field 'name' has been deprecated from provider version 1.120.0. New field 'snapshot_name' instead.
- resource_
group_ strid The resource group id.
- retention_
days int The retention period of the snapshot.
- snapshot_
name str The name of the snapshot.
- Mapping[str, Any]
A mapping of tags to assign to the snapshot.
NOTE: If
force
is true, After an snapshot is deleted, the disks created from this snapshot cannot be re-initialized.
- disk
Id String The ID of the disk.
- category String
The category of the snapshot. Valid Values:
standard
andflash
.- description String
The description of the snapshot.
- force Boolean
Specifies whether to forcibly delete the snapshot that has been used to create disks.
- instant
Access Boolean Specifies whether to enable the instant access feature.
- instant
Access NumberRetention Days Specifies the retention period of the instant access feature. After the retention period ends, the snapshot is automatically released.
- name String
Field
name
has been deprecated from provider version 1.120.0. New fieldsnapshot_name
instead.Field 'name' has been deprecated from provider version 1.120.0. New field 'snapshot_name' instead.
- resource
Group StringId The resource group id.
- retention
Days Number The retention period of the snapshot.
- snapshot
Name String The name of the snapshot.
- Map<Any>
A mapping of tags to assign to the snapshot.
NOTE: If
force
is true, After an snapshot is deleted, the disks created from this snapshot cannot be re-initialized.
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, Any]] = 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:
standard
andflash
.- Description string
The description of the snapshot.
- Disk
Id string The ID of the disk.
- Force bool
Specifies whether to forcibly delete the snapshot that has been used to create disks.
- Instant
Access bool Specifies whether to enable the instant access feature.
- Instant
Access intRetention Days Specifies the retention period of the instant access feature. After the retention period ends, the snapshot is automatically released.
- Name string
Field
name
has been deprecated from provider version 1.120.0. New fieldsnapshot_name
instead.Field 'name' has been deprecated from provider version 1.120.0. New field 'snapshot_name' instead.
- Resource
Group stringId The resource group id.
- Retention
Days int The retention period of the snapshot.
- Snapshot
Name string The name of the snapshot.
- Status string
The status of snapshot.
- Dictionary<string, object>
A mapping of tags to assign to the snapshot.
NOTE: If
force
is true, After an snapshot is deleted, the disks created from this snapshot cannot be re-initialized.
- Category string
The category of the snapshot. Valid Values:
standard
andflash
.- Description string
The description of the snapshot.
- Disk
Id string The ID of the disk.
- Force bool
Specifies whether to forcibly delete the snapshot that has been used to create disks.
- Instant
Access bool Specifies whether to enable the instant access feature.
- Instant
Access intRetention Days Specifies the retention period of the instant access feature. After the retention period ends, the snapshot is automatically released.
- Name string
Field
name
has been deprecated from provider version 1.120.0. New fieldsnapshot_name
instead.Field 'name' has been deprecated from provider version 1.120.0. New field 'snapshot_name' instead.
- Resource
Group stringId The resource group id.
- Retention
Days int The retention period of the snapshot.
- Snapshot
Name string The name of the snapshot.
- Status string
The status of snapshot.
- map[string]interface{}
A mapping of tags to assign to the snapshot.
NOTE: If
force
is true, After an snapshot is deleted, the disks created from this snapshot cannot be re-initialized.
- category String
The category of the snapshot. Valid Values:
standard
andflash
.- description String
The description of the snapshot.
- disk
Id String The ID of the disk.
- force Boolean
Specifies whether to forcibly delete the snapshot that has been used to create disks.
- instant
Access Boolean Specifies whether to enable the instant access feature.
- instant
Access IntegerRetention Days Specifies the retention period of the instant access feature. After the retention period ends, the snapshot is automatically released.
- name String
Field
name
has been deprecated from provider version 1.120.0. New fieldsnapshot_name
instead.Field 'name' has been deprecated from provider version 1.120.0. New field 'snapshot_name' instead.
- resource
Group StringId The resource group id.
- retention
Days Integer The retention period of the snapshot.
- snapshot
Name String The name of the snapshot.
- status String
The status of snapshot.
- Map<String,Object>
A mapping of tags to assign to the snapshot.
NOTE: If
force
is true, After an snapshot is deleted, the disks created from this snapshot cannot be re-initialized.
- category string
The category of the snapshot. Valid Values:
standard
andflash
.- description string
The description of the snapshot.
- disk
Id string The ID of the disk.
- force boolean
Specifies whether to forcibly delete the snapshot that has been used to create disks.
- instant
Access boolean Specifies whether to enable the instant access feature.
- instant
Access numberRetention Days Specifies the retention period of the instant access feature. After the retention period ends, the snapshot is automatically released.
- name string
Field
name
has been deprecated from provider version 1.120.0. New fieldsnapshot_name
instead.Field 'name' has been deprecated from provider version 1.120.0. New field 'snapshot_name' instead.
- resource
Group stringId The resource group id.
- retention
Days number The retention period of the snapshot.
- snapshot
Name string The name of the snapshot.
- status string
The status of snapshot.
- {[key: string]: any}
A mapping of tags to assign to the snapshot.
NOTE: If
force
is true, After an snapshot is deleted, the disks created from this snapshot cannot be re-initialized.
- category str
The category of the snapshot. Valid Values:
standard
andflash
.- description str
The description of the snapshot.
- disk_
id str The ID of the disk.
- force bool
Specifies whether to forcibly delete the snapshot that has been used to create disks.
- instant_
access bool Specifies whether to enable the instant access feature.
- instant_
access_ intretention_ days Specifies the retention period of the instant access feature. After the retention period ends, the snapshot is automatically released.
- name str
Field
name
has been deprecated from provider version 1.120.0. New fieldsnapshot_name
instead.Field 'name' has been deprecated from provider version 1.120.0. New field 'snapshot_name' instead.
- resource_
group_ strid The resource group id.
- retention_
days int The retention period of the snapshot.
- snapshot_
name str The name of the snapshot.
- status str
The status of snapshot.
- Mapping[str, Any]
A mapping of tags to assign to the snapshot.
NOTE: If
force
is true, After an snapshot is deleted, the disks created from this snapshot cannot be re-initialized.
- category String
The category of the snapshot. Valid Values:
standard
andflash
.- description String
The description of the snapshot.
- disk
Id String The ID of the disk.
- force Boolean
Specifies whether to forcibly delete the snapshot that has been used to create disks.
- instant
Access Boolean Specifies whether to enable the instant access feature.
- instant
Access NumberRetention Days Specifies the retention period of the instant access feature. After the retention period ends, the snapshot is automatically released.
- name String
Field
name
has been deprecated from provider version 1.120.0. New fieldsnapshot_name
instead.Field 'name' has been deprecated from provider version 1.120.0. New field 'snapshot_name' instead.
- resource
Group StringId The resource group id.
- retention
Days Number The retention period of the snapshot.
- snapshot
Name String The name of the snapshot.
- status String
The status of snapshot.
- Map<Any>
A mapping of tags to assign to the snapshot.
NOTE: If
force
is true, After an snapshot is deleted, the disks created from this snapshot cannot be re-initialized.
Import
ECS Snapshot can be imported using the id, e.g.
$ pulumi import alicloud:ecs/ecsSnapshot:EcsSnapshot example <id>
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
alicloud
Terraform Provider.