» alicloud_oss_bucket_objects
This data source provides the objects of an OSS bucket.
» Example Usage
data "alicloud_oss_bucket_objects" "bucket_objects_ds" {
bucket_name = "sample_bucket"
key_regex = "sample/sample_object.txt"
}
output "first_object_key" {
value = "${data.alicloud_oss_bucket_objects.bucket_objects_ds.bucket_objects.0.key}"
}
» Argument Reference
The following arguments are supported:
-
bucket_name
- Name of the bucket that contains the objects to find. -
key_regex
- (Optional) A regex string to filter results by key. -
key_prefix
- (Optional) Filter results by the given key prefix (such as "path/to/folder/logs-"). -
output_file
- (Optional) File name where to save data source results (after runningterraform plan
).
» Attributes Reference
The following attributes are exported in addition to the arguments listed above:
-
objects
- A list of bucket objects. Each element contains the following attributes:-
key
- Object key. -
acl
- Object access control list. Possible values:default
,private
,public-read
andpublic-read-write
. -
content_type
- Standard MIME type describing the format of the object data, e.g. "application/octet-stream". -
content_length
- Size of the object in bytes. -
cache_control
- Caching behavior along the request/reply chain. Read RFC2616 Cache-Control for further details. -
content_disposition
- Presentational information for the object. Read RFC2616 Content-Disposition for further details. -
content_encoding
- Content encodings that have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field. Read RFC2616 Content-Encoding for further details. -
content_md5
- MD5 value of the content. Read MD5 for computing method. -
expires
- Expiration date for the the request/response. Read RFC2616 Expires for further details. -
server_side_encryption
- Server-side encryption of the object in OSS. It can be empty orAES256
. -
etag
- ETag generated for the object (MD5 sum of the object content). -
storage_class
- Object storage type. Possible values:Standard
,IA
andArchive
. -
last_modification_time
- Last modification time of the object.
-