alicloud_oss_bucket_worm

更新时间:

Provides a OSS Bucket Worm resource.

Bucket Retention Policy.

For information about OSS Bucket Worm and how to use it, see What is Bucket Worm.

-> NOTE: Available since v1.240.0.

Example Usage

Basic Usage


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

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

resource "alicloud_oss_bucket" "defaulthNMfIF" {
  storage_class = "Standard"
}


resource "alicloud_oss_bucket_worm" "default" {
  bucket                   = alicloud_oss_bucket.defaulthNMfIF.bucket
  retention_period_in_days = "1"
  status                   = "InProgress"
}

Deleting alicloud_oss_bucket_worm or removing it from your configuration

The alicloud_oss_bucket_worm resource allows you to manage status = "Locked" instance, but Terraform cannot destroy it. Deleting the subscription resource or removing it from your configuration will remove it from your state file and management, but will not destroy the Instance. You can resume managing the subscription instance via the AlibabaCloud Console.

Argument Reference

The following arguments are supported:

  • bucket - (Required, ForceNew) The name of the bucket
  • retention_period_in_days - (Optional, Int) The specified number of days to retain the Object.
  • status - (Optional) The status of the compliance retention policy. Optional values:
    • InProgress: After a compliance retention policy is created, the policy is in the InProgress status by default, and the validity period of this status is 24 hours.
    • Locked: The compliance retention policy is Locked.

Attributes Reference

The following attributes are exported:

  • id - The ID of the resource supplied above.The value is formulated as <bucket>:<worm_id>.
  • create_time - The creation time of the resource
  • worm_id - The ID of the retention policy.

Timeouts

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

  • create - (Defaults to 5 mins) Used when create the Bucket Worm.
  • delete - (Defaults to 5 mins) Used when delete the Bucket Worm.
  • update - (Defaults to 5 mins) Used when update the Bucket Worm.

Import

OSS Bucket Worm can be imported using the id, e.g.

$ terraform import alicloud_oss_bucket_worm.example <bucket>:<worm_id>