Class GetBucketObjects
Inheritance
System.Object
GetBucketObjects
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws.S3
Assembly: Pulumi.Aws.dll
Syntax
public static class GetBucketObjects
Methods
View SourceInvokeAsync(GetBucketObjectsArgs, InvokeOptions)
NOTE on
max_keys: Retrieving very large numbers of keys can adversely affect this provider's performance.
The bucket-objects data source returns keys (i.e., file names) and other metadata about objects in an S3 bucket.
{{% examples %}}
Example Usage
{{% example %}}
The following example retrieves a list of all object keys in an S3 bucket and creates corresponding object data sources:
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var myObjects = Output.Create(Aws.S3.GetBucketObjects.InvokeAsync(new Aws.S3.GetBucketObjectsArgs
{
Bucket = "ourcorp",
}));
var objectInfo = Output.Tuple(myObjects.Apply(myObjects => myObjects.Keys).Length, myObjects, myObjects.Apply(myObjects => myObjects.Keys)[__index]).Apply(values =>
{
var length = values.Item1;
var myObjects = values.Item2;
var keys = values.Item3;
return "TODO: ForExpression";
});
}
}
{{% /example %}} {{% /examples %}}
Declaration
public static Task<GetBucketObjectsResult> InvokeAsync(GetBucketObjectsArgs args, InvokeOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GetBucketObjectsArgs | args | |
| InvokeOptions | options |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<GetBucketObjectsResult> |