1. Packages
  2. Ibm Provider
  3. API Docs
  4. CosBucketObject
ibm 1.77.1 published on Monday, Apr 14, 2025 by ibm-cloud

ibm.CosBucketObject

Explore with Pulumi AI

ibm logo
ibm 1.77.1 published on Monday, Apr 14, 2025 by ibm-cloud

    Create, update, or delete an object in an IBM Cloud Object Storage bucket. For more information, about an IBM Cloud Object Storage bucket, see Create some buckets to store your data.

    Additional Examples

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const cosObjectObjectlock = new ibm.CosBucketObject("cosObjectObjectlock", {
        bucketCrn: "bucket-crn",
        bucketLocation: "us-south",
        key: "page1.html",
        websiteRedirect: "/page2.html",
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    cos_object_objectlock = ibm.CosBucketObject("cosObjectObjectlock",
        bucket_crn="bucket-crn",
        bucket_location="us-south",
        key="page1.html",
        website_redirect="/page2.html")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.NewCosBucketObject(ctx, "cosObjectObjectlock", &ibm.CosBucketObjectArgs{
    			BucketCrn:       pulumi.String("bucket-crn"),
    			BucketLocation:  pulumi.String("us-south"),
    			Key:             pulumi.String("page1.html"),
    			WebsiteRedirect: pulumi.String("/page2.html"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var cosObjectObjectlock = new Ibm.CosBucketObject("cosObjectObjectlock", new()
        {
            BucketCrn = "bucket-crn",
            BucketLocation = "us-south",
            Key = "page1.html",
            WebsiteRedirect = "/page2.html",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.CosBucketObject;
    import com.pulumi.ibm.CosBucketObjectArgs;
    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) {
            var cosObjectObjectlock = new CosBucketObject("cosObjectObjectlock", CosBucketObjectArgs.builder()
                .bucketCrn("bucket-crn")
                .bucketLocation("us-south")
                .key("page1.html")
                .websiteRedirect("/page2.html")
                .build());
    
        }
    }
    
    resources:
      cosObjectObjectlock:
        type: ibm:CosBucketObject
        properties:
          bucketCrn: bucket-crn
          bucketLocation: us-south
          key: page1.html
          websiteRedirect: /page2.html
    

    Create CosBucketObject Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new CosBucketObject(name: string, args: CosBucketObjectArgs, opts?: CustomResourceOptions);
    @overload
    def CosBucketObject(resource_name: str,
                        args: CosBucketObjectArgs,
                        opts: Optional[ResourceOptions] = None)
    
    @overload
    def CosBucketObject(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        bucket_crn: Optional[str] = None,
                        bucket_location: Optional[str] = None,
                        key: Optional[str] = None,
                        content_base64: Optional[str] = None,
                        content_file: Optional[str] = None,
                        cos_bucket_object_id: Optional[str] = None,
                        endpoint_type: Optional[str] = None,
                        etag: Optional[str] = None,
                        force_delete: Optional[bool] = None,
                        content: Optional[str] = None,
                        object_lock_legal_hold_status: Optional[str] = None,
                        object_lock_mode: Optional[str] = None,
                        object_lock_retain_until_date: Optional[str] = None,
                        timeouts: Optional[CosBucketObjectTimeoutsArgs] = None,
                        website_redirect: Optional[str] = None)
    func NewCosBucketObject(ctx *Context, name string, args CosBucketObjectArgs, opts ...ResourceOption) (*CosBucketObject, error)
    public CosBucketObject(string name, CosBucketObjectArgs args, CustomResourceOptions? opts = null)
    public CosBucketObject(String name, CosBucketObjectArgs args)
    public CosBucketObject(String name, CosBucketObjectArgs args, CustomResourceOptions options)
    
    type: ibm:CosBucketObject
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args CosBucketObjectArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args CosBucketObjectArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args CosBucketObjectArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CosBucketObjectArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CosBucketObjectArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var cosBucketObjectResource = new Ibm.CosBucketObject("cosBucketObjectResource", new()
    {
        BucketCrn = "string",
        BucketLocation = "string",
        Key = "string",
        ContentBase64 = "string",
        ContentFile = "string",
        CosBucketObjectId = "string",
        EndpointType = "string",
        Etag = "string",
        ForceDelete = false,
        Content = "string",
        ObjectLockLegalHoldStatus = "string",
        ObjectLockMode = "string",
        ObjectLockRetainUntilDate = "string",
        Timeouts = new Ibm.Inputs.CosBucketObjectTimeoutsArgs
        {
            Create = "string",
            Delete = "string",
            Update = "string",
        },
        WebsiteRedirect = "string",
    });
    
    example, err := ibm.NewCosBucketObject(ctx, "cosBucketObjectResource", &ibm.CosBucketObjectArgs{
    	BucketCrn:                 pulumi.String("string"),
    	BucketLocation:            pulumi.String("string"),
    	Key:                       pulumi.String("string"),
    	ContentBase64:             pulumi.String("string"),
    	ContentFile:               pulumi.String("string"),
    	CosBucketObjectId:         pulumi.String("string"),
    	EndpointType:              pulumi.String("string"),
    	Etag:                      pulumi.String("string"),
    	ForceDelete:               pulumi.Bool(false),
    	Content:                   pulumi.String("string"),
    	ObjectLockLegalHoldStatus: pulumi.String("string"),
    	ObjectLockMode:            pulumi.String("string"),
    	ObjectLockRetainUntilDate: pulumi.String("string"),
    	Timeouts: &ibm.CosBucketObjectTimeoutsArgs{
    		Create: pulumi.String("string"),
    		Delete: pulumi.String("string"),
    		Update: pulumi.String("string"),
    	},
    	WebsiteRedirect: pulumi.String("string"),
    })
    
    var cosBucketObjectResource = new CosBucketObject("cosBucketObjectResource", CosBucketObjectArgs.builder()
        .bucketCrn("string")
        .bucketLocation("string")
        .key("string")
        .contentBase64("string")
        .contentFile("string")
        .cosBucketObjectId("string")
        .endpointType("string")
        .etag("string")
        .forceDelete(false)
        .content("string")
        .objectLockLegalHoldStatus("string")
        .objectLockMode("string")
        .objectLockRetainUntilDate("string")
        .timeouts(CosBucketObjectTimeoutsArgs.builder()
            .create("string")
            .delete("string")
            .update("string")
            .build())
        .websiteRedirect("string")
        .build());
    
    cos_bucket_object_resource = ibm.CosBucketObject("cosBucketObjectResource",
        bucket_crn="string",
        bucket_location="string",
        key="string",
        content_base64="string",
        content_file="string",
        cos_bucket_object_id="string",
        endpoint_type="string",
        etag="string",
        force_delete=False,
        content="string",
        object_lock_legal_hold_status="string",
        object_lock_mode="string",
        object_lock_retain_until_date="string",
        timeouts={
            "create": "string",
            "delete": "string",
            "update": "string",
        },
        website_redirect="string")
    
    const cosBucketObjectResource = new ibm.CosBucketObject("cosBucketObjectResource", {
        bucketCrn: "string",
        bucketLocation: "string",
        key: "string",
        contentBase64: "string",
        contentFile: "string",
        cosBucketObjectId: "string",
        endpointType: "string",
        etag: "string",
        forceDelete: false,
        content: "string",
        objectLockLegalHoldStatus: "string",
        objectLockMode: "string",
        objectLockRetainUntilDate: "string",
        timeouts: {
            create: "string",
            "delete": "string",
            update: "string",
        },
        websiteRedirect: "string",
    });
    
    type: ibm:CosBucketObject
    properties:
        bucketCrn: string
        bucketLocation: string
        content: string
        contentBase64: string
        contentFile: string
        cosBucketObjectId: string
        endpointType: string
        etag: string
        forceDelete: false
        key: string
        objectLockLegalHoldStatus: string
        objectLockMode: string
        objectLockRetainUntilDate: string
        timeouts:
            create: string
            delete: string
            update: string
        websiteRedirect: string
    

    CosBucketObject Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The CosBucketObject resource accepts the following input properties:

    BucketCrn string
    The CRN of the COS bucket.
    BucketLocation string
    The location of the COS bucket.
    Key string
    The name of an object in the COS bucket.
    Content string
    Literal string value to use as an object content, which will be uploaded as UTF-8 encoded text. Conflicts with content_base64 and content_file.
    ContentBase64 string
    Base64-encoded data that will be decoded and uploaded as raw bytes for an object content. This safely uploads non-UTF8 binary data, but is recommended only for small content. Conflicts with content and content_file.
    ContentFile string
    The path to a file that will be read and uploaded as raw bytes for an object content. Conflicts with content and content_base64.
    CosBucketObjectId string
    (String) The ID of an object.
    EndpointType string
    The type of endpoint used to access COS. Supported values are public, private, or direct. Default value is public.
    Etag string
    MD5 hexdigest used to trigger updates. The only meaningful value is filemd5("path/to/file").
    ForceDelete bool
    COS buckets need to be empty before they can be deleted. force_delete option empty the bucket and delete it.
    ObjectLockLegalHoldStatus string
    An object lock configuration on the object, the valid states are ON/OFF. When ON prevents deletion of the object version.
    ObjectLockMode string
    Retention modes apply different levels of protection to the objects.
    ObjectLockRetainUntilDate string
    An object cannot be deleted when the current time is earlier than the retainUntilDate. After this date, the object can be deleted.
    Timeouts CosBucketObjectTimeouts
    WebsiteRedirect string
    Target URL for website redirect.
    BucketCrn string
    The CRN of the COS bucket.
    BucketLocation string
    The location of the COS bucket.
    Key string
    The name of an object in the COS bucket.
    Content string
    Literal string value to use as an object content, which will be uploaded as UTF-8 encoded text. Conflicts with content_base64 and content_file.
    ContentBase64 string
    Base64-encoded data that will be decoded and uploaded as raw bytes for an object content. This safely uploads non-UTF8 binary data, but is recommended only for small content. Conflicts with content and content_file.
    ContentFile string
    The path to a file that will be read and uploaded as raw bytes for an object content. Conflicts with content and content_base64.
    CosBucketObjectId string
    (String) The ID of an object.
    EndpointType string
    The type of endpoint used to access COS. Supported values are public, private, or direct. Default value is public.
    Etag string
    MD5 hexdigest used to trigger updates. The only meaningful value is filemd5("path/to/file").
    ForceDelete bool
    COS buckets need to be empty before they can be deleted. force_delete option empty the bucket and delete it.
    ObjectLockLegalHoldStatus string
    An object lock configuration on the object, the valid states are ON/OFF. When ON prevents deletion of the object version.
    ObjectLockMode string
    Retention modes apply different levels of protection to the objects.
    ObjectLockRetainUntilDate string
    An object cannot be deleted when the current time is earlier than the retainUntilDate. After this date, the object can be deleted.
    Timeouts CosBucketObjectTimeoutsArgs
    WebsiteRedirect string
    Target URL for website redirect.
    bucketCrn String
    The CRN of the COS bucket.
    bucketLocation String
    The location of the COS bucket.
    key String
    The name of an object in the COS bucket.
    content String
    Literal string value to use as an object content, which will be uploaded as UTF-8 encoded text. Conflicts with content_base64 and content_file.
    contentBase64 String
    Base64-encoded data that will be decoded and uploaded as raw bytes for an object content. This safely uploads non-UTF8 binary data, but is recommended only for small content. Conflicts with content and content_file.
    contentFile String
    The path to a file that will be read and uploaded as raw bytes for an object content. Conflicts with content and content_base64.
    cosBucketObjectId String
    (String) The ID of an object.
    endpointType String
    The type of endpoint used to access COS. Supported values are public, private, or direct. Default value is public.
    etag String
    MD5 hexdigest used to trigger updates. The only meaningful value is filemd5("path/to/file").
    forceDelete Boolean
    COS buckets need to be empty before they can be deleted. force_delete option empty the bucket and delete it.
    objectLockLegalHoldStatus String
    An object lock configuration on the object, the valid states are ON/OFF. When ON prevents deletion of the object version.
    objectLockMode String
    Retention modes apply different levels of protection to the objects.
    objectLockRetainUntilDate String
    An object cannot be deleted when the current time is earlier than the retainUntilDate. After this date, the object can be deleted.
    timeouts CosBucketObjectTimeouts
    websiteRedirect String
    Target URL for website redirect.
    bucketCrn string
    The CRN of the COS bucket.
    bucketLocation string
    The location of the COS bucket.
    key string
    The name of an object in the COS bucket.
    content string
    Literal string value to use as an object content, which will be uploaded as UTF-8 encoded text. Conflicts with content_base64 and content_file.
    contentBase64 string
    Base64-encoded data that will be decoded and uploaded as raw bytes for an object content. This safely uploads non-UTF8 binary data, but is recommended only for small content. Conflicts with content and content_file.
    contentFile string
    The path to a file that will be read and uploaded as raw bytes for an object content. Conflicts with content and content_base64.
    cosBucketObjectId string
    (String) The ID of an object.
    endpointType string
    The type of endpoint used to access COS. Supported values are public, private, or direct. Default value is public.
    etag string
    MD5 hexdigest used to trigger updates. The only meaningful value is filemd5("path/to/file").
    forceDelete boolean
    COS buckets need to be empty before they can be deleted. force_delete option empty the bucket and delete it.
    objectLockLegalHoldStatus string
    An object lock configuration on the object, the valid states are ON/OFF. When ON prevents deletion of the object version.
    objectLockMode string
    Retention modes apply different levels of protection to the objects.
    objectLockRetainUntilDate string
    An object cannot be deleted when the current time is earlier than the retainUntilDate. After this date, the object can be deleted.
    timeouts CosBucketObjectTimeouts
    websiteRedirect string
    Target URL for website redirect.
    bucket_crn str
    The CRN of the COS bucket.
    bucket_location str
    The location of the COS bucket.
    key str
    The name of an object in the COS bucket.
    content str
    Literal string value to use as an object content, which will be uploaded as UTF-8 encoded text. Conflicts with content_base64 and content_file.
    content_base64 str
    Base64-encoded data that will be decoded and uploaded as raw bytes for an object content. This safely uploads non-UTF8 binary data, but is recommended only for small content. Conflicts with content and content_file.
    content_file str
    The path to a file that will be read and uploaded as raw bytes for an object content. Conflicts with content and content_base64.
    cos_bucket_object_id str
    (String) The ID of an object.
    endpoint_type str
    The type of endpoint used to access COS. Supported values are public, private, or direct. Default value is public.
    etag str
    MD5 hexdigest used to trigger updates. The only meaningful value is filemd5("path/to/file").
    force_delete bool
    COS buckets need to be empty before they can be deleted. force_delete option empty the bucket and delete it.
    object_lock_legal_hold_status str
    An object lock configuration on the object, the valid states are ON/OFF. When ON prevents deletion of the object version.
    object_lock_mode str
    Retention modes apply different levels of protection to the objects.
    object_lock_retain_until_date str
    An object cannot be deleted when the current time is earlier than the retainUntilDate. After this date, the object can be deleted.
    timeouts CosBucketObjectTimeoutsArgs
    website_redirect str
    Target URL for website redirect.
    bucketCrn String
    The CRN of the COS bucket.
    bucketLocation String
    The location of the COS bucket.
    key String
    The name of an object in the COS bucket.
    content String
    Literal string value to use as an object content, which will be uploaded as UTF-8 encoded text. Conflicts with content_base64 and content_file.
    contentBase64 String
    Base64-encoded data that will be decoded and uploaded as raw bytes for an object content. This safely uploads non-UTF8 binary data, but is recommended only for small content. Conflicts with content and content_file.
    contentFile String
    The path to a file that will be read and uploaded as raw bytes for an object content. Conflicts with content and content_base64.
    cosBucketObjectId String
    (String) The ID of an object.
    endpointType String
    The type of endpoint used to access COS. Supported values are public, private, or direct. Default value is public.
    etag String
    MD5 hexdigest used to trigger updates. The only meaningful value is filemd5("path/to/file").
    forceDelete Boolean
    COS buckets need to be empty before they can be deleted. force_delete option empty the bucket and delete it.
    objectLockLegalHoldStatus String
    An object lock configuration on the object, the valid states are ON/OFF. When ON prevents deletion of the object version.
    objectLockMode String
    Retention modes apply different levels of protection to the objects.
    objectLockRetainUntilDate String
    An object cannot be deleted when the current time is earlier than the retainUntilDate. After this date, the object can be deleted.
    timeouts Property Map
    websiteRedirect String
    Target URL for website redirect.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the CosBucketObject resource produces the following output properties:

    Body string
    (String) Literal string value of an object content. Only supported for text/* and application/json content types.
    ContentLength double
    (String) A standard MIME type describing the format of an object data.
    ContentType string
    (String) A standard MIME type describing the format of an object data.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastModified string
    (Timestamp) Last modified date of an object. A GMT formatted date.
    ObjectSqlUrl string
    (String) Access the object using an SQL Query instance. The SQL URL is a reference url used inside of an SQL statement. The reference url is used to perform queries against objects storing structured data.
    VersionId string
    Body string
    (String) Literal string value of an object content. Only supported for text/* and application/json content types.
    ContentLength float64
    (String) A standard MIME type describing the format of an object data.
    ContentType string
    (String) A standard MIME type describing the format of an object data.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastModified string
    (Timestamp) Last modified date of an object. A GMT formatted date.
    ObjectSqlUrl string
    (String) Access the object using an SQL Query instance. The SQL URL is a reference url used inside of an SQL statement. The reference url is used to perform queries against objects storing structured data.
    VersionId string
    body String
    (String) Literal string value of an object content. Only supported for text/* and application/json content types.
    contentLength Double
    (String) A standard MIME type describing the format of an object data.
    contentType String
    (String) A standard MIME type describing the format of an object data.
    id String
    The provider-assigned unique ID for this managed resource.
    lastModified String
    (Timestamp) Last modified date of an object. A GMT formatted date.
    objectSqlUrl String
    (String) Access the object using an SQL Query instance. The SQL URL is a reference url used inside of an SQL statement. The reference url is used to perform queries against objects storing structured data.
    versionId String
    body string
    (String) Literal string value of an object content. Only supported for text/* and application/json content types.
    contentLength number
    (String) A standard MIME type describing the format of an object data.
    contentType string
    (String) A standard MIME type describing the format of an object data.
    id string
    The provider-assigned unique ID for this managed resource.
    lastModified string
    (Timestamp) Last modified date of an object. A GMT formatted date.
    objectSqlUrl string
    (String) Access the object using an SQL Query instance. The SQL URL is a reference url used inside of an SQL statement. The reference url is used to perform queries against objects storing structured data.
    versionId string
    body str
    (String) Literal string value of an object content. Only supported for text/* and application/json content types.
    content_length float
    (String) A standard MIME type describing the format of an object data.
    content_type str
    (String) A standard MIME type describing the format of an object data.
    id str
    The provider-assigned unique ID for this managed resource.
    last_modified str
    (Timestamp) Last modified date of an object. A GMT formatted date.
    object_sql_url str
    (String) Access the object using an SQL Query instance. The SQL URL is a reference url used inside of an SQL statement. The reference url is used to perform queries against objects storing structured data.
    version_id str
    body String
    (String) Literal string value of an object content. Only supported for text/* and application/json content types.
    contentLength Number
    (String) A standard MIME type describing the format of an object data.
    contentType String
    (String) A standard MIME type describing the format of an object data.
    id String
    The provider-assigned unique ID for this managed resource.
    lastModified String
    (Timestamp) Last modified date of an object. A GMT formatted date.
    objectSqlUrl String
    (String) Access the object using an SQL Query instance. The SQL URL is a reference url used inside of an SQL statement. The reference url is used to perform queries against objects storing structured data.
    versionId String

    Look up Existing CosBucketObject Resource

    Get an existing CosBucketObject resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: CosBucketObjectState, opts?: CustomResourceOptions): CosBucketObject
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            body: Optional[str] = None,
            bucket_crn: Optional[str] = None,
            bucket_location: Optional[str] = None,
            content: Optional[str] = None,
            content_base64: Optional[str] = None,
            content_file: Optional[str] = None,
            content_length: Optional[float] = None,
            content_type: Optional[str] = None,
            cos_bucket_object_id: Optional[str] = None,
            endpoint_type: Optional[str] = None,
            etag: Optional[str] = None,
            force_delete: Optional[bool] = None,
            key: Optional[str] = None,
            last_modified: Optional[str] = None,
            object_lock_legal_hold_status: Optional[str] = None,
            object_lock_mode: Optional[str] = None,
            object_lock_retain_until_date: Optional[str] = None,
            object_sql_url: Optional[str] = None,
            timeouts: Optional[CosBucketObjectTimeoutsArgs] = None,
            version_id: Optional[str] = None,
            website_redirect: Optional[str] = None) -> CosBucketObject
    func GetCosBucketObject(ctx *Context, name string, id IDInput, state *CosBucketObjectState, opts ...ResourceOption) (*CosBucketObject, error)
    public static CosBucketObject Get(string name, Input<string> id, CosBucketObjectState? state, CustomResourceOptions? opts = null)
    public static CosBucketObject get(String name, Output<String> id, CosBucketObjectState state, CustomResourceOptions options)
    resources:  _:    type: ibm:CosBucketObject    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Body string
    (String) Literal string value of an object content. Only supported for text/* and application/json content types.
    BucketCrn string
    The CRN of the COS bucket.
    BucketLocation string
    The location of the COS bucket.
    Content string
    Literal string value to use as an object content, which will be uploaded as UTF-8 encoded text. Conflicts with content_base64 and content_file.
    ContentBase64 string
    Base64-encoded data that will be decoded and uploaded as raw bytes for an object content. This safely uploads non-UTF8 binary data, but is recommended only for small content. Conflicts with content and content_file.
    ContentFile string
    The path to a file that will be read and uploaded as raw bytes for an object content. Conflicts with content and content_base64.
    ContentLength double
    (String) A standard MIME type describing the format of an object data.
    ContentType string
    (String) A standard MIME type describing the format of an object data.
    CosBucketObjectId string
    (String) The ID of an object.
    EndpointType string
    The type of endpoint used to access COS. Supported values are public, private, or direct. Default value is public.
    Etag string
    MD5 hexdigest used to trigger updates. The only meaningful value is filemd5("path/to/file").
    ForceDelete bool
    COS buckets need to be empty before they can be deleted. force_delete option empty the bucket and delete it.
    Key string
    The name of an object in the COS bucket.
    LastModified string
    (Timestamp) Last modified date of an object. A GMT formatted date.
    ObjectLockLegalHoldStatus string
    An object lock configuration on the object, the valid states are ON/OFF. When ON prevents deletion of the object version.
    ObjectLockMode string
    Retention modes apply different levels of protection to the objects.
    ObjectLockRetainUntilDate string
    An object cannot be deleted when the current time is earlier than the retainUntilDate. After this date, the object can be deleted.
    ObjectSqlUrl string
    (String) Access the object using an SQL Query instance. The SQL URL is a reference url used inside of an SQL statement. The reference url is used to perform queries against objects storing structured data.
    Timeouts CosBucketObjectTimeouts
    VersionId string
    WebsiteRedirect string
    Target URL for website redirect.
    Body string
    (String) Literal string value of an object content. Only supported for text/* and application/json content types.
    BucketCrn string
    The CRN of the COS bucket.
    BucketLocation string
    The location of the COS bucket.
    Content string
    Literal string value to use as an object content, which will be uploaded as UTF-8 encoded text. Conflicts with content_base64 and content_file.
    ContentBase64 string
    Base64-encoded data that will be decoded and uploaded as raw bytes for an object content. This safely uploads non-UTF8 binary data, but is recommended only for small content. Conflicts with content and content_file.
    ContentFile string
    The path to a file that will be read and uploaded as raw bytes for an object content. Conflicts with content and content_base64.
    ContentLength float64
    (String) A standard MIME type describing the format of an object data.
    ContentType string
    (String) A standard MIME type describing the format of an object data.
    CosBucketObjectId string
    (String) The ID of an object.
    EndpointType string
    The type of endpoint used to access COS. Supported values are public, private, or direct. Default value is public.
    Etag string
    MD5 hexdigest used to trigger updates. The only meaningful value is filemd5("path/to/file").
    ForceDelete bool
    COS buckets need to be empty before they can be deleted. force_delete option empty the bucket and delete it.
    Key string
    The name of an object in the COS bucket.
    LastModified string
    (Timestamp) Last modified date of an object. A GMT formatted date.
    ObjectLockLegalHoldStatus string
    An object lock configuration on the object, the valid states are ON/OFF. When ON prevents deletion of the object version.
    ObjectLockMode string
    Retention modes apply different levels of protection to the objects.
    ObjectLockRetainUntilDate string
    An object cannot be deleted when the current time is earlier than the retainUntilDate. After this date, the object can be deleted.
    ObjectSqlUrl string
    (String) Access the object using an SQL Query instance. The SQL URL is a reference url used inside of an SQL statement. The reference url is used to perform queries against objects storing structured data.
    Timeouts CosBucketObjectTimeoutsArgs
    VersionId string
    WebsiteRedirect string
    Target URL for website redirect.
    body String
    (String) Literal string value of an object content. Only supported for text/* and application/json content types.
    bucketCrn String
    The CRN of the COS bucket.
    bucketLocation String
    The location of the COS bucket.
    content String
    Literal string value to use as an object content, which will be uploaded as UTF-8 encoded text. Conflicts with content_base64 and content_file.
    contentBase64 String
    Base64-encoded data that will be decoded and uploaded as raw bytes for an object content. This safely uploads non-UTF8 binary data, but is recommended only for small content. Conflicts with content and content_file.
    contentFile String
    The path to a file that will be read and uploaded as raw bytes for an object content. Conflicts with content and content_base64.
    contentLength Double
    (String) A standard MIME type describing the format of an object data.
    contentType String
    (String) A standard MIME type describing the format of an object data.
    cosBucketObjectId String
    (String) The ID of an object.
    endpointType String
    The type of endpoint used to access COS. Supported values are public, private, or direct. Default value is public.
    etag String
    MD5 hexdigest used to trigger updates. The only meaningful value is filemd5("path/to/file").
    forceDelete Boolean
    COS buckets need to be empty before they can be deleted. force_delete option empty the bucket and delete it.
    key String
    The name of an object in the COS bucket.
    lastModified String
    (Timestamp) Last modified date of an object. A GMT formatted date.
    objectLockLegalHoldStatus String
    An object lock configuration on the object, the valid states are ON/OFF. When ON prevents deletion of the object version.
    objectLockMode String
    Retention modes apply different levels of protection to the objects.
    objectLockRetainUntilDate String
    An object cannot be deleted when the current time is earlier than the retainUntilDate. After this date, the object can be deleted.
    objectSqlUrl String
    (String) Access the object using an SQL Query instance. The SQL URL is a reference url used inside of an SQL statement. The reference url is used to perform queries against objects storing structured data.
    timeouts CosBucketObjectTimeouts
    versionId String
    websiteRedirect String
    Target URL for website redirect.
    body string
    (String) Literal string value of an object content. Only supported for text/* and application/json content types.
    bucketCrn string
    The CRN of the COS bucket.
    bucketLocation string
    The location of the COS bucket.
    content string
    Literal string value to use as an object content, which will be uploaded as UTF-8 encoded text. Conflicts with content_base64 and content_file.
    contentBase64 string
    Base64-encoded data that will be decoded and uploaded as raw bytes for an object content. This safely uploads non-UTF8 binary data, but is recommended only for small content. Conflicts with content and content_file.
    contentFile string
    The path to a file that will be read and uploaded as raw bytes for an object content. Conflicts with content and content_base64.
    contentLength number
    (String) A standard MIME type describing the format of an object data.
    contentType string
    (String) A standard MIME type describing the format of an object data.
    cosBucketObjectId string
    (String) The ID of an object.
    endpointType string
    The type of endpoint used to access COS. Supported values are public, private, or direct. Default value is public.
    etag string
    MD5 hexdigest used to trigger updates. The only meaningful value is filemd5("path/to/file").
    forceDelete boolean
    COS buckets need to be empty before they can be deleted. force_delete option empty the bucket and delete it.
    key string
    The name of an object in the COS bucket.
    lastModified string
    (Timestamp) Last modified date of an object. A GMT formatted date.
    objectLockLegalHoldStatus string
    An object lock configuration on the object, the valid states are ON/OFF. When ON prevents deletion of the object version.
    objectLockMode string
    Retention modes apply different levels of protection to the objects.
    objectLockRetainUntilDate string
    An object cannot be deleted when the current time is earlier than the retainUntilDate. After this date, the object can be deleted.
    objectSqlUrl string
    (String) Access the object using an SQL Query instance. The SQL URL is a reference url used inside of an SQL statement. The reference url is used to perform queries against objects storing structured data.
    timeouts CosBucketObjectTimeouts
    versionId string
    websiteRedirect string
    Target URL for website redirect.
    body str
    (String) Literal string value of an object content. Only supported for text/* and application/json content types.
    bucket_crn str
    The CRN of the COS bucket.
    bucket_location str
    The location of the COS bucket.
    content str
    Literal string value to use as an object content, which will be uploaded as UTF-8 encoded text. Conflicts with content_base64 and content_file.
    content_base64 str
    Base64-encoded data that will be decoded and uploaded as raw bytes for an object content. This safely uploads non-UTF8 binary data, but is recommended only for small content. Conflicts with content and content_file.
    content_file str
    The path to a file that will be read and uploaded as raw bytes for an object content. Conflicts with content and content_base64.
    content_length float
    (String) A standard MIME type describing the format of an object data.
    content_type str
    (String) A standard MIME type describing the format of an object data.
    cos_bucket_object_id str
    (String) The ID of an object.
    endpoint_type str
    The type of endpoint used to access COS. Supported values are public, private, or direct. Default value is public.
    etag str
    MD5 hexdigest used to trigger updates. The only meaningful value is filemd5("path/to/file").
    force_delete bool
    COS buckets need to be empty before they can be deleted. force_delete option empty the bucket and delete it.
    key str
    The name of an object in the COS bucket.
    last_modified str
    (Timestamp) Last modified date of an object. A GMT formatted date.
    object_lock_legal_hold_status str
    An object lock configuration on the object, the valid states are ON/OFF. When ON prevents deletion of the object version.
    object_lock_mode str
    Retention modes apply different levels of protection to the objects.
    object_lock_retain_until_date str
    An object cannot be deleted when the current time is earlier than the retainUntilDate. After this date, the object can be deleted.
    object_sql_url str
    (String) Access the object using an SQL Query instance. The SQL URL is a reference url used inside of an SQL statement. The reference url is used to perform queries against objects storing structured data.
    timeouts CosBucketObjectTimeoutsArgs
    version_id str
    website_redirect str
    Target URL for website redirect.
    body String
    (String) Literal string value of an object content. Only supported for text/* and application/json content types.
    bucketCrn String
    The CRN of the COS bucket.
    bucketLocation String
    The location of the COS bucket.
    content String
    Literal string value to use as an object content, which will be uploaded as UTF-8 encoded text. Conflicts with content_base64 and content_file.
    contentBase64 String
    Base64-encoded data that will be decoded and uploaded as raw bytes for an object content. This safely uploads non-UTF8 binary data, but is recommended only for small content. Conflicts with content and content_file.
    contentFile String
    The path to a file that will be read and uploaded as raw bytes for an object content. Conflicts with content and content_base64.
    contentLength Number
    (String) A standard MIME type describing the format of an object data.
    contentType String
    (String) A standard MIME type describing the format of an object data.
    cosBucketObjectId String
    (String) The ID of an object.
    endpointType String
    The type of endpoint used to access COS. Supported values are public, private, or direct. Default value is public.
    etag String
    MD5 hexdigest used to trigger updates. The only meaningful value is filemd5("path/to/file").
    forceDelete Boolean
    COS buckets need to be empty before they can be deleted. force_delete option empty the bucket and delete it.
    key String
    The name of an object in the COS bucket.
    lastModified String
    (Timestamp) Last modified date of an object. A GMT formatted date.
    objectLockLegalHoldStatus String
    An object lock configuration on the object, the valid states are ON/OFF. When ON prevents deletion of the object version.
    objectLockMode String
    Retention modes apply different levels of protection to the objects.
    objectLockRetainUntilDate String
    An object cannot be deleted when the current time is earlier than the retainUntilDate. After this date, the object can be deleted.
    objectSqlUrl String
    (String) Access the object using an SQL Query instance. The SQL URL is a reference url used inside of an SQL statement. The reference url is used to perform queries against objects storing structured data.
    timeouts Property Map
    versionId String
    websiteRedirect String
    Target URL for website redirect.

    Supporting Types

    CosBucketObjectTimeouts, CosBucketObjectTimeoutsArgs

    Create string
    Delete string
    Update string
    Create string
    Delete string
    Update string
    create String
    delete String
    update String
    create string
    delete string
    update string
    create str
    delete str
    update str
    create String
    delete String
    update String

    Import

    The ibm_cos_bucket_object resource can be imported by using the id. The ID is formed from the COS bucket CRN, an object key name, and the bucket location.

    id = ${bucketCRN}:object:${objectKey}:location:${bucketLocation}

    Syntax

    $ pulumi import ibm:index/cosBucketObject:CosBucketObject my_object <id>
    

    Example

    $ pulumi import ibm:index/cosBucketObject:CosBucketObject my_object crn:v1:bluemix:public:cloud-object-storage:global:a/4ea1882a2d3401ed1e459979941966ea:31fa970d-51d0-4b05-893e-251cba75a7b3:bucket:myBucketName:object:myObject.key:location:us-east
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    ibm ibm-cloud/terraform-provider-ibm
    License
    Notes
    This Pulumi package is based on the ibm Terraform Provider.
    ibm logo
    ibm 1.77.1 published on Monday, Apr 14, 2025 by ibm-cloud