alicloud_nas_auto_snapshot_policy

更新时间:

Provides a NAS Auto Snapshot Policy resource. Automatic snapshot policy.

For information about NAS Auto Snapshot Policy and how to use it, see What is Auto Snapshot Policy).

-> NOTE: Available since v1.153.0.

Example Usage

Basic Usage


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

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


resource "alicloud_nas_auto_snapshot_policy" "default" {
  time_points               = ["0", "1", "2"]
  retention_days            = "1"
  repeat_weekdays           = ["2", "3", "4"]
  auto_snapshot_policy_name = var.name
  file_system_type          = "extreme"
}

Argument Reference

The following arguments are supported:

  • auto_snapshot_policy_name - (Optional) The name of the automatic snapshot policy. Limits:
    • The name must be 2 to 128 characters in length,
    • The name must start with a letter.
    • The name can contain digits, colons (:), underscores (_), and hyphens (-). The name cannot start with http:// or https://.
    • The value of this parameter is empty by default.
  • file_system_type - (Optional, ForceNew, Computed, Available since v1.223.2) The file system type.
  • repeat_weekdays - (Required) The day on which an auto snapshot is created.
    • A maximum of 7 time points can be selected.
    • The format is an JSON array of ["1", "2", … "7"] and the time points are separated by commas (,).
  • retention_days - (Optional, Computed) The number of days for which you want to retain auto snapshots. Unit: days. Valid values:
    • -1: the default value. Auto snapshots are permanently retained. After the number of auto snapshots exceeds the upper limit, the earliest auto snapshot is automatically deleted.
    • 1 to 65536: Auto snapshots are retained for the specified days. After the retention period of auto snapshots expires, the auto snapshots are automatically deleted.
  • time_points - (Required) The point in time at which an auto snapshot is created.
    • A maximum of 24 time points can be selected.
    • The format is an JSON array of ["0", "1", … "23"] and the time points are separated by commas (,).

Attributes Reference

The following attributes are exported:

  • id - The ID of the resource supplied above.
  • create_time - Creation time.
  • status - The status of the automatic snapshot policy.

Timeouts

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

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

Import

NAS Auto Snapshot Policy can be imported using the id, e.g.

$ terraform import alicloud_nas_auto_snapshot_policy.example <id>