1. Packages
  2. Packages
  3. Ionoscloud
  4. API Docs
  5. objectstorage
  6. getObject
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 Object data source can be used to search for and return existing objects. 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.getObject({
        bucket: "example",
        key: "object",
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.objectstorage.get_object(bucket="example",
        key="object")
    
    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.GetObject(ctx, &objectstorage.GetObjectArgs{
    			Bucket: "example",
    			Key:    "object",
    		}, 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.GetObject.Invoke(new()
        {
            Bucket = "example",
            Key = "object",
        });
    
    });
    
    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.GetObjectArgs;
    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.getObject(GetObjectArgs.builder()
                .bucket("example")
                .key("object")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ionoscloud:objectstorage:getObject
          arguments:
            bucket: example
            key: object
    

    Using getObject

    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 getObject(args: GetObjectArgs, opts?: InvokeOptions): Promise<GetObjectResult>
    function getObjectOutput(args: GetObjectOutputArgs, opts?: InvokeOptions): Output<GetObjectResult>
    def get_object(bucket: Optional[str] = None,
                   key: Optional[str] = None,
                   range: Optional[str] = None,
                   version_id: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetObjectResult
    def get_object_output(bucket: pulumi.Input[Optional[str]] = None,
                   key: pulumi.Input[Optional[str]] = None,
                   range: pulumi.Input[Optional[str]] = None,
                   version_id: pulumi.Input[Optional[str]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetObjectResult]
    func GetObject(ctx *Context, args *GetObjectArgs, opts ...InvokeOption) (*GetObjectResult, error)
    func GetObjectOutput(ctx *Context, args *GetObjectOutputArgs, opts ...InvokeOption) GetObjectResultOutput

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

    public static class GetObject 
    {
        public static Task<GetObjectResult> InvokeAsync(GetObjectArgs args, InvokeOptions? opts = null)
        public static Output<GetObjectResult> Invoke(GetObjectInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetObjectResult> getObject(GetObjectArgs args, InvokeOptions options)
    public static Output<GetObjectResult> getObject(GetObjectArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ionoscloud:objectstorage/getObject:getObject
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Bucket string
    [string] The name of the bucket where the object is stored.
    Key string
    [string] The name of the object.
    Range string
    [string] Downloads the specified range bytes of an object. For more information about the HTTP Range header
    VersionId string
    [string] The version of the object.
    Bucket string
    [string] The name of the bucket where the object is stored.
    Key string
    [string] The name of the object.
    Range string
    [string] Downloads the specified range bytes of an object. For more information about the HTTP Range header
    VersionId string
    [string] The version of the object.
    bucket String
    [string] The name of the bucket where the object is stored.
    key String
    [string] The name of the object.
    range String
    [string] Downloads the specified range bytes of an object. For more information about the HTTP Range header
    versionId String
    [string] The version of the object.
    bucket string
    [string] The name of the bucket where the object is stored.
    key string
    [string] The name of the object.
    range string
    [string] Downloads the specified range bytes of an object. For more information about the HTTP Range header
    versionId string
    [string] The version of the object.
    bucket str
    [string] The name of the bucket where the object is stored.
    key str
    [string] The name of the object.
    range str
    [string] Downloads the specified range bytes of an object. For more information about the HTTP Range header
    version_id str
    [string] The version of the object.
    bucket String
    [string] The name of the bucket where the object is stored.
    key String
    [string] The name of the object.
    range String
    [string] Downloads the specified range bytes of an object. For more information about the HTTP Range header
    versionId String
    [string] The version of the object.

    getObject Result

    The following output properties are available:

    Body string
    The content of the object.
    Bucket string
    CacheControl string
    The caching behavior along the request/reply chain.
    ContentDisposition string
    Presentational information for the object.
    ContentEncoding string
    The content encodings applied to the object.
    ContentLanguage string
    The natural language of the intended audience for the object.
    ContentLength int
    The size of the object in bytes.
    ContentType string
    The MIME type describing the format of the contents.
    Etag string
    An entity tag (ETag) assigned by a web server to a specific version of a resource.
    Expires string
    The date and time at which the object is no longer cacheable.
    Id string
    The provider-assigned unique ID for this managed resource.
    Key string
    Metadata Dictionary<string, string>
    A map of metadata stored with the object.
    ObjectLockLegalHold string
    The legal hold status of the object, which can be either ON or OFF.
    ObjectLockMode string
    The object lock mode, which can be either GOVERNANCE or COMPLIANCE.
    ObjectLockRetainUntilDate string
    The date until which the object will remain locked.
    RequestPayer string
    Confirms that the requester knows that they will be charged for the request.
    ServerSideEncryption string
    The server-side encryption algorithm used when storing this object.
    ServerSideEncryptionContext string
    The encryption context to use for object encryption. This attribute is sensitive.
    ServerSideEncryptionCustomerAlgorithm string
    The algorithm to use for encrypting the object (e.g., AES256).
    ServerSideEncryptionCustomerKey string
    The 256-bit, base64-encoded encryption key to encrypt and decrypt your data. This attribute is sensitive.
    ServerSideEncryptionCustomerKeyMd5 string
    The 128-bit MD5 digest of the encryption key.
    StorageClass string
    The storage class of the object.
    Tags Dictionary<string, string>
    The tag-set for the object, represented as a map of string key-value pairs.
    VersionId string
    The version of the object. This attribute is optional.
    WebsiteRedirect string
    If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL.
    Range string
    Body string
    The content of the object.
    Bucket string
    CacheControl string
    The caching behavior along the request/reply chain.
    ContentDisposition string
    Presentational information for the object.
    ContentEncoding string
    The content encodings applied to the object.
    ContentLanguage string
    The natural language of the intended audience for the object.
    ContentLength int
    The size of the object in bytes.
    ContentType string
    The MIME type describing the format of the contents.
    Etag string
    An entity tag (ETag) assigned by a web server to a specific version of a resource.
    Expires string
    The date and time at which the object is no longer cacheable.
    Id string
    The provider-assigned unique ID for this managed resource.
    Key string
    Metadata map[string]string
    A map of metadata stored with the object.
    ObjectLockLegalHold string
    The legal hold status of the object, which can be either ON or OFF.
    ObjectLockMode string
    The object lock mode, which can be either GOVERNANCE or COMPLIANCE.
    ObjectLockRetainUntilDate string
    The date until which the object will remain locked.
    RequestPayer string
    Confirms that the requester knows that they will be charged for the request.
    ServerSideEncryption string
    The server-side encryption algorithm used when storing this object.
    ServerSideEncryptionContext string
    The encryption context to use for object encryption. This attribute is sensitive.
    ServerSideEncryptionCustomerAlgorithm string
    The algorithm to use for encrypting the object (e.g., AES256).
    ServerSideEncryptionCustomerKey string
    The 256-bit, base64-encoded encryption key to encrypt and decrypt your data. This attribute is sensitive.
    ServerSideEncryptionCustomerKeyMd5 string
    The 128-bit MD5 digest of the encryption key.
    StorageClass string
    The storage class of the object.
    Tags map[string]string
    The tag-set for the object, represented as a map of string key-value pairs.
    VersionId string
    The version of the object. This attribute is optional.
    WebsiteRedirect string
    If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL.
    Range string
    body String
    The content of the object.
    bucket String
    cacheControl String
    The caching behavior along the request/reply chain.
    contentDisposition String
    Presentational information for the object.
    contentEncoding String
    The content encodings applied to the object.
    contentLanguage String
    The natural language of the intended audience for the object.
    contentLength Integer
    The size of the object in bytes.
    contentType String
    The MIME type describing the format of the contents.
    etag String
    An entity tag (ETag) assigned by a web server to a specific version of a resource.
    expires String
    The date and time at which the object is no longer cacheable.
    id String
    The provider-assigned unique ID for this managed resource.
    key String
    metadata Map<String,String>
    A map of metadata stored with the object.
    objectLockLegalHold String
    The legal hold status of the object, which can be either ON or OFF.
    objectLockMode String
    The object lock mode, which can be either GOVERNANCE or COMPLIANCE.
    objectLockRetainUntilDate String
    The date until which the object will remain locked.
    requestPayer String
    Confirms that the requester knows that they will be charged for the request.
    serverSideEncryption String
    The server-side encryption algorithm used when storing this object.
    serverSideEncryptionContext String
    The encryption context to use for object encryption. This attribute is sensitive.
    serverSideEncryptionCustomerAlgorithm String
    The algorithm to use for encrypting the object (e.g., AES256).
    serverSideEncryptionCustomerKey String
    The 256-bit, base64-encoded encryption key to encrypt and decrypt your data. This attribute is sensitive.
    serverSideEncryptionCustomerKeyMd5 String
    The 128-bit MD5 digest of the encryption key.
    storageClass String
    The storage class of the object.
    tags Map<String,String>
    The tag-set for the object, represented as a map of string key-value pairs.
    versionId String
    The version of the object. This attribute is optional.
    websiteRedirect String
    If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL.
    range String
    body string
    The content of the object.
    bucket string
    cacheControl string
    The caching behavior along the request/reply chain.
    contentDisposition string
    Presentational information for the object.
    contentEncoding string
    The content encodings applied to the object.
    contentLanguage string
    The natural language of the intended audience for the object.
    contentLength number
    The size of the object in bytes.
    contentType string
    The MIME type describing the format of the contents.
    etag string
    An entity tag (ETag) assigned by a web server to a specific version of a resource.
    expires string
    The date and time at which the object is no longer cacheable.
    id string
    The provider-assigned unique ID for this managed resource.
    key string
    metadata {[key: string]: string}
    A map of metadata stored with the object.
    objectLockLegalHold string
    The legal hold status of the object, which can be either ON or OFF.
    objectLockMode string
    The object lock mode, which can be either GOVERNANCE or COMPLIANCE.
    objectLockRetainUntilDate string
    The date until which the object will remain locked.
    requestPayer string
    Confirms that the requester knows that they will be charged for the request.
    serverSideEncryption string
    The server-side encryption algorithm used when storing this object.
    serverSideEncryptionContext string
    The encryption context to use for object encryption. This attribute is sensitive.
    serverSideEncryptionCustomerAlgorithm string
    The algorithm to use for encrypting the object (e.g., AES256).
    serverSideEncryptionCustomerKey string
    The 256-bit, base64-encoded encryption key to encrypt and decrypt your data. This attribute is sensitive.
    serverSideEncryptionCustomerKeyMd5 string
    The 128-bit MD5 digest of the encryption key.
    storageClass string
    The storage class of the object.
    tags {[key: string]: string}
    The tag-set for the object, represented as a map of string key-value pairs.
    versionId string
    The version of the object. This attribute is optional.
    websiteRedirect string
    If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL.
    range string
    body str
    The content of the object.
    bucket str
    cache_control str
    The caching behavior along the request/reply chain.
    content_disposition str
    Presentational information for the object.
    content_encoding str
    The content encodings applied to the object.
    content_language str
    The natural language of the intended audience for the object.
    content_length int
    The size of the object in bytes.
    content_type str
    The MIME type describing the format of the contents.
    etag str
    An entity tag (ETag) assigned by a web server to a specific version of a resource.
    expires str
    The date and time at which the object is no longer cacheable.
    id str
    The provider-assigned unique ID for this managed resource.
    key str
    metadata Mapping[str, str]
    A map of metadata stored with the object.
    object_lock_legal_hold str
    The legal hold status of the object, which can be either ON or OFF.
    object_lock_mode str
    The object lock mode, which can be either GOVERNANCE or COMPLIANCE.
    object_lock_retain_until_date str
    The date until which the object will remain locked.
    request_payer str
    Confirms that the requester knows that they will be charged for the request.
    server_side_encryption str
    The server-side encryption algorithm used when storing this object.
    server_side_encryption_context str
    The encryption context to use for object encryption. This attribute is sensitive.
    server_side_encryption_customer_algorithm str
    The algorithm to use for encrypting the object (e.g., AES256).
    server_side_encryption_customer_key str
    The 256-bit, base64-encoded encryption key to encrypt and decrypt your data. This attribute is sensitive.
    server_side_encryption_customer_key_md5 str
    The 128-bit MD5 digest of the encryption key.
    storage_class str
    The storage class of the object.
    tags Mapping[str, str]
    The tag-set for the object, represented as a map of string key-value pairs.
    version_id str
    The version of the object. This attribute is optional.
    website_redirect str
    If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL.
    range str
    body String
    The content of the object.
    bucket String
    cacheControl String
    The caching behavior along the request/reply chain.
    contentDisposition String
    Presentational information for the object.
    contentEncoding String
    The content encodings applied to the object.
    contentLanguage String
    The natural language of the intended audience for the object.
    contentLength Number
    The size of the object in bytes.
    contentType String
    The MIME type describing the format of the contents.
    etag String
    An entity tag (ETag) assigned by a web server to a specific version of a resource.
    expires String
    The date and time at which the object is no longer cacheable.
    id String
    The provider-assigned unique ID for this managed resource.
    key String
    metadata Map<String>
    A map of metadata stored with the object.
    objectLockLegalHold String
    The legal hold status of the object, which can be either ON or OFF.
    objectLockMode String
    The object lock mode, which can be either GOVERNANCE or COMPLIANCE.
    objectLockRetainUntilDate String
    The date until which the object will remain locked.
    requestPayer String
    Confirms that the requester knows that they will be charged for the request.
    serverSideEncryption String
    The server-side encryption algorithm used when storing this object.
    serverSideEncryptionContext String
    The encryption context to use for object encryption. This attribute is sensitive.
    serverSideEncryptionCustomerAlgorithm String
    The algorithm to use for encrypting the object (e.g., AES256).
    serverSideEncryptionCustomerKey String
    The 256-bit, base64-encoded encryption key to encrypt and decrypt your data. This attribute is sensitive.
    serverSideEncryptionCustomerKeyMd5 String
    The 128-bit MD5 digest of the encryption key.
    storageClass String
    The storage class of the object.
    tags Map<String>
    The tag-set for the object, represented as a map of string key-value pairs.
    versionId String
    The version of the object. This attribute is optional.
    websiteRedirect String
    If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL.
    range 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.