1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. CosBucketPolicy
tencentcloud 1.81.183 published on Wednesday, Apr 16, 2025 by tencentcloudstack

tencentcloud.CosBucketPolicy

Explore with Pulumi AI

Provides a COS resource to create a COS bucket policy and set its attributes.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";

const info = tencentcloud.getUserInfo({});
const appId = info.then(info => info.appId);
const exampleCosBucket = new tencentcloud.CosBucket("exampleCosBucket", {
    bucket: appId.then(appId => `private-bucket-${appId}`),
    acl: "private",
});
const exampleCosBucketPolicy = new tencentcloud.CosBucketPolicy("exampleCosBucketPolicy", {
    bucket: exampleCosBucket.cosBucketId,
    policy: `{
  "version": "2.0",
  "Statement": [
    {
      "Principal": {
        "qcs": [
          "qcs::cam::uin/<your-account-id>:uin/<your-account-id>"
        ]
      },
      "Action": [
        "name/cos:DeleteBucket",
        "name/cos:PutBucketACL"
      ],
      "Effect": "allow",
      "Resource": [
        "qcs::cos:<bucket region>:uid/<your-appid-id>:<your-bucket-name>/*"
      ]
    }
  ]
}
`,
});
Copy
import pulumi
import pulumi_tencentcloud as tencentcloud

info = tencentcloud.get_user_info()
app_id = info.app_id
example_cos_bucket = tencentcloud.CosBucket("exampleCosBucket",
    bucket=f"private-bucket-{app_id}",
    acl="private")
example_cos_bucket_policy = tencentcloud.CosBucketPolicy("exampleCosBucketPolicy",
    bucket=example_cos_bucket.cos_bucket_id,
    policy="""{
  "version": "2.0",
  "Statement": [
    {
      "Principal": {
        "qcs": [
          "qcs::cam::uin/<your-account-id>:uin/<your-account-id>"
        ]
      },
      "Action": [
        "name/cos:DeleteBucket",
        "name/cos:PutBucketACL"
      ],
      "Effect": "allow",
      "Resource": [
        "qcs::cos:<bucket region>:uid/<your-appid-id>:<your-bucket-name>/*"
      ]
    }
  ]
}
""")
Copy
package main

import (
	"fmt"

	"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 {
		info, err := tencentcloud.GetUserInfo(ctx, &tencentcloud.GetUserInfoArgs{}, nil)
		if err != nil {
			return err
		}
		appId := info.AppId
		exampleCosBucket, err := tencentcloud.NewCosBucket(ctx, "exampleCosBucket", &tencentcloud.CosBucketArgs{
			Bucket: pulumi.Sprintf("private-bucket-%v", appId),
			Acl:    pulumi.String("private"),
		})
		if err != nil {
			return err
		}
		_, err = tencentcloud.NewCosBucketPolicy(ctx, "exampleCosBucketPolicy", &tencentcloud.CosBucketPolicyArgs{
			Bucket: exampleCosBucket.CosBucketId,
			Policy: pulumi.String(`{
  "version": "2.0",
  "Statement": [
    {
      "Principal": {
        "qcs": [
          "qcs::cam::uin/<your-account-id>:uin/<your-account-id>"
        ]
      },
      "Action": [
        "name/cos:DeleteBucket",
        "name/cos:PutBucketACL"
      ],
      "Effect": "allow",
      "Resource": [
        "qcs::cos:<bucket region>:uid/<your-appid-id>:<your-bucket-name>/*"
      ]
    }
  ]
}
`),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;

return await Deployment.RunAsync(() => 
{
    var info = Tencentcloud.GetUserInfo.Invoke();

    var appId = info.Apply(getUserInfoResult => getUserInfoResult.AppId);

    var exampleCosBucket = new Tencentcloud.CosBucket("exampleCosBucket", new()
    {
        Bucket = appId.Apply(appId => $"private-bucket-{appId}"),
        Acl = "private",
    });

    var exampleCosBucketPolicy = new Tencentcloud.CosBucketPolicy("exampleCosBucketPolicy", new()
    {
        Bucket = exampleCosBucket.CosBucketId,
        Policy = @"{
  ""version"": ""2.0"",
  ""Statement"": [
    {
      ""Principal"": {
        ""qcs"": [
          ""qcs::cam::uin/<your-account-id>:uin/<your-account-id>""
        ]
      },
      ""Action"": [
        ""name/cos:DeleteBucket"",
        ""name/cos:PutBucketACL""
      ],
      ""Effect"": ""allow"",
      ""Resource"": [
        ""qcs::cos:<bucket region>:uid/<your-appid-id>:<your-bucket-name>/*""
      ]
    }
  ]
}
",
    });

});
Copy
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.GetUserInfoArgs;
import com.pulumi.tencentcloud.CosBucket;
import com.pulumi.tencentcloud.CosBucketArgs;
import com.pulumi.tencentcloud.CosBucketPolicy;
import com.pulumi.tencentcloud.CosBucketPolicyArgs;
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 info = TencentcloudFunctions.getUserInfo();

        final var appId = info.applyValue(getUserInfoResult -> getUserInfoResult.appId());

        var exampleCosBucket = new CosBucket("exampleCosBucket", CosBucketArgs.builder()
            .bucket(String.format("private-bucket-%s", appId))
            .acl("private")
            .build());

        var exampleCosBucketPolicy = new CosBucketPolicy("exampleCosBucketPolicy", CosBucketPolicyArgs.builder()
            .bucket(exampleCosBucket.cosBucketId())
            .policy("""
{
  "version": "2.0",
  "Statement": [
    {
      "Principal": {
        "qcs": [
          "qcs::cam::uin/<your-account-id>:uin/<your-account-id>"
        ]
      },
      "Action": [
        "name/cos:DeleteBucket",
        "name/cos:PutBucketACL"
      ],
      "Effect": "allow",
      "Resource": [
        "qcs::cos:<bucket region>:uid/<your-appid-id>:<your-bucket-name>/*"
      ]
    }
  ]
}
            """)
            .build());

    }
}
Copy
resources:
  exampleCosBucket:
    type: tencentcloud:CosBucket
    properties:
      bucket: private-bucket-${appId}
      acl: private
  exampleCosBucketPolicy:
    type: tencentcloud:CosBucketPolicy
    properties:
      bucket: ${exampleCosBucket.cosBucketId}
      policy: |
        {
          "version": "2.0",
          "Statement": [
            {
              "Principal": {
                "qcs": [
                  "qcs::cam::uin/<your-account-id>:uin/<your-account-id>"
                ]
              },
              "Action": [
                "name/cos:DeleteBucket",
                "name/cos:PutBucketACL"
              ],
              "Effect": "allow",
              "Resource": [
                "qcs::cos:<bucket region>:uid/<your-appid-id>:<your-bucket-name>/*"
              ]
            }
          ]
        }        
variables:
  info:
    fn::invoke:
      function: tencentcloud:getUserInfo
      arguments: {}
  appId: ${info.appId}
Copy

Create CosBucketPolicy Resource

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

Constructor syntax

new CosBucketPolicy(name: string, args: CosBucketPolicyArgs, opts?: CustomResourceOptions);
@overload
def CosBucketPolicy(resource_name: str,
                    args: CosBucketPolicyArgs,
                    opts: Optional[ResourceOptions] = None)

@overload
def CosBucketPolicy(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    bucket: Optional[str] = None,
                    policy: Optional[str] = None,
                    cos_bucket_policy_id: Optional[str] = None)
func NewCosBucketPolicy(ctx *Context, name string, args CosBucketPolicyArgs, opts ...ResourceOption) (*CosBucketPolicy, error)
public CosBucketPolicy(string name, CosBucketPolicyArgs args, CustomResourceOptions? opts = null)
public CosBucketPolicy(String name, CosBucketPolicyArgs args)
public CosBucketPolicy(String name, CosBucketPolicyArgs args, CustomResourceOptions options)
type: tencentcloud:CosBucketPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

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

CosBucketPolicy 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 CosBucketPolicy resource accepts the following input properties:

Bucket This property is required. string
The name of a bucket to be created. Bucket format should be [custom name]-[appid], for example mycos-1258798060.
Policy This property is required. string
The text of the policy. For more info please refer to Tencent official doc, The six-segment resource scenario example in the document is as follows: Example of specifying a bucket: qcs::cos:ap-guangzhou:uid/1250000000:examplebucket-1250000000/*, In the cdc scenario: qcs::cos:ap-guangzhou:uid/1250000000:cdc_cluster-123456_examplebucket-1250000000/*; Example of specifying a folder: qcs::cos:ap-guangzhou:uid/1250000000:examplebucket-1250000000/folder/*, In the cdc scenario: qcs::cos:ap-guangzhou:uid/1250000000:cdc_cluster-123456_examplebucket-1250000000/folder/*; Specified object example: qcs::cos:ap-guangzhou:uid/1250000000:examplebucket-1250000000/folder/exampleobject, In the cdc scenario: qcs::cos:ap-guangzhou:uid/1250000000:cdc_cluster-123456_examplebucket-1250000000/folder/exampleobject.
CosBucketPolicyId string
ID of the resource.
Bucket This property is required. string
The name of a bucket to be created. Bucket format should be [custom name]-[appid], for example mycos-1258798060.
Policy This property is required. string
The text of the policy. For more info please refer to Tencent official doc, The six-segment resource scenario example in the document is as follows: Example of specifying a bucket: qcs::cos:ap-guangzhou:uid/1250000000:examplebucket-1250000000/*, In the cdc scenario: qcs::cos:ap-guangzhou:uid/1250000000:cdc_cluster-123456_examplebucket-1250000000/*; Example of specifying a folder: qcs::cos:ap-guangzhou:uid/1250000000:examplebucket-1250000000/folder/*, In the cdc scenario: qcs::cos:ap-guangzhou:uid/1250000000:cdc_cluster-123456_examplebucket-1250000000/folder/*; Specified object example: qcs::cos:ap-guangzhou:uid/1250000000:examplebucket-1250000000/folder/exampleobject, In the cdc scenario: qcs::cos:ap-guangzhou:uid/1250000000:cdc_cluster-123456_examplebucket-1250000000/folder/exampleobject.
CosBucketPolicyId string
ID of the resource.
bucket This property is required. String
The name of a bucket to be created. Bucket format should be [custom name]-[appid], for example mycos-1258798060.
policy This property is required. String
The text of the policy. For more info please refer to Tencent official doc, The six-segment resource scenario example in the document is as follows: Example of specifying a bucket: qcs::cos:ap-guangzhou:uid/1250000000:examplebucket-1250000000/*, In the cdc scenario: qcs::cos:ap-guangzhou:uid/1250000000:cdc_cluster-123456_examplebucket-1250000000/*; Example of specifying a folder: qcs::cos:ap-guangzhou:uid/1250000000:examplebucket-1250000000/folder/*, In the cdc scenario: qcs::cos:ap-guangzhou:uid/1250000000:cdc_cluster-123456_examplebucket-1250000000/folder/*; Specified object example: qcs::cos:ap-guangzhou:uid/1250000000:examplebucket-1250000000/folder/exampleobject, In the cdc scenario: qcs::cos:ap-guangzhou:uid/1250000000:cdc_cluster-123456_examplebucket-1250000000/folder/exampleobject.
cosBucketPolicyId String
ID of the resource.
bucket This property is required. string
The name of a bucket to be created. Bucket format should be [custom name]-[appid], for example mycos-1258798060.
policy This property is required. string
The text of the policy. For more info please refer to Tencent official doc, The six-segment resource scenario example in the document is as follows: Example of specifying a bucket: qcs::cos:ap-guangzhou:uid/1250000000:examplebucket-1250000000/*, In the cdc scenario: qcs::cos:ap-guangzhou:uid/1250000000:cdc_cluster-123456_examplebucket-1250000000/*; Example of specifying a folder: qcs::cos:ap-guangzhou:uid/1250000000:examplebucket-1250000000/folder/*, In the cdc scenario: qcs::cos:ap-guangzhou:uid/1250000000:cdc_cluster-123456_examplebucket-1250000000/folder/*; Specified object example: qcs::cos:ap-guangzhou:uid/1250000000:examplebucket-1250000000/folder/exampleobject, In the cdc scenario: qcs::cos:ap-guangzhou:uid/1250000000:cdc_cluster-123456_examplebucket-1250000000/folder/exampleobject.
cosBucketPolicyId string
ID of the resource.
bucket This property is required. str
The name of a bucket to be created. Bucket format should be [custom name]-[appid], for example mycos-1258798060.
policy This property is required. str
The text of the policy. For more info please refer to Tencent official doc, The six-segment resource scenario example in the document is as follows: Example of specifying a bucket: qcs::cos:ap-guangzhou:uid/1250000000:examplebucket-1250000000/*, In the cdc scenario: qcs::cos:ap-guangzhou:uid/1250000000:cdc_cluster-123456_examplebucket-1250000000/*; Example of specifying a folder: qcs::cos:ap-guangzhou:uid/1250000000:examplebucket-1250000000/folder/*, In the cdc scenario: qcs::cos:ap-guangzhou:uid/1250000000:cdc_cluster-123456_examplebucket-1250000000/folder/*; Specified object example: qcs::cos:ap-guangzhou:uid/1250000000:examplebucket-1250000000/folder/exampleobject, In the cdc scenario: qcs::cos:ap-guangzhou:uid/1250000000:cdc_cluster-123456_examplebucket-1250000000/folder/exampleobject.
cos_bucket_policy_id str
ID of the resource.
bucket This property is required. String
The name of a bucket to be created. Bucket format should be [custom name]-[appid], for example mycos-1258798060.
policy This property is required. String
The text of the policy. For more info please refer to Tencent official doc, The six-segment resource scenario example in the document is as follows: Example of specifying a bucket: qcs::cos:ap-guangzhou:uid/1250000000:examplebucket-1250000000/*, In the cdc scenario: qcs::cos:ap-guangzhou:uid/1250000000:cdc_cluster-123456_examplebucket-1250000000/*; Example of specifying a folder: qcs::cos:ap-guangzhou:uid/1250000000:examplebucket-1250000000/folder/*, In the cdc scenario: qcs::cos:ap-guangzhou:uid/1250000000:cdc_cluster-123456_examplebucket-1250000000/folder/*; Specified object example: qcs::cos:ap-guangzhou:uid/1250000000:examplebucket-1250000000/folder/exampleobject, In the cdc scenario: qcs::cos:ap-guangzhou:uid/1250000000:cdc_cluster-123456_examplebucket-1250000000/folder/exampleobject.
cosBucketPolicyId String
ID of the resource.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing CosBucketPolicy Resource

Get an existing CosBucketPolicy 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?: CosBucketPolicyState, opts?: CustomResourceOptions): CosBucketPolicy
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        bucket: Optional[str] = None,
        cos_bucket_policy_id: Optional[str] = None,
        policy: Optional[str] = None) -> CosBucketPolicy
func GetCosBucketPolicy(ctx *Context, name string, id IDInput, state *CosBucketPolicyState, opts ...ResourceOption) (*CosBucketPolicy, error)
public static CosBucketPolicy Get(string name, Input<string> id, CosBucketPolicyState? state, CustomResourceOptions? opts = null)
public static CosBucketPolicy get(String name, Output<String> id, CosBucketPolicyState state, CustomResourceOptions options)
resources:  _:    type: tencentcloud:CosBucketPolicy    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Bucket string
The name of a bucket to be created. Bucket format should be [custom name]-[appid], for example mycos-1258798060.
CosBucketPolicyId string
ID of the resource.
Policy string
The text of the policy. For more info please refer to Tencent official doc, The six-segment resource scenario example in the document is as follows: Example of specifying a bucket: qcs::cos:ap-guangzhou:uid/1250000000:examplebucket-1250000000/*, In the cdc scenario: qcs::cos:ap-guangzhou:uid/1250000000:cdc_cluster-123456_examplebucket-1250000000/*; Example of specifying a folder: qcs::cos:ap-guangzhou:uid/1250000000:examplebucket-1250000000/folder/*, In the cdc scenario: qcs::cos:ap-guangzhou:uid/1250000000:cdc_cluster-123456_examplebucket-1250000000/folder/*; Specified object example: qcs::cos:ap-guangzhou:uid/1250000000:examplebucket-1250000000/folder/exampleobject, In the cdc scenario: qcs::cos:ap-guangzhou:uid/1250000000:cdc_cluster-123456_examplebucket-1250000000/folder/exampleobject.
Bucket string
The name of a bucket to be created. Bucket format should be [custom name]-[appid], for example mycos-1258798060.
CosBucketPolicyId string
ID of the resource.
Policy string
The text of the policy. For more info please refer to Tencent official doc, The six-segment resource scenario example in the document is as follows: Example of specifying a bucket: qcs::cos:ap-guangzhou:uid/1250000000:examplebucket-1250000000/*, In the cdc scenario: qcs::cos:ap-guangzhou:uid/1250000000:cdc_cluster-123456_examplebucket-1250000000/*; Example of specifying a folder: qcs::cos:ap-guangzhou:uid/1250000000:examplebucket-1250000000/folder/*, In the cdc scenario: qcs::cos:ap-guangzhou:uid/1250000000:cdc_cluster-123456_examplebucket-1250000000/folder/*; Specified object example: qcs::cos:ap-guangzhou:uid/1250000000:examplebucket-1250000000/folder/exampleobject, In the cdc scenario: qcs::cos:ap-guangzhou:uid/1250000000:cdc_cluster-123456_examplebucket-1250000000/folder/exampleobject.
bucket String
The name of a bucket to be created. Bucket format should be [custom name]-[appid], for example mycos-1258798060.
cosBucketPolicyId String
ID of the resource.
policy String
The text of the policy. For more info please refer to Tencent official doc, The six-segment resource scenario example in the document is as follows: Example of specifying a bucket: qcs::cos:ap-guangzhou:uid/1250000000:examplebucket-1250000000/*, In the cdc scenario: qcs::cos:ap-guangzhou:uid/1250000000:cdc_cluster-123456_examplebucket-1250000000/*; Example of specifying a folder: qcs::cos:ap-guangzhou:uid/1250000000:examplebucket-1250000000/folder/*, In the cdc scenario: qcs::cos:ap-guangzhou:uid/1250000000:cdc_cluster-123456_examplebucket-1250000000/folder/*; Specified object example: qcs::cos:ap-guangzhou:uid/1250000000:examplebucket-1250000000/folder/exampleobject, In the cdc scenario: qcs::cos:ap-guangzhou:uid/1250000000:cdc_cluster-123456_examplebucket-1250000000/folder/exampleobject.
bucket string
The name of a bucket to be created. Bucket format should be [custom name]-[appid], for example mycos-1258798060.
cosBucketPolicyId string
ID of the resource.
policy string
The text of the policy. For more info please refer to Tencent official doc, The six-segment resource scenario example in the document is as follows: Example of specifying a bucket: qcs::cos:ap-guangzhou:uid/1250000000:examplebucket-1250000000/*, In the cdc scenario: qcs::cos:ap-guangzhou:uid/1250000000:cdc_cluster-123456_examplebucket-1250000000/*; Example of specifying a folder: qcs::cos:ap-guangzhou:uid/1250000000:examplebucket-1250000000/folder/*, In the cdc scenario: qcs::cos:ap-guangzhou:uid/1250000000:cdc_cluster-123456_examplebucket-1250000000/folder/*; Specified object example: qcs::cos:ap-guangzhou:uid/1250000000:examplebucket-1250000000/folder/exampleobject, In the cdc scenario: qcs::cos:ap-guangzhou:uid/1250000000:cdc_cluster-123456_examplebucket-1250000000/folder/exampleobject.
bucket str
The name of a bucket to be created. Bucket format should be [custom name]-[appid], for example mycos-1258798060.
cos_bucket_policy_id str
ID of the resource.
policy str
The text of the policy. For more info please refer to Tencent official doc, The six-segment resource scenario example in the document is as follows: Example of specifying a bucket: qcs::cos:ap-guangzhou:uid/1250000000:examplebucket-1250000000/*, In the cdc scenario: qcs::cos:ap-guangzhou:uid/1250000000:cdc_cluster-123456_examplebucket-1250000000/*; Example of specifying a folder: qcs::cos:ap-guangzhou:uid/1250000000:examplebucket-1250000000/folder/*, In the cdc scenario: qcs::cos:ap-guangzhou:uid/1250000000:cdc_cluster-123456_examplebucket-1250000000/folder/*; Specified object example: qcs::cos:ap-guangzhou:uid/1250000000:examplebucket-1250000000/folder/exampleobject, In the cdc scenario: qcs::cos:ap-guangzhou:uid/1250000000:cdc_cluster-123456_examplebucket-1250000000/folder/exampleobject.
bucket String
The name of a bucket to be created. Bucket format should be [custom name]-[appid], for example mycos-1258798060.
cosBucketPolicyId String
ID of the resource.
policy String
The text of the policy. For more info please refer to Tencent official doc, The six-segment resource scenario example in the document is as follows: Example of specifying a bucket: qcs::cos:ap-guangzhou:uid/1250000000:examplebucket-1250000000/*, In the cdc scenario: qcs::cos:ap-guangzhou:uid/1250000000:cdc_cluster-123456_examplebucket-1250000000/*; Example of specifying a folder: qcs::cos:ap-guangzhou:uid/1250000000:examplebucket-1250000000/folder/*, In the cdc scenario: qcs::cos:ap-guangzhou:uid/1250000000:cdc_cluster-123456_examplebucket-1250000000/folder/*; Specified object example: qcs::cos:ap-guangzhou:uid/1250000000:examplebucket-1250000000/folder/exampleobject, In the cdc scenario: qcs::cos:ap-guangzhou:uid/1250000000:cdc_cluster-123456_examplebucket-1250000000/folder/exampleobject.

Import

COS bucket policy can be imported, e.g.

$ pulumi import tencentcloud:index/cosBucketPolicy:CosBucketPolicy example private-bucket-1309118521
Copy

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

Package Details

Repository
tencentcloud tencentcloudstack/terraform-provider-tencentcloud
License
Notes
This Pulumi package is based on the tencentcloud Terraform Provider.