alicloud logo
Alibaba Cloud v3.34.0, Mar 17 23

alicloud.ecs.EcsSnapshot

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 Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var @default = new AliCloud.Ecs.EcsSnapshot("default", new()
    {
        Category = "standard",
        Description = "Test For Terraform",
        DiskId = "d-gw8csgxxxxxxxxx",
        RetentionDays = 20,
        SnapshotName = "tf-test",
        Tags = 
        {
            { "Created", "TF" },
            { "For", "Acceptance-test" },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ecs.NewEcsSnapshot(ctx, "default", &ecs.EcsSnapshotArgs{
			Category:      pulumi.String("standard"),
			Description:   pulumi.String("Test For Terraform"),
			DiskId:        pulumi.String("d-gw8csgxxxxxxxxx"),
			RetentionDays: pulumi.Int(20),
			SnapshotName:  pulumi.String("tf-test"),
			Tags: pulumi.AnyMap{
				"Created": pulumi.Any("TF"),
				"For":     pulumi.Any("Acceptance-test"),
			},
		})
		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.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) {
        var default_ = new EcsSnapshot("default", EcsSnapshotArgs.builder()        
            .category("standard")
            .description("Test For Terraform")
            .diskId("d-gw8csgxxxxxxxxx")
            .retentionDays("20")
            .snapshotName("tf-test")
            .tags(Map.ofEntries(
                Map.entry("Created", "TF"),
                Map.entry("For", "Acceptance-test")
            ))
            .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

default = alicloud.ecs.EcsSnapshot("default",
    category="standard",
    description="Test For Terraform",
    disk_id="d-gw8csgxxxxxxxxx",
    retention_days=20,
    snapshot_name="tf-test",
    tags={
        "Created": "TF",
        "For": "Acceptance-test",
    })
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const _default = new alicloud.ecs.EcsSnapshot("default", {
    category: "standard",
    description: "Test For Terraform",
    diskId: "d-gw8csgxxxxxxxxx",
    retentionDays: 20,
    snapshotName: "tf-test",
    tags: {
        Created: "TF",
        For: "Acceptance-test",
    },
});
resources:
  default:
    type: alicloud:ecs:EcsSnapshot
    properties:
      category: standard
      description: Test For Terraform
      diskId: d-gw8csgxxxxxxxxx
      retentionDays: '20'
      snapshotName: tf-test
      tags:
        Created: TF
        For: Acceptance-test

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:

DiskId string

The ID of the disk.

Category string

The category of the snapshot. Valid Values: standard and flash.

Description string

The description of the snapshot.

Force bool

Specifies whether to forcibly delete the snapshot that has been used to create disks.

InstantAccess bool

Specifies whether to enable the instant access feature.

InstantAccessRetentionDays int

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 field snapshot_name instead.

Deprecated:

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

ResourceGroupId string

The resource group id.

RetentionDays int

The retention period of the snapshot.

SnapshotName string

The name of the snapshot.

Tags Dictionary<string, object>

A mapping of tags to assign to the snapshot.

DiskId string

The ID of the disk.

Category string

The category of the snapshot. Valid Values: standard and flash.

Description string

The description of the snapshot.

Force bool

Specifies whether to forcibly delete the snapshot that has been used to create disks.

InstantAccess bool

Specifies whether to enable the instant access feature.

InstantAccessRetentionDays int

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 field snapshot_name instead.

Deprecated:

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

ResourceGroupId string

The resource group id.

RetentionDays int

The retention period of the snapshot.

SnapshotName string

The name of the snapshot.

Tags map[string]interface{}

A mapping of tags to assign to the snapshot.

diskId String

The ID of the disk.

category String

The category of the snapshot. Valid Values: standard and flash.

description String

The description of the snapshot.

force Boolean

Specifies whether to forcibly delete the snapshot that has been used to create disks.

instantAccess Boolean

Specifies whether to enable the instant access feature.

instantAccessRetentionDays Integer

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 field snapshot_name instead.

Deprecated:

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

resourceGroupId String

The resource group id.

retentionDays Integer

The retention period of the snapshot.

snapshotName String

The name of the snapshot.

tags Map<String,Object>

A mapping of tags to assign to the snapshot.

diskId string

The ID of the disk.

category string

The category of the snapshot. Valid Values: standard and flash.

description string

The description of the snapshot.

force boolean

Specifies whether to forcibly delete the snapshot that has been used to create disks.

instantAccess boolean

Specifies whether to enable the instant access feature.

instantAccessRetentionDays number

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 field snapshot_name instead.

Deprecated:

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

resourceGroupId string

The resource group id.

retentionDays number

The retention period of the snapshot.

snapshotName string

The name of the snapshot.

tags {[key: string]: any}

A mapping of tags to assign to the snapshot.

disk_id str

The ID of the disk.

category str

The category of the snapshot. Valid Values: standard and flash.

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_retention_days int

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 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 resource group id.

retention_days int

The retention period of the snapshot.

snapshot_name str

The name of the snapshot.

tags Mapping[str, Any]

A mapping of tags to assign to the snapshot.

diskId String

The ID of the disk.

category String

The category of the snapshot. Valid Values: standard and flash.

description String

The description of the snapshot.

force Boolean

Specifies whether to forcibly delete the snapshot that has been used to create disks.

instantAccess Boolean

Specifies whether to enable the instant access feature.

instantAccessRetentionDays Number

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 field snapshot_name instead.

Deprecated:

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

resourceGroupId String

The resource group id.

retentionDays Number

The retention period of the snapshot.

snapshotName String

The name of the snapshot.

tags Map<Any>

A mapping of tags to assign to the snapshot.

Outputs

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

Id string

The provider-assigned unique ID for this managed resource.

Status string

The status of snapshot.

Id string

The provider-assigned unique ID for this managed resource.

Status string

The status of snapshot.

id String

The provider-assigned unique ID for this managed resource.

status String

The status of snapshot.

id string

The provider-assigned unique ID for this managed resource.

status string

The status of snapshot.

id str

The provider-assigned unique ID for this managed resource.

status str

The status of snapshot.

id String

The provider-assigned unique ID for this managed resource.

status String

The status of 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,
        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.
The following state arguments are supported:
Category string

The category of the snapshot. Valid Values: standard and flash.

Description string

The description of the snapshot.

DiskId string

The ID of the disk.

Force bool

Specifies whether to forcibly delete the snapshot that has been used to create disks.

InstantAccess bool

Specifies whether to enable the instant access feature.

InstantAccessRetentionDays int

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 field snapshot_name instead.

Deprecated:

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

ResourceGroupId string

The resource group id.

RetentionDays int

The retention period of the snapshot.

SnapshotName string

The name of the snapshot.

Status string

The status of snapshot.

Tags Dictionary<string, object>

A mapping of tags to assign to the snapshot.

Category string

The category of the snapshot. Valid Values: standard and flash.

Description string

The description of the snapshot.

DiskId string

The ID of the disk.

Force bool

Specifies whether to forcibly delete the snapshot that has been used to create disks.

InstantAccess bool

Specifies whether to enable the instant access feature.

InstantAccessRetentionDays int

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 field snapshot_name instead.

Deprecated:

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

ResourceGroupId string

The resource group id.

RetentionDays int

The retention period of the snapshot.

SnapshotName string

The name of the snapshot.

Status string

The status of snapshot.

Tags map[string]interface{}

A mapping of tags to assign to the snapshot.

category String

The category of the snapshot. Valid Values: standard and flash.

description String

The description of the snapshot.

diskId String

The ID of the disk.

force Boolean

Specifies whether to forcibly delete the snapshot that has been used to create disks.

instantAccess Boolean

Specifies whether to enable the instant access feature.

instantAccessRetentionDays Integer

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 field snapshot_name instead.

Deprecated:

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

resourceGroupId String

The resource group id.

retentionDays Integer

The retention period of the snapshot.

snapshotName String

The name of the snapshot.

status String

The status of snapshot.

tags Map<String,Object>

A mapping of tags to assign to the snapshot.

category string

The category of the snapshot. Valid Values: standard and flash.

description string

The description of the snapshot.

diskId string

The ID of the disk.

force boolean

Specifies whether to forcibly delete the snapshot that has been used to create disks.

instantAccess boolean

Specifies whether to enable the instant access feature.

instantAccessRetentionDays number

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 field snapshot_name instead.

Deprecated:

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

resourceGroupId string

The resource group id.

retentionDays number

The retention period of the snapshot.

snapshotName string

The name of the snapshot.

status string

The status of snapshot.

tags {[key: string]: any}

A mapping of tags to assign to the snapshot.

category str

The category of the snapshot. Valid Values: standard and flash.

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_retention_days int

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

tags Mapping[str, Any]

A mapping of tags to assign to the snapshot.

category String

The category of the snapshot. Valid Values: standard and flash.

description String

The description of the snapshot.

diskId String

The ID of the disk.

force Boolean

Specifies whether to forcibly delete the snapshot that has been used to create disks.

instantAccess Boolean

Specifies whether to enable the instant access feature.

instantAccessRetentionDays Number

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 field snapshot_name instead.

Deprecated:

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

resourceGroupId String

The resource group id.

retentionDays Number

The retention period of the snapshot.

snapshotName String

The name of the snapshot.

status String

The status of snapshot.

tags Map<Any>

A mapping of tags to assign to the snapshot.

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.