Viewing docs for AWS v7.39.0
published on Thursday, Jul 23, 2026 by Pulumi
published on Thursday, Jul 23, 2026 by Pulumi
Viewing docs for AWS v7.39.0
published on Thursday, Jul 23, 2026 by Pulumi
published on Thursday, Jul 23, 2026 by Pulumi
Provides details about AWS S3 (Simple Storage) buckets with optional filters.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = aws.s3.getBuckets({});
import pulumi
import pulumi_aws as aws
example = aws.s3.get_buckets()
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/s3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := s3.GetBuckets(ctx, &s3.GetBucketsArgs{}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = Aws.S3.GetBuckets.Invoke();
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.s3.S3Functions;
import com.pulumi.aws.s3.inputs.GetBucketsArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 example = S3Functions.getBuckets(GetBucketsArgs.builder()
.build());
}
}
variables:
example:
fn::invoke:
function: aws:s3:getBuckets
arguments: {}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
data "aws_s3_getbuckets" "example" {
}
Full Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = aws.s3.getBuckets({
bucketRegion: "us-west-2",
maxBuckets: 3,
prefix: "tf-",
});
import pulumi
import pulumi_aws as aws
example = aws.s3.get_buckets(bucket_region="us-west-2",
max_buckets=3,
prefix="tf-")
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/s3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := s3.GetBuckets(ctx, &s3.GetBucketsArgs{
BucketRegion: pulumi.StringRef("us-west-2"),
MaxBuckets: pulumi.IntRef(3),
Prefix: pulumi.StringRef("tf-"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = Aws.S3.GetBuckets.Invoke(new()
{
BucketRegion = "us-west-2",
MaxBuckets = 3,
Prefix = "tf-",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.s3.S3Functions;
import com.pulumi.aws.s3.inputs.GetBucketsArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 example = S3Functions.getBuckets(GetBucketsArgs.builder()
.bucketRegion("us-west-2")
.maxBuckets(3)
.prefix("tf-")
.build());
}
}
variables:
example:
fn::invoke:
function: aws:s3:getBuckets
arguments:
bucketRegion: us-west-2
maxBuckets: 3
prefix: tf-
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
data "aws_s3_getbuckets" "example" {
bucket_region = "us-west-2"
max_buckets = 3
prefix = "tf-"
}
Using getBuckets
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 getBuckets(args: GetBucketsArgs, opts?: InvokeOptions): Promise<GetBucketsResult>
function getBucketsOutput(args: GetBucketsOutputArgs, opts?: InvokeOptions): Output<GetBucketsResult>def get_buckets(bucket_region: Optional[str] = None,
max_buckets: Optional[int] = None,
prefix: Optional[str] = None,
region: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetBucketsResult
def get_buckets_output(bucket_region: pulumi.Input[Optional[str]] = None,
max_buckets: pulumi.Input[Optional[int]] = None,
prefix: pulumi.Input[Optional[str]] = None,
region: pulumi.Input[Optional[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetBucketsResult]func GetBuckets(ctx *Context, args *GetBucketsArgs, opts ...InvokeOption) (*GetBucketsResult, error)
func GetBucketsOutput(ctx *Context, args *GetBucketsOutputArgs, opts ...InvokeOption) GetBucketsResultOutput> Note: This function is named GetBuckets in the Go SDK.
public static class GetBuckets
{
public static Task<GetBucketsResult> InvokeAsync(GetBucketsArgs args, InvokeOptions? opts = null)
public static Output<GetBucketsResult> Invoke(GetBucketsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetBucketsResult> getBuckets(GetBucketsArgs args, InvokeOptions options)
public static Output<GetBucketsResult> getBuckets(GetBucketsArgs args, InvokeOptions options)
fn::invoke:
function: aws:s3/getBuckets:getBuckets
arguments:
# arguments dictionarydata "aws_s3_get_buckets" "name" {
# arguments
}The following arguments are supported:
- Bucket
Region string - Limits the response to buckets that are located in the specified AWS Region. The AWS Region must be expressed according to the AWS Region code.
- Max
Buckets int - Maximum number of buckets returned. Unlike the AWS API parameter, this is a provider-level total cap.
- Prefix string
- Limits the response to bucket names that begin with the specified bucket name prefix.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Bucket
Region string - Limits the response to buckets that are located in the specified AWS Region. The AWS Region must be expressed according to the AWS Region code.
- Max
Buckets int - Maximum number of buckets returned. Unlike the AWS API parameter, this is a provider-level total cap.
- Prefix string
- Limits the response to bucket names that begin with the specified bucket name prefix.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- bucket_
region string - Limits the response to buckets that are located in the specified AWS Region. The AWS Region must be expressed according to the AWS Region code.
- max_
buckets number - Maximum number of buckets returned. Unlike the AWS API parameter, this is a provider-level total cap.
- prefix string
- Limits the response to bucket names that begin with the specified bucket name prefix.
- region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- bucket
Region String - Limits the response to buckets that are located in the specified AWS Region. The AWS Region must be expressed according to the AWS Region code.
- max
Buckets Integer - Maximum number of buckets returned. Unlike the AWS API parameter, this is a provider-level total cap.
- prefix String
- Limits the response to bucket names that begin with the specified bucket name prefix.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- bucket
Region string - Limits the response to buckets that are located in the specified AWS Region. The AWS Region must be expressed according to the AWS Region code.
- max
Buckets number - Maximum number of buckets returned. Unlike the AWS API parameter, this is a provider-level total cap.
- prefix string
- Limits the response to bucket names that begin with the specified bucket name prefix.
- region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- bucket_
region str - Limits the response to buckets that are located in the specified AWS Region. The AWS Region must be expressed according to the AWS Region code.
- max_
buckets int - Maximum number of buckets returned. Unlike the AWS API parameter, this is a provider-level total cap.
- prefix str
- Limits the response to bucket names that begin with the specified bucket name prefix.
- region str
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- bucket
Region String - Limits the response to buckets that are located in the specified AWS Region. The AWS Region must be expressed according to the AWS Region code.
- max
Buckets Number - Maximum number of buckets returned. Unlike the AWS API parameter, this is a provider-level total cap.
- prefix String
- Limits the response to bucket names that begin with the specified bucket name prefix.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
getBuckets Result
The following output properties are available:
- Buckets
List<Get
Buckets Bucket> - List of bucket objects:
- Id string
- The provider-assigned unique ID for this managed resource.
- Region string
- Bucket
Region string - Bucket region.
- Max
Buckets int - Prefix string
- Buckets
[]Get
Buckets Bucket - List of bucket objects:
- Id string
- The provider-assigned unique ID for this managed resource.
- Region string
- Bucket
Region string - Bucket region.
- Max
Buckets int - Prefix string
- buckets list(object)
- List of bucket objects:
- id string
- The provider-assigned unique ID for this managed resource.
- region string
- bucket_
region string - Bucket region.
- max_
buckets number - prefix string
- buckets
List<Get
Buckets Bucket> - List of bucket objects:
- id String
- The provider-assigned unique ID for this managed resource.
- region String
- bucket
Region String - Bucket region.
- max
Buckets Integer - prefix String
- buckets
Get
Buckets Bucket[] - List of bucket objects:
- id string
- The provider-assigned unique ID for this managed resource.
- region string
- bucket
Region string - Bucket region.
- max
Buckets number - prefix string
- buckets
Sequence[Get
Buckets Bucket] - List of bucket objects:
- id str
- The provider-assigned unique ID for this managed resource.
- region str
- bucket_
region str - Bucket region.
- max_
buckets int - prefix str
- buckets List<Property Map>
- List of bucket objects:
- id String
- The provider-assigned unique ID for this managed resource.
- region String
- bucket
Region String - Bucket region.
- max
Buckets Number - prefix String
Supporting Types
GetBucketsBucket
- Bucket
Arn string - Bucket ARN.
- Bucket
Region string - Limits the response to buckets that are located in the specified AWS Region. The AWS Region must be expressed according to the AWS Region code.
- Creation
Date string - Bucket creation date.
- Name string
- Bucket name.
- Bucket
Arn string - Bucket ARN.
- Bucket
Region string - Limits the response to buckets that are located in the specified AWS Region. The AWS Region must be expressed according to the AWS Region code.
- Creation
Date string - Bucket creation date.
- Name string
- Bucket name.
- bucket_
arn string - Bucket ARN.
- bucket_
region string - Limits the response to buckets that are located in the specified AWS Region. The AWS Region must be expressed according to the AWS Region code.
- creation_
date string - Bucket creation date.
- name string
- Bucket name.
- bucket
Arn String - Bucket ARN.
- bucket
Region String - Limits the response to buckets that are located in the specified AWS Region. The AWS Region must be expressed according to the AWS Region code.
- creation
Date String - Bucket creation date.
- name String
- Bucket name.
- bucket
Arn string - Bucket ARN.
- bucket
Region string - Limits the response to buckets that are located in the specified AWS Region. The AWS Region must be expressed according to the AWS Region code.
- creation
Date string - Bucket creation date.
- name string
- Bucket name.
- bucket_
arn str - Bucket ARN.
- bucket_
region str - Limits the response to buckets that are located in the specified AWS Region. The AWS Region must be expressed according to the AWS Region code.
- creation_
date str - Bucket creation date.
- name str
- Bucket name.
- bucket
Arn String - Bucket ARN.
- bucket
Region String - Limits the response to buckets that are located in the specified AWS Region. The AWS Region must be expressed according to the AWS Region code.
- creation
Date String - Bucket creation date.
- name String
- Bucket name.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.
Viewing docs for AWS v7.39.0
published on Thursday, Jul 23, 2026 by Pulumi
published on Thursday, Jul 23, 2026 by Pulumi