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+.
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, Any]] = 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,
InstantAccess = false,
InstantAccessRetentionDays = 0,
ResourceGroupId = "string",
RetentionDays = 0,
SnapshotName = "string",
Tags =
{
{ "string", "any" },
},
});
example, err := ecs.NewEcsSnapshot(ctx, "ecsSnapshotResource", &ecs.EcsSnapshotArgs{
DiskId: pulumi.String("string"),
Category: pulumi.String("string"),
Description: pulumi.String("string"),
Force: pulumi.Bool(false),
InstantAccess: pulumi.Bool(false),
InstantAccessRetentionDays: pulumi.Int(0),
ResourceGroupId: pulumi.String("string"),
RetentionDays: pulumi.Int(0),
SnapshotName: pulumi.String("string"),
Tags: pulumi.Map{
"string": pulumi.Any("any"),
},
})
var ecsSnapshotResource = new EcsSnapshot("ecsSnapshotResource", EcsSnapshotArgs.builder()
.diskId("string")
.category("string")
.description("string")
.force(false)
.instantAccess(false)
.instantAccessRetentionDays(0)
.resourceGroupId("string")
.retentionDays(0)
.snapshotName("string")
.tags(Map.of("string", "any"))
.build());
ecs_snapshot_resource = alicloud.ecs.EcsSnapshot("ecsSnapshotResource",
disk_id="string",
category="string",
description="string",
force=False,
instant_access=False,
instant_access_retention_days=0,
resource_group_id="string",
retention_days=0,
snapshot_name="string",
tags={
"string": "any",
})
const ecsSnapshotResource = new alicloud.ecs.EcsSnapshot("ecsSnapshotResource", {
diskId: "string",
category: "string",
description: "string",
force: false,
instantAccess: false,
instantAccessRetentionDays: 0,
resourceGroupId: "string",
retentionDays: 0,
snapshotName: "string",
tags: {
string: "any",
},
});
type: alicloud:ecs:EcsSnapshot
properties:
category: string
description: string
diskId: string
force: false
instantAccess: false
instantAccessRetentionDays: 0
resourceGroupId: string
retentionDays: 0
snapshotName: string
tags:
string: any
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. - 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. - 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. - 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. - 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. - 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. - 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. - 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. - 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. - 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. - 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. - 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. - 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>
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.