1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. getCosBucketObject
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.getCosBucketObject

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    Use this data source to query the metadata of an object stored inside a bucket.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const mycos = tencentcloud.getCosBucketObject({
        bucket: "mycos-test-1258798060",
        key: "hello-world.py",
        resultOutputFile: "TFresults",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    mycos = tencentcloud.get_cos_bucket_object(bucket="mycos-test-1258798060",
        key="hello-world.py",
        result_output_file="TFresults")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := tencentcloud.LookupCosBucketObject(ctx, &tencentcloud.LookupCosBucketObjectArgs{
    			Bucket:           "mycos-test-1258798060",
    			Key:              "hello-world.py",
    			ResultOutputFile: pulumi.StringRef("TFresults"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var mycos = Tencentcloud.GetCosBucketObject.Invoke(new()
        {
            Bucket = "mycos-test-1258798060",
            Key = "hello-world.py",
            ResultOutputFile = "TFresults",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.TencentcloudFunctions;
    import com.pulumi.tencentcloud.inputs.GetCosBucketObjectArgs;
    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 mycos = TencentcloudFunctions.getCosBucketObject(GetCosBucketObjectArgs.builder()
                .bucket("mycos-test-1258798060")
                .key("hello-world.py")
                .resultOutputFile("TFresults")
                .build());
    
        }
    }
    
    variables:
      mycos:
        fn::invoke:
          function: tencentcloud:getCosBucketObject
          arguments:
            bucket: mycos-test-1258798060
            key: hello-world.py
            resultOutputFile: TFresults
    

    Using getCosBucketObject

    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 getCosBucketObject(args: GetCosBucketObjectArgs, opts?: InvokeOptions): Promise<GetCosBucketObjectResult>
    function getCosBucketObjectOutput(args: GetCosBucketObjectOutputArgs, opts?: InvokeOptions): Output<GetCosBucketObjectResult>
    def get_cos_bucket_object(bucket: Optional[str] = None,
                              id: Optional[str] = None,
                              key: Optional[str] = None,
                              result_output_file: Optional[str] = None,
                              opts: Optional[InvokeOptions] = None) -> GetCosBucketObjectResult
    def get_cos_bucket_object_output(bucket: Optional[pulumi.Input[str]] = None,
                              id: Optional[pulumi.Input[str]] = None,
                              key: Optional[pulumi.Input[str]] = None,
                              result_output_file: Optional[pulumi.Input[str]] = None,
                              opts: Optional[InvokeOptions] = None) -> Output[GetCosBucketObjectResult]
    func LookupCosBucketObject(ctx *Context, args *LookupCosBucketObjectArgs, opts ...InvokeOption) (*LookupCosBucketObjectResult, error)
    func LookupCosBucketObjectOutput(ctx *Context, args *LookupCosBucketObjectOutputArgs, opts ...InvokeOption) LookupCosBucketObjectResultOutput

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

    public static class GetCosBucketObject 
    {
        public static Task<GetCosBucketObjectResult> InvokeAsync(GetCosBucketObjectArgs args, InvokeOptions? opts = null)
        public static Output<GetCosBucketObjectResult> Invoke(GetCosBucketObjectInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetCosBucketObjectResult> getCosBucketObject(GetCosBucketObjectArgs args, InvokeOptions options)
    public static Output<GetCosBucketObjectResult> getCosBucketObject(GetCosBucketObjectArgs args, InvokeOptions options)
    
    fn::invoke:
      function: tencentcloud:index/getCosBucketObject:getCosBucketObject
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Bucket string
    Name of the bucket that contains the objects to query.
    Key string
    The full path to the object inside the bucket.
    Id string
    ResultOutputFile string
    Used to save results.
    Bucket string
    Name of the bucket that contains the objects to query.
    Key string
    The full path to the object inside the bucket.
    Id string
    ResultOutputFile string
    Used to save results.
    bucket String
    Name of the bucket that contains the objects to query.
    key String
    The full path to the object inside the bucket.
    id String
    resultOutputFile String
    Used to save results.
    bucket string
    Name of the bucket that contains the objects to query.
    key string
    The full path to the object inside the bucket.
    id string
    resultOutputFile string
    Used to save results.
    bucket str
    Name of the bucket that contains the objects to query.
    key str
    The full path to the object inside the bucket.
    id str
    result_output_file str
    Used to save results.
    bucket String
    Name of the bucket that contains the objects to query.
    key String
    The full path to the object inside the bucket.
    id String
    resultOutputFile String
    Used to save results.

    getCosBucketObject Result

    The following output properties are available:

    Bucket string
    CacheControl string
    Specifies caching behavior along the request/reply chain.
    ContentDisposition string
    Specifies presentational information for the object.
    ContentEncoding string
    Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field.
    ContentType string
    A standard MIME type describing the format of the object data.
    Etag string
    ETag generated for the object, which is may not equal to MD5 value.
    Id string
    Key string
    LastModified string
    Last modified date of the object.
    StorageClass string
    Object storage type such as STANDARD.
    ResultOutputFile string
    Bucket string
    CacheControl string
    Specifies caching behavior along the request/reply chain.
    ContentDisposition string
    Specifies presentational information for the object.
    ContentEncoding string
    Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field.
    ContentType string
    A standard MIME type describing the format of the object data.
    Etag string
    ETag generated for the object, which is may not equal to MD5 value.
    Id string
    Key string
    LastModified string
    Last modified date of the object.
    StorageClass string
    Object storage type such as STANDARD.
    ResultOutputFile string
    bucket String
    cacheControl String
    Specifies caching behavior along the request/reply chain.
    contentDisposition String
    Specifies presentational information for the object.
    contentEncoding String
    Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field.
    contentType String
    A standard MIME type describing the format of the object data.
    etag String
    ETag generated for the object, which is may not equal to MD5 value.
    id String
    key String
    lastModified String
    Last modified date of the object.
    storageClass String
    Object storage type such as STANDARD.
    resultOutputFile String
    bucket string
    cacheControl string
    Specifies caching behavior along the request/reply chain.
    contentDisposition string
    Specifies presentational information for the object.
    contentEncoding string
    Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field.
    contentType string
    A standard MIME type describing the format of the object data.
    etag string
    ETag generated for the object, which is may not equal to MD5 value.
    id string
    key string
    lastModified string
    Last modified date of the object.
    storageClass string
    Object storage type such as STANDARD.
    resultOutputFile string
    bucket str
    cache_control str
    Specifies caching behavior along the request/reply chain.
    content_disposition str
    Specifies presentational information for the object.
    content_encoding str
    Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field.
    content_type str
    A standard MIME type describing the format of the object data.
    etag str
    ETag generated for the object, which is may not equal to MD5 value.
    id str
    key str
    last_modified str
    Last modified date of the object.
    storage_class str
    Object storage type such as STANDARD.
    result_output_file str
    bucket String
    cacheControl String
    Specifies caching behavior along the request/reply chain.
    contentDisposition String
    Specifies presentational information for the object.
    contentEncoding String
    Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field.
    contentType String
    A standard MIME type describing the format of the object data.
    etag String
    ETag generated for the object, which is may not equal to MD5 value.
    id String
    key String
    lastModified String
    Last modified date of the object.
    storageClass String
    Object storage type such as STANDARD.
    resultOutputFile String

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack