Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi
alicloud.oss.getBucketObjects
Explore with Pulumi AI
This data source provides the objects of an OSS bucket.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const bucketObjectsDs = alicloud.oss.getBucketObjects({
bucketName: "sample_bucket",
keyRegex: "sample/sample_object.txt",
});
export const firstObjectKey = bucketObjectsDs.then(bucketObjectsDs => bucketObjectsDs.objects?.[0]?.key);
import pulumi
import pulumi_alicloud as alicloud
bucket_objects_ds = alicloud.oss.get_bucket_objects(bucket_name="sample_bucket",
key_regex="sample/sample_object.txt")
pulumi.export("firstObjectKey", bucket_objects_ds.objects[0].key)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/oss"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
bucketObjectsDs, err := oss.GetBucketObjects(ctx, &oss.GetBucketObjectsArgs{
BucketName: "sample_bucket",
KeyRegex: pulumi.StringRef("sample/sample_object.txt"),
}, nil)
if err != nil {
return err
}
ctx.Export("firstObjectKey", bucketObjectsDs.Objects[0].Key)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var bucketObjectsDs = AliCloud.Oss.GetBucketObjects.Invoke(new()
{
BucketName = "sample_bucket",
KeyRegex = "sample/sample_object.txt",
});
return new Dictionary<string, object?>
{
["firstObjectKey"] = bucketObjectsDs.Apply(getBucketObjectsResult => getBucketObjectsResult.Objects[0]?.Key),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.oss.OssFunctions;
import com.pulumi.alicloud.oss.inputs.GetBucketObjectsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var bucketObjectsDs = OssFunctions.getBucketObjects(GetBucketObjectsArgs.builder()
.bucketName("sample_bucket")
.keyRegex("sample/sample_object.txt")
.build());
ctx.export("firstObjectKey", bucketObjectsDs.applyValue(getBucketObjectsResult -> getBucketObjectsResult.objects()[0].key()));
}
}
variables:
bucketObjectsDs:
fn::invoke:
Function: alicloud:oss:getBucketObjects
Arguments:
bucketName: sample_bucket
keyRegex: sample/sample_object.txt
outputs:
firstObjectKey: ${bucketObjectsDs.objects[0].key}
Using getBucketObjects
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getBucketObjects(args: GetBucketObjectsArgs, opts?: InvokeOptions): Promise<GetBucketObjectsResult>
function getBucketObjectsOutput(args: GetBucketObjectsOutputArgs, opts?: InvokeOptions): Output<GetBucketObjectsResult>
def get_bucket_objects(bucket_name: Optional[str] = None,
key_prefix: Optional[str] = None,
key_regex: Optional[str] = None,
output_file: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetBucketObjectsResult
def get_bucket_objects_output(bucket_name: Optional[pulumi.Input[str]] = None,
key_prefix: Optional[pulumi.Input[str]] = None,
key_regex: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetBucketObjectsResult]
func GetBucketObjects(ctx *Context, args *GetBucketObjectsArgs, opts ...InvokeOption) (*GetBucketObjectsResult, error)
func GetBucketObjectsOutput(ctx *Context, args *GetBucketObjectsOutputArgs, opts ...InvokeOption) GetBucketObjectsResultOutput
> Note: This function is named GetBucketObjects
in the Go SDK.
public static class GetBucketObjects
{
public static Task<GetBucketObjectsResult> InvokeAsync(GetBucketObjectsArgs args, InvokeOptions? opts = null)
public static Output<GetBucketObjectsResult> Invoke(GetBucketObjectsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetBucketObjectsResult> getBucketObjects(GetBucketObjectsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:oss/getBucketObjects:getBucketObjects
arguments:
# arguments dictionary
The following arguments are supported:
- Bucket
Name string - Name of the bucket that contains the objects to find.
- Key
Prefix string - Filter results by the given key prefix (such as "path/to/folder/logs-").
- Key
Regex string - A regex string to filter results by key.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- Bucket
Name string - Name of the bucket that contains the objects to find.
- Key
Prefix string - Filter results by the given key prefix (such as "path/to/folder/logs-").
- Key
Regex string - A regex string to filter results by key.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- bucket
Name String - Name of the bucket that contains the objects to find.
- key
Prefix String - Filter results by the given key prefix (such as "path/to/folder/logs-").
- key
Regex String - A regex string to filter results by key.
- output
File String - File name where to save data source results (after running
pulumi preview
).
- bucket
Name string - Name of the bucket that contains the objects to find.
- key
Prefix string - Filter results by the given key prefix (such as "path/to/folder/logs-").
- key
Regex string - A regex string to filter results by key.
- output
File string - File name where to save data source results (after running
pulumi preview
).
- bucket_
name str - Name of the bucket that contains the objects to find.
- key_
prefix str - Filter results by the given key prefix (such as "path/to/folder/logs-").
- key_
regex str - A regex string to filter results by key.
- output_
file str - File name where to save data source results (after running
pulumi preview
).
- bucket
Name String - Name of the bucket that contains the objects to find.
- key
Prefix String - Filter results by the given key prefix (such as "path/to/folder/logs-").
- key
Regex String - A regex string to filter results by key.
- output
File String - File name where to save data source results (after running
pulumi preview
).
getBucketObjects Result
The following output properties are available:
- Bucket
Name string - Id string
- The provider-assigned unique ID for this managed resource.
- Objects
List<Pulumi.
Ali Cloud. Oss. Outputs. Get Bucket Objects Object> - A list of bucket objects. Each element contains the following attributes:
- Key
Prefix string - Key
Regex string - Output
File string
- Bucket
Name string - Id string
- The provider-assigned unique ID for this managed resource.
- Objects
[]Get
Bucket Objects Object - A list of bucket objects. Each element contains the following attributes:
- Key
Prefix string - Key
Regex string - Output
File string
- bucket
Name String - id String
- The provider-assigned unique ID for this managed resource.
- objects
List<Get
Bucket Objects Object> - A list of bucket objects. Each element contains the following attributes:
- key
Prefix String - key
Regex String - output
File String
- bucket
Name string - id string
- The provider-assigned unique ID for this managed resource.
- objects
Get
Bucket Objects Object[] - A list of bucket objects. Each element contains the following attributes:
- key
Prefix string - key
Regex string - output
File string
- bucket_
name str - id str
- The provider-assigned unique ID for this managed resource.
- objects
Sequence[Get
Bucket Objects Object] - A list of bucket objects. Each element contains the following attributes:
- key_
prefix str - key_
regex str - output_
file str
- bucket
Name String - id String
- The provider-assigned unique ID for this managed resource.
- objects List<Property Map>
- A list of bucket objects. Each element contains the following attributes:
- key
Prefix String - key
Regex String - output
File String
Supporting Types
GetBucketObjectsObject
- Acl string
- Object access control list. Possible values:
default
,private
,public-read
andpublic-read-write
. - Cache
Control string - Caching behavior along the request/reply chain. Read RFC2616 Cache-Control for further details.
- Content
Disposition string - Presentational information for the object. Read RFC2616 Content-Disposition for further details.
- Content
Encoding string - 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
Length string - Size of the object in bytes.
- Content
Md5 string - MD5 value of the content. Read MD5 for computing method.
- Content
Type string - Standard MIME type describing the format of the object data, e.g. "application/octet-stream".
- Etag string
- ETag generated for the object (MD5 sum of the object content).
- Expires string
- Expiration date for the the request/response. Read RFC2616 Expires for further details.
- Key string
- Object key.
- Last
Modification stringTime - Last modification time of the object.
- Server
Side stringEncryption - Server-side encryption of the object in OSS. It can be empty or
AES256
. - Sse
Kms stringKey Id - If present, specifies the ID of the Key Management Service(KMS) master encryption key that was used for the object.
- Storage
Class string - Object storage type. Possible values:
Standard
,IA
,Archive
andColdArchive
.
- Acl string
- Object access control list. Possible values:
default
,private
,public-read
andpublic-read-write
. - Cache
Control string - Caching behavior along the request/reply chain. Read RFC2616 Cache-Control for further details.
- Content
Disposition string - Presentational information for the object. Read RFC2616 Content-Disposition for further details.
- Content
Encoding string - 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
Length string - Size of the object in bytes.
- Content
Md5 string - MD5 value of the content. Read MD5 for computing method.
- Content
Type string - Standard MIME type describing the format of the object data, e.g. "application/octet-stream".
- Etag string
- ETag generated for the object (MD5 sum of the object content).
- Expires string
- Expiration date for the the request/response. Read RFC2616 Expires for further details.
- Key string
- Object key.
- Last
Modification stringTime - Last modification time of the object.
- Server
Side stringEncryption - Server-side encryption of the object in OSS. It can be empty or
AES256
. - Sse
Kms stringKey Id - If present, specifies the ID of the Key Management Service(KMS) master encryption key that was used for the object.
- Storage
Class string - Object storage type. Possible values:
Standard
,IA
,Archive
andColdArchive
.
- acl String
- Object access control list. Possible values:
default
,private
,public-read
andpublic-read-write
. - cache
Control String - Caching behavior along the request/reply chain. Read RFC2616 Cache-Control for further details.
- content
Disposition String - Presentational information for the object. Read RFC2616 Content-Disposition for further details.
- content
Encoding String - 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
Length String - Size of the object in bytes.
- content
Md5 String - MD5 value of the content. Read MD5 for computing method.
- content
Type String - Standard MIME type describing the format of the object data, e.g. "application/octet-stream".
- etag String
- ETag generated for the object (MD5 sum of the object content).
- expires String
- Expiration date for the the request/response. Read RFC2616 Expires for further details.
- key String
- Object key.
- last
Modification StringTime - Last modification time of the object.
- server
Side StringEncryption - Server-side encryption of the object in OSS. It can be empty or
AES256
. - sse
Kms StringKey Id - If present, specifies the ID of the Key Management Service(KMS) master encryption key that was used for the object.
- storage
Class String - Object storage type. Possible values:
Standard
,IA
,Archive
andColdArchive
.
- acl string
- Object access control list. Possible values:
default
,private
,public-read
andpublic-read-write
. - cache
Control string - Caching behavior along the request/reply chain. Read RFC2616 Cache-Control for further details.
- content
Disposition string - Presentational information for the object. Read RFC2616 Content-Disposition for further details.
- content
Encoding string - 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
Length string - Size of the object in bytes.
- content
Md5 string - MD5 value of the content. Read MD5 for computing method.
- content
Type string - Standard MIME type describing the format of the object data, e.g. "application/octet-stream".
- etag string
- ETag generated for the object (MD5 sum of the object content).
- expires string
- Expiration date for the the request/response. Read RFC2616 Expires for further details.
- key string
- Object key.
- last
Modification stringTime - Last modification time of the object.
- server
Side stringEncryption - Server-side encryption of the object in OSS. It can be empty or
AES256
. - sse
Kms stringKey Id - If present, specifies the ID of the Key Management Service(KMS) master encryption key that was used for the object.
- storage
Class string - Object storage type. Possible values:
Standard
,IA
,Archive
andColdArchive
.
- acl str
- Object access control list. Possible values:
default
,private
,public-read
andpublic-read-write
. - cache_
control str - Caching behavior along the request/reply chain. Read RFC2616 Cache-Control for further details.
- content_
disposition str - Presentational information for the object. Read RFC2616 Content-Disposition for further details.
- content_
encoding str - 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_
length str - Size of the object in bytes.
- content_
md5 str - MD5 value of the content. Read MD5 for computing method.
- content_
type str - Standard MIME type describing the format of the object data, e.g. "application/octet-stream".
- etag str
- ETag generated for the object (MD5 sum of the object content).
- expires str
- Expiration date for the the request/response. Read RFC2616 Expires for further details.
- key str
- Object key.
- last_
modification_ strtime - Last modification time of the object.
- server_
side_ strencryption - Server-side encryption of the object in OSS. It can be empty or
AES256
. - sse_
kms_ strkey_ id - If present, specifies the ID of the Key Management Service(KMS) master encryption key that was used for the object.
- storage_
class str - Object storage type. Possible values:
Standard
,IA
,Archive
andColdArchive
.
- acl String
- Object access control list. Possible values:
default
,private
,public-read
andpublic-read-write
. - cache
Control String - Caching behavior along the request/reply chain. Read RFC2616 Cache-Control for further details.
- content
Disposition String - Presentational information for the object. Read RFC2616 Content-Disposition for further details.
- content
Encoding String - 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
Length String - Size of the object in bytes.
- content
Md5 String - MD5 value of the content. Read MD5 for computing method.
- content
Type String - Standard MIME type describing the format of the object data, e.g. "application/octet-stream".
- etag String
- ETag generated for the object (MD5 sum of the object content).
- expires String
- Expiration date for the the request/response. Read RFC2616 Expires for further details.
- key String
- Object key.
- last
Modification StringTime - Last modification time of the object.
- server
Side StringEncryption - Server-side encryption of the object in OSS. It can be empty or
AES256
. - sse
Kms StringKey Id - If present, specifies the ID of the Key Management Service(KMS) master encryption key that was used for the object.
- storage
Class String - Object storage type. Possible values:
Standard
,IA
,Archive
andColdArchive
.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.