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