alicloud_dbfs_snapshot

更新时间:

Provides a Database File System (DBFS) Snapshot resource.

For information about Database File System (DBFS) Snapshot and how to use it, see What is Snapshot.

-> NOTE: Available since v1.156.0.

Example Usage

Basic Usage


variable "name" {
  default = "terraform-example"
}

provider "alicloud" {
  region = "cn-hangzhou"
}

data "alicloud_dbfs_instances" "default" {
}

resource "alicloud_dbfs_snapshot" "example" {
  instance_id    = data.alicloud_dbfs_instances.default.instances.0.id
  retention_days = 50
  snapshot_name  = var.name
  description    = "DbfsSnapshot"
}

Argument Reference

The following arguments are supported:

  • instance_id - (Required, ForceNew) The ID of the Database File System.
  • retention_days - (Optional, ForceNew, Int) The retention period of the snapshot. Valid values: 1 to 65536.
  • snapshot_name - (Optional) The name of the snapshot. The snapshot_name must be 2 to 128 characters in length. It must start with a large or small letter or Chinese, and cannot start with http://, https://, auto or dbfs-auto. It can contain numbers, colons (:), underscores (_), or hyphens (-). NOTE: From version 1.233.1, snapshot_name can be modified.
  • description - (Optional) The description of the snapshot. The description must be 2 to 256 characters in length. It cannot start with http:// or https://. NOTE: From version 1.233.1, description can be modified.
  • force - (Optional, Bool) Specifies whether to force delete the snapshot. Valid values:
    • true: Enable.
    • false: Disable.

Attributes Reference

The following attributes are exported:

  • id - The resource ID in terraform of Snapshot.
  • status - The status of the Snapshot.

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • create - (Defaults to 5 mins) Used when create the Snapshot.
  • update - (Defaults to 5 mins) Used when update the Snapshot.
  • delete - (Defaults to 1 mins) Used when delete the Snapshot.

Import

Database File System (DBFS) Snapshot can be imported using the id, e.g.

$ terraform import alicloud_dbfs_snapshot.example <id>