oci_objectstorage_object_lifecycle_policy

This resource provides the Object Lifecycle Policy resource in Oracle Cloud Infrastructure Object Storage service.

Creates or replaces the object lifecycle policy for the bucket.

Example Usage

resource "oci_objectstorage_object_lifecycle_policy" "test_object_lifecycle_policy" {
	#Required
	bucket = var.object_lifecycle_policy_bucket
	namespace = var.object_lifecycle_policy_namespace

	#Optional
	rules {
		#Required
		action = var.object_lifecycle_policy_rules_action
		is_enabled = var.object_lifecycle_policy_rules_is_enabled
		name = var.object_lifecycle_policy_rules_name
		time_amount = var.object_lifecycle_policy_rules_time_amount
		time_unit = var.object_lifecycle_policy_rules_time_unit

		#Optional
		object_name_filter {

			#Optional
			exclusion_patterns = var.object_lifecycle_policy_rules_object_name_filter_exclusion_patterns
			inclusion_patterns = var.object_lifecycle_policy_rules_object_name_filter_inclusion_patterns
			inclusion_prefixes = var.object_lifecycle_policy_rules_object_name_filter_inclusion_prefixes
		}
		target = var.object_lifecycle_policy_rules_target
	}
}

Argument Reference

The following arguments are supported:

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

Attributes Reference

The following attributes are exported:

Timeouts

The timeouts block allows you to specify timeouts for certain operations: * create - (Defaults to 20 minutes), when creating the Object Lifecycle Policy * update - (Defaults to 20 minutes), when updating the Object Lifecycle Policy * delete - (Defaults to 20 minutes), when destroying the Object Lifecycle Policy

Import

ObjectLifecyclePolicies can be imported using the id, e.g.

$ terraform import oci_objectstorage_object_lifecycle_policy.test_object_lifecycle_policy "n/{namespaceName}/b/{bucketName}/l"