This data source provides the list of Buckets in Oracle Cloud Infrastructure Object Storage service.
Gets a list of all BucketSummary items in a compartment. A BucketSummary contains only summary fields for the bucket and does not contain fields like the user-defined metadata.
ListBuckets returns a BucketSummary containing at most 1000 buckets. To paginate through more buckets, use the returned
opc-next-page
value with the page
request parameter.
To use this and other API operations, you must be authorized in an IAM policy. If you are not authorized, talk to an administrator. If you are an administrator who needs to write policies to give users access, see Getting Started with Policies.
data "oci_objectstorage_bucket_summaries" "test_buckets" {
#Required
compartment_id = var.compartment_id
namespace = var.bucket_namespace
}
The following arguments are supported:
compartment_id
- (Required) The ID of the compartment in which to list buckets.namespace
- (Required) The Object Storage namespace used for the request.The following attributes are exported:
bucket_summaries
- The list of bucket_summaries.The following attributes are exported:
access_type
- The type of public access enabled on this bucket. A bucket is set to NoPublicAccess
by default, which only allows an authenticated caller to access the bucket and its contents. When ObjectRead
is enabled on the bucket, public access is allowed for the GetObject
, HeadObject
, and ListObjects
operations. When ObjectReadWithoutList
is enabled on the bucket, public access is allowed for the GetObject
and HeadObject
operations. approximate_count
- The approximate number of objects in the bucket. Count statistics are reported periodically. You will see a lag between what is displayed and the actual object count. approximate_size
- The approximate total size in bytes of all objects in the bucket. Size statistics are reported periodically. You will see a lag between what is displayed and the actual size of the bucket. auto_tiering
- The auto tiering status on the bucket. A bucket is created with auto tiering Disabled
by default. For auto tiering InfrequentAccess
, objects are transitioned automatically between the 'Standard' and 'InfrequentAccess' tiers based on the access pattern of the objects. compartment_id
- The compartment ID in which the bucket is authorized.created_by
- The OCID of the user who created the bucket.defined_tags
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
etag
- The entity tag (ETag) for the bucket.freeform_tags
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
is_read_only
- Whether or not this bucket is read only. By default, isReadOnly
is set to false
. This will be set to 'true' when this bucket is configured as a destination in a replication policy. kms_key_id
- The OCID of a master encryption key used to call the Key Management service to generate a data encryption key or to encrypt or decrypt a data encryption key. metadata
- Arbitrary string keys and values for user-defined metadata.name
- The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1 namespace
- The Object Storage namespace in which the bucket resides.object_events_enabled
- Whether or not events are emitted for object state changes in this bucket. By default, objectEventsEnabled
is set to false
. Set objectEventsEnabled
to true
to emit events for object state changes. For more information about events, see Overview of Events. object_lifecycle_policy_etag
- The entity tag (ETag) for the live object lifecycle policy on the bucket.replication_enabled
- Whether or not this bucket is a replication source. By default, replicationEnabled
is set to false
. This will be set to 'true' when you create a replication policy for the bucket. storage_tier
- The storage tier type assigned to the bucket. A bucket is set to Standard
tier by default, which means objects uploaded or copied to the bucket will be in the standard storage tier. When the Archive
tier type is set explicitly for a bucket, objects uploaded or copied to the bucket will be stored in archive storage. The storageTier
property is immutable after bucket is created. time_created
- The date and time the bucket was created, as described in RFC 2616.versioning
- The versioning status on the bucket. A bucket is created with versioning Disabled
by default. For versioning Enabled
, objects are protected from overwrites and deletes, by maintaining their version history. When versioning is Suspended
, the previous versions will still remain but new versions will no longer be created when overwitten or deleted.