1. Packages
  2. Packages
  3. Ionoscloud
  4. API Docs
  5. objectstorage
  6. getBucket
Viewing docs for IonosCloud v0.3.0
published on Wednesday, Apr 15, 2026 by ionos-cloud
ionoscloud logo
Viewing docs for IonosCloud v0.3.0
published on Wednesday, Apr 15, 2026 by ionos-cloud

    The Bucket data source can be used to search for and return existing buckets. If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned. When this happens, please refine your search string so that it is specific enough to return only one result.

    ⚠️ Note: The Terraform provider only supports contract-owned buckets. User-owned buckets are not supported, and there are no plans to introduce support for them. As a result, user-owned buckets cannot be created, updated, deleted, read, or imported using this provider.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ionoscloud from "@ionos-cloud/sdk-pulumi";
    
    const example = ionoscloud.objectstorage.getBucket({
        name: "example",
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.objectstorage.get_bucket(name="example")
    
    package main
    
    import (
    	"github.com/ionos-cloud/pulumi-ionoscloud/sdk/go/ionoscloud/objectstorage"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := objectstorage.LookupBucket(ctx, &objectstorage.LookupBucketArgs{
    			Name: "example",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ionoscloud = Ionoscloud.Pulumi.Ionoscloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Ionoscloud.Objectstorage.GetBucket.Invoke(new()
        {
            Name = "example",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ionoscloud.objectstorage.ObjectstorageFunctions;
    import com.pulumi.ionoscloud.objectstorage.inputs.GetBucketArgs;
    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 example = ObjectstorageFunctions.getBucket(GetBucketArgs.builder()
                .name("example")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ionoscloud:objectstorage:getBucket
          arguments:
            name: example
    

    Using getBucket

    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 getBucket(args: GetBucketArgs, opts?: InvokeOptions): Promise<GetBucketResult>
    function getBucketOutput(args: GetBucketOutputArgs, opts?: InvokeOptions): Output<GetBucketResult>
    def get_bucket(name: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetBucketResult
    def get_bucket_output(name: pulumi.Input[Optional[str]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetBucketResult]
    func LookupBucket(ctx *Context, args *LookupBucketArgs, opts ...InvokeOption) (*LookupBucketResult, error)
    func LookupBucketOutput(ctx *Context, args *LookupBucketOutputArgs, opts ...InvokeOption) LookupBucketResultOutput

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

    public static class GetBucket 
    {
        public static Task<GetBucketResult> InvokeAsync(GetBucketArgs args, InvokeOptions? opts = null)
        public static Output<GetBucketResult> Invoke(GetBucketInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetBucketResult> getBucket(GetBucketArgs args, InvokeOptions options)
    public static Output<GetBucketResult> getBucket(GetBucketArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ionoscloud:objectstorage/getBucket:getBucket
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    [string] The bucket name. [ 3 .. 63 ] characters
    Name string
    [string] The bucket name. [ 3 .. 63 ] characters
    name String
    [string] The bucket name. [ 3 .. 63 ] characters
    name string
    [string] The bucket name. [ 3 .. 63 ] characters
    name str
    [string] The bucket name. [ 3 .. 63 ] characters
    name String
    [string] The bucket name. [ 3 .. 63 ] characters

    getBucket Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Region string
    The region where the bucket is located.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Region string
    The region where the bucket is located.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    region String
    The region where the bucket is located.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    region string
    The region where the bucket is located.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    region str
    The region where the bucket is located.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    region String
    The region where the bucket is located.

    Package Details

    Repository
    ionoscloud ionos-cloud/pulumi-ionoscloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the ionoscloud Terraform Provider.
    ionoscloud logo
    Viewing docs for IonosCloud v0.3.0
    published on Wednesday, Apr 15, 2026 by ionos-cloud
      Try Pulumi Cloud free. Your team will thank you.