1. Packages
  2. Packages
  3. Ionoscloud
  4. API Docs
  5. objectstorage
  6. getObjects
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 Objects data source can be used to search for and return existing objects.

    ⚠️ 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.getObjects({
        bucket: "example",
        prefix: "prefix1/",
        delimiter: "/",
        maxKeys: 100,
        fetchOwner: true,
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.objectstorage.get_objects(bucket="example",
        prefix="prefix1/",
        delimiter="/",
        max_keys=100,
        fetch_owner=True)
    
    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.GetObjects(ctx, &objectstorage.GetObjectsArgs{
    			Bucket:     "example",
    			Prefix:     pulumi.StringRef("prefix1/"),
    			Delimiter:  pulumi.StringRef("/"),
    			MaxKeys:    pulumi.IntRef(100),
    			FetchOwner: pulumi.BoolRef(true),
    		}, 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.GetObjects.Invoke(new()
        {
            Bucket = "example",
            Prefix = "prefix1/",
            Delimiter = "/",
            MaxKeys = 100,
            FetchOwner = true,
        });
    
    });
    
    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.GetObjectsArgs;
    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.getObjects(GetObjectsArgs.builder()
                .bucket("example")
                .prefix("prefix1/")
                .delimiter("/")
                .maxKeys(100)
                .fetchOwner(true)
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ionoscloud:objectstorage:getObjects
          arguments:
            bucket: example
            prefix: prefix1/
            delimiter: /
            maxKeys: 100
            fetchOwner: true
    

    Using getObjects

    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 getObjects(args: GetObjectsArgs, opts?: InvokeOptions): Promise<GetObjectsResult>
    function getObjectsOutput(args: GetObjectsOutputArgs, opts?: InvokeOptions): Output<GetObjectsResult>
    def get_objects(bucket: Optional[str] = None,
                    delimiter: Optional[str] = None,
                    encoding_type: Optional[str] = None,
                    fetch_owner: Optional[bool] = None,
                    max_keys: Optional[int] = None,
                    prefix: Optional[str] = None,
                    start_after: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetObjectsResult
    def get_objects_output(bucket: pulumi.Input[Optional[str]] = None,
                    delimiter: pulumi.Input[Optional[str]] = None,
                    encoding_type: pulumi.Input[Optional[str]] = None,
                    fetch_owner: pulumi.Input[Optional[bool]] = None,
                    max_keys: pulumi.Input[Optional[int]] = None,
                    prefix: pulumi.Input[Optional[str]] = None,
                    start_after: pulumi.Input[Optional[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetObjectsResult]
    func GetObjects(ctx *Context, args *GetObjectsArgs, opts ...InvokeOption) (*GetObjectsResult, error)
    func GetObjectsOutput(ctx *Context, args *GetObjectsOutputArgs, opts ...InvokeOption) GetObjectsResultOutput

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

    public static class GetObjects 
    {
        public static Task<GetObjectsResult> InvokeAsync(GetObjectsArgs args, InvokeOptions? opts = null)
        public static Output<GetObjectsResult> Invoke(GetObjectsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetObjectsResult> getObjects(GetObjectsArgs args, InvokeOptions options)
    public static Output<GetObjectsResult> getObjects(GetObjectsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ionoscloud:objectstorage/getObjects:getObjects
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Bucket string
    [string] The name of the bucket where the objects are stored.
    Delimiter string
    [string] A character used to group keys.
    EncodingType string
    [string] Specifies the encoding method used to encode the object keys in the response. Default is url.
    FetchOwner bool
    [bool] If set to true, the response includes the owner field in the metadata.
    MaxKeys int
    [int] Sets the maximum number of keys returned in the response body.Default is 1000.
    Prefix string
    [string] Limits the response to keys that begin with the specified prefix.
    StartAfter string
    [string] Specifies the key to start after when listing objects in a bucket.
    Bucket string
    [string] The name of the bucket where the objects are stored.
    Delimiter string
    [string] A character used to group keys.
    EncodingType string
    [string] Specifies the encoding method used to encode the object keys in the response. Default is url.
    FetchOwner bool
    [bool] If set to true, the response includes the owner field in the metadata.
    MaxKeys int
    [int] Sets the maximum number of keys returned in the response body.Default is 1000.
    Prefix string
    [string] Limits the response to keys that begin with the specified prefix.
    StartAfter string
    [string] Specifies the key to start after when listing objects in a bucket.
    bucket String
    [string] The name of the bucket where the objects are stored.
    delimiter String
    [string] A character used to group keys.
    encodingType String
    [string] Specifies the encoding method used to encode the object keys in the response. Default is url.
    fetchOwner Boolean
    [bool] If set to true, the response includes the owner field in the metadata.
    maxKeys Integer
    [int] Sets the maximum number of keys returned in the response body.Default is 1000.
    prefix String
    [string] Limits the response to keys that begin with the specified prefix.
    startAfter String
    [string] Specifies the key to start after when listing objects in a bucket.
    bucket string
    [string] The name of the bucket where the objects are stored.
    delimiter string
    [string] A character used to group keys.
    encodingType string
    [string] Specifies the encoding method used to encode the object keys in the response. Default is url.
    fetchOwner boolean
    [bool] If set to true, the response includes the owner field in the metadata.
    maxKeys number
    [int] Sets the maximum number of keys returned in the response body.Default is 1000.
    prefix string
    [string] Limits the response to keys that begin with the specified prefix.
    startAfter string
    [string] Specifies the key to start after when listing objects in a bucket.
    bucket str
    [string] The name of the bucket where the objects are stored.
    delimiter str
    [string] A character used to group keys.
    encoding_type str
    [string] Specifies the encoding method used to encode the object keys in the response. Default is url.
    fetch_owner bool
    [bool] If set to true, the response includes the owner field in the metadata.
    max_keys int
    [int] Sets the maximum number of keys returned in the response body.Default is 1000.
    prefix str
    [string] Limits the response to keys that begin with the specified prefix.
    start_after str
    [string] Specifies the key to start after when listing objects in a bucket.
    bucket String
    [string] The name of the bucket where the objects are stored.
    delimiter String
    [string] A character used to group keys.
    encodingType String
    [string] Specifies the encoding method used to encode the object keys in the response. Default is url.
    fetchOwner Boolean
    [bool] If set to true, the response includes the owner field in the metadata.
    maxKeys Number
    [int] Sets the maximum number of keys returned in the response body.Default is 1000.
    prefix String
    [string] Limits the response to keys that begin with the specified prefix.
    startAfter String
    [string] Specifies the key to start after when listing objects in a bucket.

    getObjects Result

    The following output properties are available:

    Bucket string
    CommonPrefixes List<string>
    A list of keys that act as a delimiter for grouping keys.
    Id string
    The provider-assigned unique ID for this managed resource.
    Keys List<string>
    A list of objects in the bucket.
    Owners List<string>
    Delimiter string
    EncodingType string
    FetchOwner bool
    MaxKeys int
    Prefix string
    StartAfter string
    Bucket string
    CommonPrefixes []string
    A list of keys that act as a delimiter for grouping keys.
    Id string
    The provider-assigned unique ID for this managed resource.
    Keys []string
    A list of objects in the bucket.
    Owners []string
    Delimiter string
    EncodingType string
    FetchOwner bool
    MaxKeys int
    Prefix string
    StartAfter string
    bucket String
    commonPrefixes List<String>
    A list of keys that act as a delimiter for grouping keys.
    id String
    The provider-assigned unique ID for this managed resource.
    keys List<String>
    A list of objects in the bucket.
    owners List<String>
    delimiter String
    encodingType String
    fetchOwner Boolean
    maxKeys Integer
    prefix String
    startAfter String
    bucket string
    commonPrefixes string[]
    A list of keys that act as a delimiter for grouping keys.
    id string
    The provider-assigned unique ID for this managed resource.
    keys string[]
    A list of objects in the bucket.
    owners string[]
    delimiter string
    encodingType string
    fetchOwner boolean
    maxKeys number
    prefix string
    startAfter string
    bucket str
    common_prefixes Sequence[str]
    A list of keys that act as a delimiter for grouping keys.
    id str
    The provider-assigned unique ID for this managed resource.
    keys Sequence[str]
    A list of objects in the bucket.
    owners Sequence[str]
    delimiter str
    encoding_type str
    fetch_owner bool
    max_keys int
    prefix str
    start_after str
    bucket String
    commonPrefixes List<String>
    A list of keys that act as a delimiter for grouping keys.
    id String
    The provider-assigned unique ID for this managed resource.
    keys List<String>
    A list of objects in the bucket.
    owners List<String>
    delimiter String
    encodingType String
    fetchOwner Boolean
    maxKeys Number
    prefix String
    startAfter String

    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.