1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. getR2Bucket
Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi

cloudflare.getR2Bucket

Explore with Pulumi AI

cloudflare logo
Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const exampleR2Bucket = cloudflare.getR2Bucket({
        accountId: "023e105f4ecef8ad9ca31a8372d0c353",
        bucketName: "example-bucket",
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example_r2_bucket = cloudflare.get_r2_bucket(account_id="023e105f4ecef8ad9ca31a8372d0c353",
        bucket_name="example-bucket")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-cloudflare/sdk/v6/go/cloudflare"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := cloudflare.LookupR2Bucket(ctx, &cloudflare.LookupR2BucketArgs{
    			AccountId:  "023e105f4ecef8ad9ca31a8372d0c353",
    			BucketName: "example-bucket",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cloudflare = Pulumi.Cloudflare;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleR2Bucket = Cloudflare.GetR2Bucket.Invoke(new()
        {
            AccountId = "023e105f4ecef8ad9ca31a8372d0c353",
            BucketName = "example-bucket",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cloudflare.CloudflareFunctions;
    import com.pulumi.cloudflare.inputs.GetR2BucketArgs;
    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 exampleR2Bucket = CloudflareFunctions.getR2Bucket(GetR2BucketArgs.builder()
                .accountId("023e105f4ecef8ad9ca31a8372d0c353")
                .bucketName("example-bucket")
                .build());
    
        }
    }
    
    variables:
      exampleR2Bucket:
        fn::invoke:
          function: cloudflare:getR2Bucket
          arguments:
            accountId: 023e105f4ecef8ad9ca31a8372d0c353
            bucketName: example-bucket
    

    Using getR2Bucket

    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 getR2Bucket(args: GetR2BucketArgs, opts?: InvokeOptions): Promise<GetR2BucketResult>
    function getR2BucketOutput(args: GetR2BucketOutputArgs, opts?: InvokeOptions): Output<GetR2BucketResult>
    def get_r2_bucket(account_id: Optional[str] = None,
                      bucket_name: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetR2BucketResult
    def get_r2_bucket_output(account_id: Optional[pulumi.Input[str]] = None,
                      bucket_name: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetR2BucketResult]
    func LookupR2Bucket(ctx *Context, args *LookupR2BucketArgs, opts ...InvokeOption) (*LookupR2BucketResult, error)
    func LookupR2BucketOutput(ctx *Context, args *LookupR2BucketOutputArgs, opts ...InvokeOption) LookupR2BucketResultOutput

    > Note: This function is named LookupR2Bucket in the Go SDK.

    public static class GetR2Bucket 
    {
        public static Task<GetR2BucketResult> InvokeAsync(GetR2BucketArgs args, InvokeOptions? opts = null)
        public static Output<GetR2BucketResult> Invoke(GetR2BucketInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetR2BucketResult> getR2Bucket(GetR2BucketArgs args, InvokeOptions options)
    public static Output<GetR2BucketResult> getR2Bucket(GetR2BucketArgs args, InvokeOptions options)
    
    fn::invoke:
      function: cloudflare:index/getR2Bucket:getR2Bucket
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AccountId string
    Account ID
    BucketName string
    Name of the bucket
    AccountId string
    Account ID
    BucketName string
    Name of the bucket
    accountId String
    Account ID
    bucketName String
    Name of the bucket
    accountId string
    Account ID
    bucketName string
    Name of the bucket
    account_id str
    Account ID
    bucket_name str
    Name of the bucket
    accountId String
    Account ID
    bucketName String
    Name of the bucket

    getR2Bucket Result

    The following output properties are available:

    AccountId string
    Account ID
    BucketName string
    Name of the bucket
    CreationDate string
    Creation timestamp
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    Location of the bucket Available values: "apac", "eeur", "enam", "weur", "wnam", "oc".
    Name string
    Name of the bucket
    StorageClass string
    Storage class for newly uploaded objects, unless specified otherwise. Available values: "Standard", "InfrequentAccess".
    AccountId string
    Account ID
    BucketName string
    Name of the bucket
    CreationDate string
    Creation timestamp
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    Location of the bucket Available values: "apac", "eeur", "enam", "weur", "wnam", "oc".
    Name string
    Name of the bucket
    StorageClass string
    Storage class for newly uploaded objects, unless specified otherwise. Available values: "Standard", "InfrequentAccess".
    accountId String
    Account ID
    bucketName String
    Name of the bucket
    creationDate String
    Creation timestamp
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    Location of the bucket Available values: "apac", "eeur", "enam", "weur", "wnam", "oc".
    name String
    Name of the bucket
    storageClass String
    Storage class for newly uploaded objects, unless specified otherwise. Available values: "Standard", "InfrequentAccess".
    accountId string
    Account ID
    bucketName string
    Name of the bucket
    creationDate string
    Creation timestamp
    id string
    The provider-assigned unique ID for this managed resource.
    location string
    Location of the bucket Available values: "apac", "eeur", "enam", "weur", "wnam", "oc".
    name string
    Name of the bucket
    storageClass string
    Storage class for newly uploaded objects, unless specified otherwise. Available values: "Standard", "InfrequentAccess".
    account_id str
    Account ID
    bucket_name str
    Name of the bucket
    creation_date str
    Creation timestamp
    id str
    The provider-assigned unique ID for this managed resource.
    location str
    Location of the bucket Available values: "apac", "eeur", "enam", "weur", "wnam", "oc".
    name str
    Name of the bucket
    storage_class str
    Storage class for newly uploaded objects, unless specified otherwise. Available values: "Standard", "InfrequentAccess".
    accountId String
    Account ID
    bucketName String
    Name of the bucket
    creationDate String
    Creation timestamp
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    Location of the bucket Available values: "apac", "eeur", "enam", "weur", "wnam", "oc".
    name String
    Name of the bucket
    storageClass String
    Storage class for newly uploaded objects, unless specified otherwise. Available values: "Standard", "InfrequentAccess".

    Package Details

    Repository
    Cloudflare pulumi/pulumi-cloudflare
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the cloudflare Terraform Provider.
    cloudflare logo
    Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi