published on Friday, Mar 6, 2026 by tencentcloudstack
published on Friday, Mar 6, 2026 by tencentcloudstack
Provides a COS resource to create a COS bucket and set its attributes.
NOTE: The following capabilities do not support cdc scenarios:
multi_az,website, and bucket replicationreplica_role.
NOTE: If
chdfs_ofsistrue, cannot setacl_body,acl,origin_pull_rules,origin_domain_rules,website,encryption_algorithm,kms_id,versioning_enable,acceleration_enableat the same time. For more information, please refer tohttps://www.tencentcloud.com/document/product/436/43305.
Example Usage
Private Bucket
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const info = tencentcloud.getUserInfo({});
const appId = info.then(info => info.appId);
const privateBucket = new tencentcloud.CosBucket("private_bucket", {
bucket: appId.then(appId => `private-bucket-${appId}`),
acl: "private",
});
import pulumi
import pulumi_tencentcloud as tencentcloud
info = tencentcloud.get_user_info()
app_id = info.app_id
private_bucket = tencentcloud.CosBucket("private_bucket",
bucket=f"private-bucket-{app_id}",
acl="private")
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
_, err = tencentcloud.NewCosBucket(ctx, "private_bucket", &tencentcloud.CosBucketArgs{
Bucket: pulumi.Sprintf("private-bucket-%v", appId),
Acl: pulumi.String("private"),
})
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 info = Tencentcloud.GetUserInfo.Invoke();
var appId = info.Apply(getUserInfoResult => getUserInfoResult.AppId);
var privateBucket = new Tencentcloud.CosBucket("private_bucket", new()
{
Bucket = appId.Apply(appId => $"private-bucket-{appId}"),
Acl = "private",
});
});
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 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(GetUserInfoArgs.builder()
.build());
final var appId = info.appId();
var privateBucket = new CosBucket("privateBucket", CosBucketArgs.builder()
.bucket(String.format("private-bucket-%s", appId))
.acl("private")
.build());
}
}
resources:
privateBucket:
type: tencentcloud:CosBucket
name: private_bucket
properties:
bucket: private-bucket-${appId}
acl: private
variables:
info:
fn::invoke:
function: tencentcloud:getUserInfo
arguments: {}
appId: ${info.appId}
Private Bucket with CDC cluster
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const region = "ap-guangzhou";
const cdcId = "cluster-262n63e8";
const info = tencentcloud.getUserInfo({});
const appId = info.then(info => info.appId);
const privateBucket = new tencentcloud.CosBucket("private_bucket", {
bucket: appId.then(appId => `private-bucket-${appId}`),
acl: "private",
versioningEnable: true,
forceClean: true,
});
import pulumi
import pulumi_tencentcloud as tencentcloud
region = "ap-guangzhou"
cdc_id = "cluster-262n63e8"
info = tencentcloud.get_user_info()
app_id = info.app_id
private_bucket = tencentcloud.CosBucket("private_bucket",
bucket=f"private-bucket-{app_id}",
acl="private",
versioning_enable=True,
force_clean=True)
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 {
_ := "ap-guangzhou"
_ := "cluster-262n63e8"
info, err := tencentcloud.GetUserInfo(ctx, &tencentcloud.GetUserInfoArgs{}, nil)
if err != nil {
return err
}
appId := info.AppId
_, err = tencentcloud.NewCosBucket(ctx, "private_bucket", &tencentcloud.CosBucketArgs{
Bucket: pulumi.Sprintf("private-bucket-%v", appId),
Acl: pulumi.String("private"),
VersioningEnable: pulumi.Bool(true),
ForceClean: pulumi.Bool(true),
})
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 region = "ap-guangzhou";
var cdcId = "cluster-262n63e8";
var info = Tencentcloud.GetUserInfo.Invoke();
var appId = info.Apply(getUserInfoResult => getUserInfoResult.AppId);
var privateBucket = new Tencentcloud.CosBucket("private_bucket", new()
{
Bucket = appId.Apply(appId => $"private-bucket-{appId}"),
Acl = "private",
VersioningEnable = true,
ForceClean = true,
});
});
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 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 region = "ap-guangzhou";
final var cdcId = "cluster-262n63e8";
final var info = TencentcloudFunctions.getUserInfo(GetUserInfoArgs.builder()
.build());
final var appId = info.appId();
var privateBucket = new CosBucket("privateBucket", CosBucketArgs.builder()
.bucket(String.format("private-bucket-%s", appId))
.acl("private")
.versioningEnable(true)
.forceClean(true)
.build());
}
}
resources:
privateBucket:
type: tencentcloud:CosBucket
name: private_bucket
properties:
bucket: private-bucket-${appId}
acl: private
versioningEnable: true
forceClean: true
variables:
region: ap-guangzhou
cdcId: cluster-262n63e8
info:
fn::invoke:
function: tencentcloud:getUserInfo
arguments: {}
appId: ${info.appId}
Enable SSE-KMS encryption
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const info = tencentcloud.getUserInfo({});
const appId = info.then(info => info.appId);
const example = new tencentcloud.KmsKey("example", {
alias: "tf-example-kms-key",
description: "example of kms key",
keyRotationEnabled: false,
isEnabled: true,
tags: {
createdBy: "terraform",
},
});
const bucketBasic = new tencentcloud.CosBucket("bucket_basic", {
bucket: appId.then(appId => `tf-bucket-cdc-${appId}`),
acl: "private",
encryptionAlgorithm: "KMS",
kmsId: example.kmsKeyId,
versioningEnable: true,
accelerationEnable: false,
forceClean: true,
});
import pulumi
import pulumi_tencentcloud as tencentcloud
info = tencentcloud.get_user_info()
app_id = info.app_id
example = tencentcloud.KmsKey("example",
alias="tf-example-kms-key",
description="example of kms key",
key_rotation_enabled=False,
is_enabled=True,
tags={
"createdBy": "terraform",
})
bucket_basic = tencentcloud.CosBucket("bucket_basic",
bucket=f"tf-bucket-cdc-{app_id}",
acl="private",
encryption_algorithm="KMS",
kms_id=example.kms_key_id,
versioning_enable=True,
acceleration_enable=False,
force_clean=True)
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
example, err := tencentcloud.NewKmsKey(ctx, "example", &tencentcloud.KmsKeyArgs{
Alias: pulumi.String("tf-example-kms-key"),
Description: pulumi.String("example of kms key"),
KeyRotationEnabled: pulumi.Bool(false),
IsEnabled: pulumi.Bool(true),
Tags: pulumi.StringMap{
"createdBy": pulumi.String("terraform"),
},
})
if err != nil {
return err
}
_, err = tencentcloud.NewCosBucket(ctx, "bucket_basic", &tencentcloud.CosBucketArgs{
Bucket: pulumi.Sprintf("tf-bucket-cdc-%v", appId),
Acl: pulumi.String("private"),
EncryptionAlgorithm: pulumi.String("KMS"),
KmsId: example.KmsKeyId,
VersioningEnable: pulumi.Bool(true),
AccelerationEnable: pulumi.Bool(false),
ForceClean: pulumi.Bool(true),
})
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 info = Tencentcloud.GetUserInfo.Invoke();
var appId = info.Apply(getUserInfoResult => getUserInfoResult.AppId);
var example = new Tencentcloud.KmsKey("example", new()
{
Alias = "tf-example-kms-key",
Description = "example of kms key",
KeyRotationEnabled = false,
IsEnabled = true,
Tags =
{
{ "createdBy", "terraform" },
},
});
var bucketBasic = new Tencentcloud.CosBucket("bucket_basic", new()
{
Bucket = appId.Apply(appId => $"tf-bucket-cdc-{appId}"),
Acl = "private",
EncryptionAlgorithm = "KMS",
KmsId = example.KmsKeyId,
VersioningEnable = true,
AccelerationEnable = false,
ForceClean = true,
});
});
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.KmsKey;
import com.pulumi.tencentcloud.KmsKeyArgs;
import com.pulumi.tencentcloud.CosBucket;
import com.pulumi.tencentcloud.CosBucketArgs;
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(GetUserInfoArgs.builder()
.build());
final var appId = info.appId();
var example = new KmsKey("example", KmsKeyArgs.builder()
.alias("tf-example-kms-key")
.description("example of kms key")
.keyRotationEnabled(false)
.isEnabled(true)
.tags(Map.of("createdBy", "terraform"))
.build());
var bucketBasic = new CosBucket("bucketBasic", CosBucketArgs.builder()
.bucket(String.format("tf-bucket-cdc-%s", appId))
.acl("private")
.encryptionAlgorithm("KMS")
.kmsId(example.kmsKeyId())
.versioningEnable(true)
.accelerationEnable(false)
.forceClean(true)
.build());
}
}
resources:
example:
type: tencentcloud:KmsKey
properties:
alias: tf-example-kms-key
description: example of kms key
keyRotationEnabled: false
isEnabled: true
tags:
createdBy: terraform
bucketBasic:
type: tencentcloud:CosBucket
name: bucket_basic
properties:
bucket: tf-bucket-cdc-${appId}
acl: private
encryptionAlgorithm: KMS
kmsId: ${example.kmsKeyId}
versioningEnable: true
accelerationEnable: false
forceClean: true
variables:
info:
fn::invoke:
function: tencentcloud:getUserInfo
arguments: {}
appId: ${info.appId}
Creation of multiple available zone bucket
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const info = tencentcloud.getUserInfo({});
const appId = info.then(info => info.appId);
const multiZoneBucket = new tencentcloud.CosBucket("multi_zone_bucket", {
bucket: appId.then(appId => `multi-zone-bucket-${appId}`),
acl: "private",
multiAz: true,
versioningEnable: true,
forceClean: true,
});
import pulumi
import pulumi_tencentcloud as tencentcloud
info = tencentcloud.get_user_info()
app_id = info.app_id
multi_zone_bucket = tencentcloud.CosBucket("multi_zone_bucket",
bucket=f"multi-zone-bucket-{app_id}",
acl="private",
multi_az=True,
versioning_enable=True,
force_clean=True)
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
_, err = tencentcloud.NewCosBucket(ctx, "multi_zone_bucket", &tencentcloud.CosBucketArgs{
Bucket: pulumi.Sprintf("multi-zone-bucket-%v", appId),
Acl: pulumi.String("private"),
MultiAz: pulumi.Bool(true),
VersioningEnable: pulumi.Bool(true),
ForceClean: pulumi.Bool(true),
})
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 info = Tencentcloud.GetUserInfo.Invoke();
var appId = info.Apply(getUserInfoResult => getUserInfoResult.AppId);
var multiZoneBucket = new Tencentcloud.CosBucket("multi_zone_bucket", new()
{
Bucket = appId.Apply(appId => $"multi-zone-bucket-{appId}"),
Acl = "private",
MultiAz = true,
VersioningEnable = true,
ForceClean = true,
});
});
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 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(GetUserInfoArgs.builder()
.build());
final var appId = info.appId();
var multiZoneBucket = new CosBucket("multiZoneBucket", CosBucketArgs.builder()
.bucket(String.format("multi-zone-bucket-%s", appId))
.acl("private")
.multiAz(true)
.versioningEnable(true)
.forceClean(true)
.build());
}
}
resources:
multiZoneBucket:
type: tencentcloud:CosBucket
name: multi_zone_bucket
properties:
bucket: multi-zone-bucket-${appId}
acl: private
multiAz: true
versioningEnable: true
forceClean: true
variables:
info:
fn::invoke:
function: tencentcloud:getUserInfo
arguments: {}
appId: ${info.appId}
Using verbose acl
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const info = tencentcloud.getUserInfo({});
const appId = info.then(info => info.appId);
const bucketWithAcl = new tencentcloud.CosBucket("bucket_with_acl", {
bucket: appId.then(appId => `bucketwith-acl-${appId}`),
aclBody: `<AccessControlPolicy>
\\t<Owner>
\\t\\t<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\\t\\t<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\\t</Owner>
\\t<AccessControlList>
\\t\\t<Grant>
\\t\\t\\t<Grantee xmlns:xsi=\\"http://www.w3.org/2001/XMLSchema-instance\\" xsi:type=\\"Group\\">
\\t\\t\\t\\t<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
\\t\\t\\t</Grantee>
\\t\\t\\t<Permission>READ</Permission>
\\t\\t</Grant>
\\t\\t<Grant>
\\t\\t\\t<Grantee xmlns:xsi=\\"http://www.w3.org/2001/XMLSchema-instance\\" xsi:type=\\"CanonicalUser\\">
\\t\\t\\t\\t<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\\t\\t\\t\\t<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\\t\\t\\t</Grantee>
\\t\\t\\t<Permission>FULL_CONTROL</Permission>
\\t\\t</Grant>
\\t\\t<Grant>
\\t\\t\\t<Grantee xmlns:xsi=\\"http://www.w3.org/2001/XMLSchema-instance\\" xsi:type=\\"CanonicalUser\\">
\\t\\t\\t\\t<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\\t\\t\\t\\t<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\\t\\t\\t</Grantee>
\\t\\t\\t<Permission>WRITE_ACP</Permission>
\\t\\t</Grant>
\\t\\t<Grant>
\\t\\t\\t<Grantee xmlns:xsi=\\"http://www.w3.org/2001/XMLSchema-instance\\" xsi:type=\\"Group\\">
\\t\\t\\t\\t<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
\\t\\t\\t</Grantee>
\\t\\t\\t<Permission>READ_ACP</Permission>
\\t\\t</Grant>
\\t\\t<Grant>
\\t\\t\\t<Grantee xmlns:xsi=\\"http://www.w3.org/2001/XMLSchema-instance\\" xsi:type=\\"Group\\">
\\t\\t\\t\\t<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
\\t\\t\\t</Grantee>
\\t\\t\\t<Permission>WRITE_ACP</Permission>
\\t\\t</Grant>
\\t\\t<Grant>
\\t\\t\\t<Grantee xmlns:xsi=\\"http://www.w3.org/2001/XMLSchema-instance\\" xsi:type=\\"CanonicalUser\\">
\\t\\t\\t\\t<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\\t\\t\\t\\t<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\\t\\t\\t</Grantee>
\\t\\t\\t<Permission>READ</Permission>
\\t\\t</Grant>
\\t\\t<Grant>
\\t\\t\\t<Grantee xmlns:xsi=\\"http://www.w3.org/2001/XMLSchema-instance\\" xsi:type=\\"CanonicalUser\\">
\\t\\t\\t\\t<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\\t\\t\\t\\t<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\\t\\t\\t</Grantee>
\\t\\t\\t<Permission>WRITE</Permission>
\\t\\t</Grant>
\\t\\t<Grant>
\\t\\t\\t<Grantee xmlns:xsi=\\"http://www.w3.org/2001/XMLSchema-instance\\" xsi:type=\\"Group\\">
\\t\\t\\t\\t<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
\\t\\t\\t</Grantee>
\\t\\t\\t<Permission>FULL_CONTROL</Permission>
\\t\\t</Grant>
\\t</AccessControlList>
</AccessControlPolicy>
`,
});
import pulumi
import pulumi_tencentcloud as tencentcloud
info = tencentcloud.get_user_info()
app_id = info.app_id
bucket_with_acl = tencentcloud.CosBucket("bucket_with_acl",
bucket=f"bucketwith-acl-{app_id}",
acl_body="""<AccessControlPolicy>
\t<Owner>
\t\t<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\t\t<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\t</Owner>
\t<AccessControlList>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"Group\">
\t\t\t\t<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
\t\t\t</Grantee>
\t\t\t<Permission>READ</Permission>
\t\t</Grant>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"CanonicalUser\">
\t\t\t\t<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\t\t\t\t<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\t\t\t</Grantee>
\t\t\t<Permission>FULL_CONTROL</Permission>
\t\t</Grant>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"CanonicalUser\">
\t\t\t\t<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\t\t\t\t<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\t\t\t</Grantee>
\t\t\t<Permission>WRITE_ACP</Permission>
\t\t</Grant>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"Group\">
\t\t\t\t<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
\t\t\t</Grantee>
\t\t\t<Permission>READ_ACP</Permission>
\t\t</Grant>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"Group\">
\t\t\t\t<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
\t\t\t</Grantee>
\t\t\t<Permission>WRITE_ACP</Permission>
\t\t</Grant>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"CanonicalUser\">
\t\t\t\t<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\t\t\t\t<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\t\t\t</Grantee>
\t\t\t<Permission>READ</Permission>
\t\t</Grant>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"CanonicalUser\">
\t\t\t\t<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\t\t\t\t<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\t\t\t</Grantee>
\t\t\t<Permission>WRITE</Permission>
\t\t</Grant>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"Group\">
\t\t\t\t<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
\t\t\t</Grantee>
\t\t\t<Permission>FULL_CONTROL</Permission>
\t\t</Grant>
\t</AccessControlList>
</AccessControlPolicy>
""")
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
_, err = tencentcloud.NewCosBucket(ctx, "bucket_with_acl", &tencentcloud.CosBucketArgs{
Bucket: pulumi.Sprintf("bucketwith-acl-%v", appId),
AclBody: pulumi.String(`<AccessControlPolicy>
\t<Owner>
\t\t<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\t\t<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\t</Owner>
\t<AccessControlList>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"Group\">
\t\t\t\t<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
\t\t\t</Grantee>
\t\t\t<Permission>READ</Permission>
\t\t</Grant>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"CanonicalUser\">
\t\t\t\t<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\t\t\t\t<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\t\t\t</Grantee>
\t\t\t<Permission>FULL_CONTROL</Permission>
\t\t</Grant>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"CanonicalUser\">
\t\t\t\t<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\t\t\t\t<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\t\t\t</Grantee>
\t\t\t<Permission>WRITE_ACP</Permission>
\t\t</Grant>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"Group\">
\t\t\t\t<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
\t\t\t</Grantee>
\t\t\t<Permission>READ_ACP</Permission>
\t\t</Grant>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"Group\">
\t\t\t\t<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
\t\t\t</Grantee>
\t\t\t<Permission>WRITE_ACP</Permission>
\t\t</Grant>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"CanonicalUser\">
\t\t\t\t<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\t\t\t\t<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\t\t\t</Grantee>
\t\t\t<Permission>READ</Permission>
\t\t</Grant>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"CanonicalUser\">
\t\t\t\t<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\t\t\t\t<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\t\t\t</Grantee>
\t\t\t<Permission>WRITE</Permission>
\t\t</Grant>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"Group\">
\t\t\t\t<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
\t\t\t</Grantee>
\t\t\t<Permission>FULL_CONTROL</Permission>
\t\t</Grant>
\t</AccessControlList>
</AccessControlPolicy>
`),
})
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 info = Tencentcloud.GetUserInfo.Invoke();
var appId = info.Apply(getUserInfoResult => getUserInfoResult.AppId);
var bucketWithAcl = new Tencentcloud.CosBucket("bucket_with_acl", new()
{
Bucket = appId.Apply(appId => $"bucketwith-acl-{appId}"),
AclBody = @"<AccessControlPolicy>
\t<Owner>
\t\t<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\t\t<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\t</Owner>
\t<AccessControlList>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\""http://www.w3.org/2001/XMLSchema-instance\"" xsi:type=\""Group\"">
\t\t\t\t<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
\t\t\t</Grantee>
\t\t\t<Permission>READ</Permission>
\t\t</Grant>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\""http://www.w3.org/2001/XMLSchema-instance\"" xsi:type=\""CanonicalUser\"">
\t\t\t\t<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\t\t\t\t<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\t\t\t</Grantee>
\t\t\t<Permission>FULL_CONTROL</Permission>
\t\t</Grant>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\""http://www.w3.org/2001/XMLSchema-instance\"" xsi:type=\""CanonicalUser\"">
\t\t\t\t<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\t\t\t\t<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\t\t\t</Grantee>
\t\t\t<Permission>WRITE_ACP</Permission>
\t\t</Grant>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\""http://www.w3.org/2001/XMLSchema-instance\"" xsi:type=\""Group\"">
\t\t\t\t<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
\t\t\t</Grantee>
\t\t\t<Permission>READ_ACP</Permission>
\t\t</Grant>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\""http://www.w3.org/2001/XMLSchema-instance\"" xsi:type=\""Group\"">
\t\t\t\t<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
\t\t\t</Grantee>
\t\t\t<Permission>WRITE_ACP</Permission>
\t\t</Grant>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\""http://www.w3.org/2001/XMLSchema-instance\"" xsi:type=\""CanonicalUser\"">
\t\t\t\t<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\t\t\t\t<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\t\t\t</Grantee>
\t\t\t<Permission>READ</Permission>
\t\t</Grant>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\""http://www.w3.org/2001/XMLSchema-instance\"" xsi:type=\""CanonicalUser\"">
\t\t\t\t<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\t\t\t\t<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\t\t\t</Grantee>
\t\t\t<Permission>WRITE</Permission>
\t\t</Grant>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\""http://www.w3.org/2001/XMLSchema-instance\"" xsi:type=\""Group\"">
\t\t\t\t<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
\t\t\t</Grantee>
\t\t\t<Permission>FULL_CONTROL</Permission>
\t\t</Grant>
\t</AccessControlList>
</AccessControlPolicy>
",
});
});
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 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(GetUserInfoArgs.builder()
.build());
final var appId = info.appId();
var bucketWithAcl = new CosBucket("bucketWithAcl", CosBucketArgs.builder()
.bucket(String.format("bucketwith-acl-%s", appId))
.aclBody("""
<AccessControlPolicy>
\t<Owner>
\t\t<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\t\t<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\t</Owner>
\t<AccessControlList>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"Group\">
\t\t\t\t<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
\t\t\t</Grantee>
\t\t\t<Permission>READ</Permission>
\t\t</Grant>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"CanonicalUser\">
\t\t\t\t<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\t\t\t\t<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\t\t\t</Grantee>
\t\t\t<Permission>FULL_CONTROL</Permission>
\t\t</Grant>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"CanonicalUser\">
\t\t\t\t<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\t\t\t\t<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\t\t\t</Grantee>
\t\t\t<Permission>WRITE_ACP</Permission>
\t\t</Grant>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"Group\">
\t\t\t\t<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
\t\t\t</Grantee>
\t\t\t<Permission>READ_ACP</Permission>
\t\t</Grant>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"Group\">
\t\t\t\t<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
\t\t\t</Grantee>
\t\t\t<Permission>WRITE_ACP</Permission>
\t\t</Grant>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"CanonicalUser\">
\t\t\t\t<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\t\t\t\t<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\t\t\t</Grantee>
\t\t\t<Permission>READ</Permission>
\t\t</Grant>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"CanonicalUser\">
\t\t\t\t<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\t\t\t\t<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\t\t\t</Grantee>
\t\t\t<Permission>WRITE</Permission>
\t\t</Grant>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"Group\">
\t\t\t\t<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
\t\t\t</Grantee>
\t\t\t<Permission>FULL_CONTROL</Permission>
\t\t</Grant>
\t</AccessControlList>
</AccessControlPolicy>
""")
.build());
}
}
resources:
bucketWithAcl:
type: tencentcloud:CosBucket
name: bucket_with_acl
properties:
bucket: bucketwith-acl-${appId}
aclBody: |
<AccessControlPolicy>
\t<Owner>
\t\t<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\t\t<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\t</Owner>
\t<AccessControlList>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"Group\">
\t\t\t\t<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
\t\t\t</Grantee>
\t\t\t<Permission>READ</Permission>
\t\t</Grant>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"CanonicalUser\">
\t\t\t\t<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\t\t\t\t<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\t\t\t</Grantee>
\t\t\t<Permission>FULL_CONTROL</Permission>
\t\t</Grant>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"CanonicalUser\">
\t\t\t\t<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\t\t\t\t<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\t\t\t</Grantee>
\t\t\t<Permission>WRITE_ACP</Permission>
\t\t</Grant>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"Group\">
\t\t\t\t<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
\t\t\t</Grantee>
\t\t\t<Permission>READ_ACP</Permission>
\t\t</Grant>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"Group\">
\t\t\t\t<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
\t\t\t</Grantee>
\t\t\t<Permission>WRITE_ACP</Permission>
\t\t</Grant>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"CanonicalUser\">
\t\t\t\t<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\t\t\t\t<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\t\t\t</Grantee>
\t\t\t<Permission>READ</Permission>
\t\t</Grant>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"CanonicalUser\">
\t\t\t\t<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\t\t\t\t<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\t\t\t</Grantee>
\t\t\t<Permission>WRITE</Permission>
\t\t</Grant>
\t\t<Grant>
\t\t\t<Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"Group\">
\t\t\t\t<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
\t\t\t</Grantee>
\t\t\t<Permission>FULL_CONTROL</Permission>
\t\t</Grant>
\t</AccessControlList>
</AccessControlPolicy>
variables:
info:
fn::invoke:
function: tencentcloud:getUserInfo
arguments: {}
appId: ${info.appId}
Using verbose acl with CDC cluster
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const region = "ap-guangzhou";
const cdcId = "cluster-262n63e8";
const info = tencentcloud.getUserInfo({});
const appId = info.then(info => info.appId);
const bucketWithAcl = new tencentcloud.CosBucket("bucket_with_acl", {
bucket: appId.then(appId => `private-bucket-${appId}`),
acl: "private",
aclBody: `<AccessControlPolicy>
<Owner>
<ID>qcs::cam::uin/100023201586:uin/100023201586</ID>
<DisplayName>qcs::cam::uin/100023201586:uin/100023201586</DisplayName>
</Owner>
<AccessControlList>
<Grant>
<Grantee type=\\"CanonicalUser\\">
<ID>qcs::cam::uin/100015006748:uin/100015006748</ID>
<DisplayName>qcs::cam::uin/100015006748:uin/100015006748</DisplayName>
</Grantee>
<Permission>WRITE</Permission>
</Grant>
<Grant>
<Grantee type=\\"CanonicalUser\\">
<ID>qcs::cam::uin/100023201586:uin/100023201586</ID>
<DisplayName>qcs::cam::uin/100023201586:uin/100023201586</DisplayName>
</Grantee>
<Permission>FULL_CONTROL</Permission>
</Grant>
</AccessControlList>
</AccessControlPolicy>
`,
});
import pulumi
import pulumi_tencentcloud as tencentcloud
region = "ap-guangzhou"
cdc_id = "cluster-262n63e8"
info = tencentcloud.get_user_info()
app_id = info.app_id
bucket_with_acl = tencentcloud.CosBucket("bucket_with_acl",
bucket=f"private-bucket-{app_id}",
acl="private",
acl_body="""<AccessControlPolicy>
<Owner>
<ID>qcs::cam::uin/100023201586:uin/100023201586</ID>
<DisplayName>qcs::cam::uin/100023201586:uin/100023201586</DisplayName>
</Owner>
<AccessControlList>
<Grant>
<Grantee type=\"CanonicalUser\">
<ID>qcs::cam::uin/100015006748:uin/100015006748</ID>
<DisplayName>qcs::cam::uin/100015006748:uin/100015006748</DisplayName>
</Grantee>
<Permission>WRITE</Permission>
</Grant>
<Grant>
<Grantee type=\"CanonicalUser\">
<ID>qcs::cam::uin/100023201586:uin/100023201586</ID>
<DisplayName>qcs::cam::uin/100023201586:uin/100023201586</DisplayName>
</Grantee>
<Permission>FULL_CONTROL</Permission>
</Grant>
</AccessControlList>
</AccessControlPolicy>
""")
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 {
_ := "ap-guangzhou"
_ := "cluster-262n63e8"
info, err := tencentcloud.GetUserInfo(ctx, &tencentcloud.GetUserInfoArgs{}, nil)
if err != nil {
return err
}
appId := info.AppId
_, err = tencentcloud.NewCosBucket(ctx, "bucket_with_acl", &tencentcloud.CosBucketArgs{
Bucket: pulumi.Sprintf("private-bucket-%v", appId),
Acl: pulumi.String("private"),
AclBody: pulumi.String(`<AccessControlPolicy>
<Owner>
<ID>qcs::cam::uin/100023201586:uin/100023201586</ID>
<DisplayName>qcs::cam::uin/100023201586:uin/100023201586</DisplayName>
</Owner>
<AccessControlList>
<Grant>
<Grantee type=\"CanonicalUser\">
<ID>qcs::cam::uin/100015006748:uin/100015006748</ID>
<DisplayName>qcs::cam::uin/100015006748:uin/100015006748</DisplayName>
</Grantee>
<Permission>WRITE</Permission>
</Grant>
<Grant>
<Grantee type=\"CanonicalUser\">
<ID>qcs::cam::uin/100023201586:uin/100023201586</ID>
<DisplayName>qcs::cam::uin/100023201586:uin/100023201586</DisplayName>
</Grantee>
<Permission>FULL_CONTROL</Permission>
</Grant>
</AccessControlList>
</AccessControlPolicy>
`),
})
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 region = "ap-guangzhou";
var cdcId = "cluster-262n63e8";
var info = Tencentcloud.GetUserInfo.Invoke();
var appId = info.Apply(getUserInfoResult => getUserInfoResult.AppId);
var bucketWithAcl = new Tencentcloud.CosBucket("bucket_with_acl", new()
{
Bucket = appId.Apply(appId => $"private-bucket-{appId}"),
Acl = "private",
AclBody = @"<AccessControlPolicy>
<Owner>
<ID>qcs::cam::uin/100023201586:uin/100023201586</ID>
<DisplayName>qcs::cam::uin/100023201586:uin/100023201586</DisplayName>
</Owner>
<AccessControlList>
<Grant>
<Grantee type=\""CanonicalUser\"">
<ID>qcs::cam::uin/100015006748:uin/100015006748</ID>
<DisplayName>qcs::cam::uin/100015006748:uin/100015006748</DisplayName>
</Grantee>
<Permission>WRITE</Permission>
</Grant>
<Grant>
<Grantee type=\""CanonicalUser\"">
<ID>qcs::cam::uin/100023201586:uin/100023201586</ID>
<DisplayName>qcs::cam::uin/100023201586:uin/100023201586</DisplayName>
</Grantee>
<Permission>FULL_CONTROL</Permission>
</Grant>
</AccessControlList>
</AccessControlPolicy>
",
});
});
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 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 region = "ap-guangzhou";
final var cdcId = "cluster-262n63e8";
final var info = TencentcloudFunctions.getUserInfo(GetUserInfoArgs.builder()
.build());
final var appId = info.appId();
var bucketWithAcl = new CosBucket("bucketWithAcl", CosBucketArgs.builder()
.bucket(String.format("private-bucket-%s", appId))
.acl("private")
.aclBody("""
<AccessControlPolicy>
<Owner>
<ID>qcs::cam::uin/100023201586:uin/100023201586</ID>
<DisplayName>qcs::cam::uin/100023201586:uin/100023201586</DisplayName>
</Owner>
<AccessControlList>
<Grant>
<Grantee type=\"CanonicalUser\">
<ID>qcs::cam::uin/100015006748:uin/100015006748</ID>
<DisplayName>qcs::cam::uin/100015006748:uin/100015006748</DisplayName>
</Grantee>
<Permission>WRITE</Permission>
</Grant>
<Grant>
<Grantee type=\"CanonicalUser\">
<ID>qcs::cam::uin/100023201586:uin/100023201586</ID>
<DisplayName>qcs::cam::uin/100023201586:uin/100023201586</DisplayName>
</Grantee>
<Permission>FULL_CONTROL</Permission>
</Grant>
</AccessControlList>
</AccessControlPolicy>
""")
.build());
}
}
resources:
bucketWithAcl:
type: tencentcloud:CosBucket
name: bucket_with_acl
properties:
bucket: private-bucket-${appId}
acl: private
aclBody: |
<AccessControlPolicy>
<Owner>
<ID>qcs::cam::uin/100023201586:uin/100023201586</ID>
<DisplayName>qcs::cam::uin/100023201586:uin/100023201586</DisplayName>
</Owner>
<AccessControlList>
<Grant>
<Grantee type=\"CanonicalUser\">
<ID>qcs::cam::uin/100015006748:uin/100015006748</ID>
<DisplayName>qcs::cam::uin/100015006748:uin/100015006748</DisplayName>
</Grantee>
<Permission>WRITE</Permission>
</Grant>
<Grant>
<Grantee type=\"CanonicalUser\">
<ID>qcs::cam::uin/100023201586:uin/100023201586</ID>
<DisplayName>qcs::cam::uin/100023201586:uin/100023201586</DisplayName>
</Grantee>
<Permission>FULL_CONTROL</Permission>
</Grant>
</AccessControlList>
</AccessControlPolicy>
variables:
region: ap-guangzhou
cdcId: cluster-262n63e8
info:
fn::invoke:
function: tencentcloud:getUserInfo
arguments: {}
appId: ${info.appId}
Static Website
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const info = tencentcloud.getUserInfo({});
const appId = info.then(info => info.appId);
const bucketWithStaticWebsite = new tencentcloud.CosBucket("bucket_with_static_website", {
bucket: appId.then(appId => `bucket-with-static-website-${appId}`),
website: {
indexDocument: "index.html",
errorDocument: "error.html",
redirectAllRequestsTo: "https",
routingRules: {
rules: [
{
conditionErrorCode: "404",
redirectProtocol: "https",
redirectReplaceKeyPrefix: "/test",
},
{
conditionPrefix: "/test",
redirectProtocol: "https",
redirectReplaceKey: "key",
},
],
},
},
});
export const endpointTest = bucketWithStaticWebsite.website.apply(website => website?.endpoint);
import pulumi
import pulumi_tencentcloud as tencentcloud
info = tencentcloud.get_user_info()
app_id = info.app_id
bucket_with_static_website = tencentcloud.CosBucket("bucket_with_static_website",
bucket=f"bucket-with-static-website-{app_id}",
website={
"index_document": "index.html",
"error_document": "error.html",
"redirect_all_requests_to": "https",
"routing_rules": {
"rules": [
{
"condition_error_code": "404",
"redirect_protocol": "https",
"redirect_replace_key_prefix": "/test",
},
{
"condition_prefix": "/test",
"redirect_protocol": "https",
"redirect_replace_key": "key",
},
],
},
})
pulumi.export("endpointTest", bucket_with_static_website.website.endpoint)
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
bucketWithStaticWebsite, err := tencentcloud.NewCosBucket(ctx, "bucket_with_static_website", &tencentcloud.CosBucketArgs{
Bucket: pulumi.Sprintf("bucket-with-static-website-%v", appId),
Website: &tencentcloud.CosBucketWebsiteArgs{
IndexDocument: pulumi.String("index.html"),
ErrorDocument: pulumi.String("error.html"),
RedirectAllRequestsTo: pulumi.String("https"),
RoutingRules: &tencentcloud.CosBucketWebsiteRoutingRulesArgs{
Rules: tencentcloud.CosBucketWebsiteRoutingRulesRuleArray{
&tencentcloud.CosBucketWebsiteRoutingRulesRuleArgs{
ConditionErrorCode: pulumi.String("404"),
RedirectProtocol: pulumi.String("https"),
RedirectReplaceKeyPrefix: pulumi.String("/test"),
},
&tencentcloud.CosBucketWebsiteRoutingRulesRuleArgs{
ConditionPrefix: pulumi.String("/test"),
RedirectProtocol: pulumi.String("https"),
RedirectReplaceKey: pulumi.String("key"),
},
},
},
},
})
if err != nil {
return err
}
ctx.Export("endpointTest", bucketWithStaticWebsite.Website.ApplyT(func(website tencentcloud.CosBucketWebsite) (*string, error) {
return &website.Endpoint, nil
}).(pulumi.StringPtrOutput))
return nil
})
}
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 bucketWithStaticWebsite = new Tencentcloud.CosBucket("bucket_with_static_website", new()
{
Bucket = appId.Apply(appId => $"bucket-with-static-website-{appId}"),
Website = new Tencentcloud.Inputs.CosBucketWebsiteArgs
{
IndexDocument = "index.html",
ErrorDocument = "error.html",
RedirectAllRequestsTo = "https",
RoutingRules = new Tencentcloud.Inputs.CosBucketWebsiteRoutingRulesArgs
{
Rules = new[]
{
new Tencentcloud.Inputs.CosBucketWebsiteRoutingRulesRuleArgs
{
ConditionErrorCode = "404",
RedirectProtocol = "https",
RedirectReplaceKeyPrefix = "/test",
},
new Tencentcloud.Inputs.CosBucketWebsiteRoutingRulesRuleArgs
{
ConditionPrefix = "/test",
RedirectProtocol = "https",
RedirectReplaceKey = "key",
},
},
},
},
});
return new Dictionary<string, object?>
{
["endpointTest"] = bucketWithStaticWebsite.Website.Apply(website => website?.Endpoint),
};
});
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.inputs.CosBucketWebsiteArgs;
import com.pulumi.tencentcloud.inputs.CosBucketWebsiteRoutingRulesArgs;
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(GetUserInfoArgs.builder()
.build());
final var appId = info.appId();
var bucketWithStaticWebsite = new CosBucket("bucketWithStaticWebsite", CosBucketArgs.builder()
.bucket(String.format("bucket-with-static-website-%s", appId))
.website(CosBucketWebsiteArgs.builder()
.indexDocument("index.html")
.errorDocument("error.html")
.redirectAllRequestsTo("https")
.routingRules(CosBucketWebsiteRoutingRulesArgs.builder()
.rules(
CosBucketWebsiteRoutingRulesRuleArgs.builder()
.conditionErrorCode("404")
.redirectProtocol("https")
.redirectReplaceKeyPrefix("/test")
.build(),
CosBucketWebsiteRoutingRulesRuleArgs.builder()
.conditionPrefix("/test")
.redirectProtocol("https")
.redirectReplaceKey("key")
.build())
.build())
.build())
.build());
ctx.export("endpointTest", bucketWithStaticWebsite.website().applyValue(_website -> _website.endpoint()));
}
}
resources:
bucketWithStaticWebsite:
type: tencentcloud:CosBucket
name: bucket_with_static_website
properties:
bucket: bucket-with-static-website-${appId}
website:
indexDocument: index.html
errorDocument: error.html
redirectAllRequestsTo: https
routingRules:
rules:
- conditionErrorCode: '404'
redirectProtocol: https
redirectReplaceKeyPrefix: /test
- conditionPrefix: /test
redirectProtocol: https
redirectReplaceKey: key
variables:
info:
fn::invoke:
function: tencentcloud:getUserInfo
arguments: {}
appId: ${info.appId}
outputs:
endpointTest: ${bucketWithStaticWebsite.website.endpoint}
Using CORS
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const info = tencentcloud.getUserInfo({});
const appId = info.then(info => info.appId);
const bucketWithCors = new tencentcloud.CosBucket("bucket_with_cors", {
bucket: appId.then(appId => `bucket-with-cors-${appId}`),
acl: "public-read-write",
corsRules: [{
allowedOrigins: ["http://*.abc.com"],
allowedMethods: [
"PUT",
"POST",
],
allowedHeaders: ["*"],
maxAgeSeconds: 300,
exposeHeaders: ["Etag"],
}],
});
import pulumi
import pulumi_tencentcloud as tencentcloud
info = tencentcloud.get_user_info()
app_id = info.app_id
bucket_with_cors = tencentcloud.CosBucket("bucket_with_cors",
bucket=f"bucket-with-cors-{app_id}",
acl="public-read-write",
cors_rules=[{
"allowed_origins": ["http://*.abc.com"],
"allowed_methods": [
"PUT",
"POST",
],
"allowed_headers": ["*"],
"max_age_seconds": 300,
"expose_headers": ["Etag"],
}])
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
_, err = tencentcloud.NewCosBucket(ctx, "bucket_with_cors", &tencentcloud.CosBucketArgs{
Bucket: pulumi.Sprintf("bucket-with-cors-%v", appId),
Acl: pulumi.String("public-read-write"),
CorsRules: tencentcloud.CosBucketCorsRuleArray{
&tencentcloud.CosBucketCorsRuleArgs{
AllowedOrigins: pulumi.StringArray{
pulumi.String("http://*.abc.com"),
},
AllowedMethods: pulumi.StringArray{
pulumi.String("PUT"),
pulumi.String("POST"),
},
AllowedHeaders: pulumi.StringArray{
pulumi.String("*"),
},
MaxAgeSeconds: pulumi.Float64(300),
ExposeHeaders: pulumi.StringArray{
pulumi.String("Etag"),
},
},
},
})
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 info = Tencentcloud.GetUserInfo.Invoke();
var appId = info.Apply(getUserInfoResult => getUserInfoResult.AppId);
var bucketWithCors = new Tencentcloud.CosBucket("bucket_with_cors", new()
{
Bucket = appId.Apply(appId => $"bucket-with-cors-{appId}"),
Acl = "public-read-write",
CorsRules = new[]
{
new Tencentcloud.Inputs.CosBucketCorsRuleArgs
{
AllowedOrigins = new[]
{
"http://*.abc.com",
},
AllowedMethods = new[]
{
"PUT",
"POST",
},
AllowedHeaders = new[]
{
"*",
},
MaxAgeSeconds = 300,
ExposeHeaders = new[]
{
"Etag",
},
},
},
});
});
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.inputs.CosBucketCorsRuleArgs;
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(GetUserInfoArgs.builder()
.build());
final var appId = info.appId();
var bucketWithCors = new CosBucket("bucketWithCors", CosBucketArgs.builder()
.bucket(String.format("bucket-with-cors-%s", appId))
.acl("public-read-write")
.corsRules(CosBucketCorsRuleArgs.builder()
.allowedOrigins("http://*.abc.com")
.allowedMethods(
"PUT",
"POST")
.allowedHeaders("*")
.maxAgeSeconds(300.0)
.exposeHeaders("Etag")
.build())
.build());
}
}
resources:
bucketWithCors:
type: tencentcloud:CosBucket
name: bucket_with_cors
properties:
bucket: bucket-with-cors-${appId}
acl: public-read-write
corsRules:
- allowedOrigins:
- http://*.abc.com
allowedMethods:
- PUT
- POST
allowedHeaders:
- '*'
maxAgeSeconds: 300
exposeHeaders:
- Etag
variables:
info:
fn::invoke:
function: tencentcloud:getUserInfo
arguments: {}
appId: ${info.appId}
Using Origin pull
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const info = tencentcloud.getUserInfo({});
const appId = info.then(info => info.appId);
const uin = info.then(info => info.uin);
const ownerUin = info.then(info => info.ownerUin);
const example = new tencentcloud.CosBucket("example", {
bucket: appId.then(appId => `tf-bucket-basic10-${appId}`),
acl: "public-read",
originPullRules: [{
priority: 1,
backToSourceMode: "Redirect",
httpRedirectCode: "301",
protocol: "FOLLOW",
host: "1.1.1.1",
followQueryString: true,
}],
});
import pulumi
import pulumi_tencentcloud as tencentcloud
info = tencentcloud.get_user_info()
app_id = info.app_id
uin = info.uin
owner_uin = info.owner_uin
example = tencentcloud.CosBucket("example",
bucket=f"tf-bucket-basic10-{app_id}",
acl="public-read",
origin_pull_rules=[{
"priority": 1,
"back_to_source_mode": "Redirect",
"http_redirect_code": "301",
"protocol": "FOLLOW",
"host": "1.1.1.1",
"follow_query_string": True,
}])
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
_ := info.Uin
_ := info.OwnerUin
_, err = tencentcloud.NewCosBucket(ctx, "example", &tencentcloud.CosBucketArgs{
Bucket: pulumi.Sprintf("tf-bucket-basic10-%v", appId),
Acl: pulumi.String("public-read"),
OriginPullRules: tencentcloud.CosBucketOriginPullRuleArray{
&tencentcloud.CosBucketOriginPullRuleArgs{
Priority: pulumi.Float64(1),
BackToSourceMode: pulumi.String("Redirect"),
HttpRedirectCode: pulumi.String("301"),
Protocol: pulumi.String("FOLLOW"),
Host: pulumi.String("1.1.1.1"),
FollowQueryString: pulumi.Bool(true),
},
},
})
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 info = Tencentcloud.GetUserInfo.Invoke();
var appId = info.Apply(getUserInfoResult => getUserInfoResult.AppId);
var uin = info.Apply(getUserInfoResult => getUserInfoResult.Uin);
var ownerUin = info.Apply(getUserInfoResult => getUserInfoResult.OwnerUin);
var example = new Tencentcloud.CosBucket("example", new()
{
Bucket = appId.Apply(appId => $"tf-bucket-basic10-{appId}"),
Acl = "public-read",
OriginPullRules = new[]
{
new Tencentcloud.Inputs.CosBucketOriginPullRuleArgs
{
Priority = 1,
BackToSourceMode = "Redirect",
HttpRedirectCode = "301",
Protocol = "FOLLOW",
Host = "1.1.1.1",
FollowQueryString = true,
},
},
});
});
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.inputs.CosBucketOriginPullRuleArgs;
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(GetUserInfoArgs.builder()
.build());
final var appId = info.appId();
final var uin = info.uin();
final var ownerUin = info.ownerUin();
var example = new CosBucket("example", CosBucketArgs.builder()
.bucket(String.format("tf-bucket-basic10-%s", appId))
.acl("public-read")
.originPullRules(CosBucketOriginPullRuleArgs.builder()
.priority(1.0)
.backToSourceMode("Redirect")
.httpRedirectCode("301")
.protocol("FOLLOW")
.host("1.1.1.1")
.followQueryString(true)
.build())
.build());
}
}
resources:
example:
type: tencentcloud:CosBucket
properties:
bucket: tf-bucket-basic10-${appId}
acl: public-read
originPullRules:
- priority: 1
backToSourceMode: Redirect
httpRedirectCode: '301'
protocol: FOLLOW
host: 1.1.1.1
followQueryString: true
variables:
info:
fn::invoke:
function: tencentcloud:getUserInfo
arguments: {}
appId: ${info.appId}
uin: ${info.uin}
ownerUin: ${info.ownerUin}
Using CORS with CDC
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const region = "ap-guangzhou";
const cdcId = "cluster-262n63e8";
const info = tencentcloud.getUserInfo({});
const appId = info.then(info => info.appId);
const bucketWithCors = new tencentcloud.CosBucket("bucket_with_cors", {
bucket: appId.then(appId => `bucket-with-cors-${appId}`),
corsRules: [{
allowedOrigins: ["http://*.abc.com"],
allowedMethods: [
"PUT",
"POST",
],
allowedHeaders: ["*"],
maxAgeSeconds: 300,
exposeHeaders: ["Etag"],
}],
});
import pulumi
import pulumi_tencentcloud as tencentcloud
region = "ap-guangzhou"
cdc_id = "cluster-262n63e8"
info = tencentcloud.get_user_info()
app_id = info.app_id
bucket_with_cors = tencentcloud.CosBucket("bucket_with_cors",
bucket=f"bucket-with-cors-{app_id}",
cors_rules=[{
"allowed_origins": ["http://*.abc.com"],
"allowed_methods": [
"PUT",
"POST",
],
"allowed_headers": ["*"],
"max_age_seconds": 300,
"expose_headers": ["Etag"],
}])
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 {
_ := "ap-guangzhou"
_ := "cluster-262n63e8"
info, err := tencentcloud.GetUserInfo(ctx, &tencentcloud.GetUserInfoArgs{}, nil)
if err != nil {
return err
}
appId := info.AppId
_, err = tencentcloud.NewCosBucket(ctx, "bucket_with_cors", &tencentcloud.CosBucketArgs{
Bucket: pulumi.Sprintf("bucket-with-cors-%v", appId),
CorsRules: tencentcloud.CosBucketCorsRuleArray{
&tencentcloud.CosBucketCorsRuleArgs{
AllowedOrigins: pulumi.StringArray{
pulumi.String("http://*.abc.com"),
},
AllowedMethods: pulumi.StringArray{
pulumi.String("PUT"),
pulumi.String("POST"),
},
AllowedHeaders: pulumi.StringArray{
pulumi.String("*"),
},
MaxAgeSeconds: pulumi.Float64(300),
ExposeHeaders: pulumi.StringArray{
pulumi.String("Etag"),
},
},
},
})
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 region = "ap-guangzhou";
var cdcId = "cluster-262n63e8";
var info = Tencentcloud.GetUserInfo.Invoke();
var appId = info.Apply(getUserInfoResult => getUserInfoResult.AppId);
var bucketWithCors = new Tencentcloud.CosBucket("bucket_with_cors", new()
{
Bucket = appId.Apply(appId => $"bucket-with-cors-{appId}"),
CorsRules = new[]
{
new Tencentcloud.Inputs.CosBucketCorsRuleArgs
{
AllowedOrigins = new[]
{
"http://*.abc.com",
},
AllowedMethods = new[]
{
"PUT",
"POST",
},
AllowedHeaders = new[]
{
"*",
},
MaxAgeSeconds = 300,
ExposeHeaders = new[]
{
"Etag",
},
},
},
});
});
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.inputs.CosBucketCorsRuleArgs;
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 region = "ap-guangzhou";
final var cdcId = "cluster-262n63e8";
final var info = TencentcloudFunctions.getUserInfo(GetUserInfoArgs.builder()
.build());
final var appId = info.appId();
var bucketWithCors = new CosBucket("bucketWithCors", CosBucketArgs.builder()
.bucket(String.format("bucket-with-cors-%s", appId))
.corsRules(CosBucketCorsRuleArgs.builder()
.allowedOrigins("http://*.abc.com")
.allowedMethods(
"PUT",
"POST")
.allowedHeaders("*")
.maxAgeSeconds(300.0)
.exposeHeaders("Etag")
.build())
.build());
}
}
resources:
bucketWithCors:
type: tencentcloud:CosBucket
name: bucket_with_cors
properties:
bucket: bucket-with-cors-${appId}
corsRules:
- allowedOrigins:
- http://*.abc.com
allowedMethods:
- PUT
- POST
allowedHeaders:
- '*'
maxAgeSeconds: 300
exposeHeaders:
- Etag
variables:
region: ap-guangzhou
cdcId: cluster-262n63e8
info:
fn::invoke:
function: tencentcloud:getUserInfo
arguments: {}
appId: ${info.appId}
Using object lifecycle
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const info = tencentcloud.getUserInfo({});
const appId = info.then(info => info.appId);
const bucketWithLifecycle = new tencentcloud.CosBucket("bucket_with_lifecycle", {
bucket: appId.then(appId => `bucket-with-lifecycle-${appId}`),
acl: "public-read-write",
lifecycleRules: [{
filterPrefix: "path1/",
transitions: [{
days: 30,
storageClass: "STANDARD_IA",
}],
expiration: {
days: 90,
},
}],
});
import pulumi
import pulumi_tencentcloud as tencentcloud
info = tencentcloud.get_user_info()
app_id = info.app_id
bucket_with_lifecycle = tencentcloud.CosBucket("bucket_with_lifecycle",
bucket=f"bucket-with-lifecycle-{app_id}",
acl="public-read-write",
lifecycle_rules=[{
"filter_prefix": "path1/",
"transitions": [{
"days": 30,
"storage_class": "STANDARD_IA",
}],
"expiration": {
"days": 90,
},
}])
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
_, err = tencentcloud.NewCosBucket(ctx, "bucket_with_lifecycle", &tencentcloud.CosBucketArgs{
Bucket: pulumi.Sprintf("bucket-with-lifecycle-%v", appId),
Acl: pulumi.String("public-read-write"),
LifecycleRules: tencentcloud.CosBucketLifecycleRuleArray{
&tencentcloud.CosBucketLifecycleRuleArgs{
FilterPrefix: pulumi.String("path1/"),
Transitions: tencentcloud.CosBucketLifecycleRuleTransitionArray{
&tencentcloud.CosBucketLifecycleRuleTransitionArgs{
Days: pulumi.Float64(30),
StorageClass: pulumi.String("STANDARD_IA"),
},
},
Expiration: &tencentcloud.CosBucketLifecycleRuleExpirationArgs{
Days: pulumi.Float64(90),
},
},
},
})
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 info = Tencentcloud.GetUserInfo.Invoke();
var appId = info.Apply(getUserInfoResult => getUserInfoResult.AppId);
var bucketWithLifecycle = new Tencentcloud.CosBucket("bucket_with_lifecycle", new()
{
Bucket = appId.Apply(appId => $"bucket-with-lifecycle-{appId}"),
Acl = "public-read-write",
LifecycleRules = new[]
{
new Tencentcloud.Inputs.CosBucketLifecycleRuleArgs
{
FilterPrefix = "path1/",
Transitions = new[]
{
new Tencentcloud.Inputs.CosBucketLifecycleRuleTransitionArgs
{
Days = 30,
StorageClass = "STANDARD_IA",
},
},
Expiration = new Tencentcloud.Inputs.CosBucketLifecycleRuleExpirationArgs
{
Days = 90,
},
},
},
});
});
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.inputs.CosBucketLifecycleRuleArgs;
import com.pulumi.tencentcloud.inputs.CosBucketLifecycleRuleExpirationArgs;
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(GetUserInfoArgs.builder()
.build());
final var appId = info.appId();
var bucketWithLifecycle = new CosBucket("bucketWithLifecycle", CosBucketArgs.builder()
.bucket(String.format("bucket-with-lifecycle-%s", appId))
.acl("public-read-write")
.lifecycleRules(CosBucketLifecycleRuleArgs.builder()
.filterPrefix("path1/")
.transitions(CosBucketLifecycleRuleTransitionArgs.builder()
.days(30.0)
.storageClass("STANDARD_IA")
.build())
.expiration(CosBucketLifecycleRuleExpirationArgs.builder()
.days(90.0)
.build())
.build())
.build());
}
}
resources:
bucketWithLifecycle:
type: tencentcloud:CosBucket
name: bucket_with_lifecycle
properties:
bucket: bucket-with-lifecycle-${appId}
acl: public-read-write
lifecycleRules:
- filterPrefix: path1/
transitions:
- days: 30
storageClass: STANDARD_IA
expiration:
days: 90
variables:
info:
fn::invoke:
function: tencentcloud:getUserInfo
arguments: {}
appId: ${info.appId}
Using object lifecycle with CDC
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const region = "ap-guangzhou";
const cdcId = "cluster-262n63e8";
const info = tencentcloud.getUserInfo({});
const appId = info.then(info => info.appId);
const bucketWithLifecycle = new tencentcloud.CosBucket("bucket_with_lifecycle", {
bucket: appId.then(appId => `bucket-with-lifecycle-${appId}`),
acl: "private",
lifecycleRules: [{
filterPrefix: "path1/",
expiration: {
days: 90,
},
}],
});
import pulumi
import pulumi_tencentcloud as tencentcloud
region = "ap-guangzhou"
cdc_id = "cluster-262n63e8"
info = tencentcloud.get_user_info()
app_id = info.app_id
bucket_with_lifecycle = tencentcloud.CosBucket("bucket_with_lifecycle",
bucket=f"bucket-with-lifecycle-{app_id}",
acl="private",
lifecycle_rules=[{
"filter_prefix": "path1/",
"expiration": {
"days": 90,
},
}])
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 {
_ := "ap-guangzhou"
_ := "cluster-262n63e8"
info, err := tencentcloud.GetUserInfo(ctx, &tencentcloud.GetUserInfoArgs{}, nil)
if err != nil {
return err
}
appId := info.AppId
_, err = tencentcloud.NewCosBucket(ctx, "bucket_with_lifecycle", &tencentcloud.CosBucketArgs{
Bucket: pulumi.Sprintf("bucket-with-lifecycle-%v", appId),
Acl: pulumi.String("private"),
LifecycleRules: tencentcloud.CosBucketLifecycleRuleArray{
&tencentcloud.CosBucketLifecycleRuleArgs{
FilterPrefix: pulumi.String("path1/"),
Expiration: &tencentcloud.CosBucketLifecycleRuleExpirationArgs{
Days: pulumi.Float64(90),
},
},
},
})
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 region = "ap-guangzhou";
var cdcId = "cluster-262n63e8";
var info = Tencentcloud.GetUserInfo.Invoke();
var appId = info.Apply(getUserInfoResult => getUserInfoResult.AppId);
var bucketWithLifecycle = new Tencentcloud.CosBucket("bucket_with_lifecycle", new()
{
Bucket = appId.Apply(appId => $"bucket-with-lifecycle-{appId}"),
Acl = "private",
LifecycleRules = new[]
{
new Tencentcloud.Inputs.CosBucketLifecycleRuleArgs
{
FilterPrefix = "path1/",
Expiration = new Tencentcloud.Inputs.CosBucketLifecycleRuleExpirationArgs
{
Days = 90,
},
},
},
});
});
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.inputs.CosBucketLifecycleRuleArgs;
import com.pulumi.tencentcloud.inputs.CosBucketLifecycleRuleExpirationArgs;
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 region = "ap-guangzhou";
final var cdcId = "cluster-262n63e8";
final var info = TencentcloudFunctions.getUserInfo(GetUserInfoArgs.builder()
.build());
final var appId = info.appId();
var bucketWithLifecycle = new CosBucket("bucketWithLifecycle", CosBucketArgs.builder()
.bucket(String.format("bucket-with-lifecycle-%s", appId))
.acl("private")
.lifecycleRules(CosBucketLifecycleRuleArgs.builder()
.filterPrefix("path1/")
.expiration(CosBucketLifecycleRuleExpirationArgs.builder()
.days(90.0)
.build())
.build())
.build());
}
}
resources:
bucketWithLifecycle:
type: tencentcloud:CosBucket
name: bucket_with_lifecycle
properties:
bucket: bucket-with-lifecycle-${appId}
acl: private
lifecycleRules:
- filterPrefix: path1/
expiration:
days: 90
variables:
region: ap-guangzhou
cdcId: cluster-262n63e8
info:
fn::invoke:
function: tencentcloud:getUserInfo
arguments: {}
appId: ${info.appId}
Using replication
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const info = tencentcloud.getUserInfo({});
const appId = info.then(info => info.appId);
const uin = info.then(info => info.uin);
const ownerUin = info.then(info => info.ownerUin);
const region = "ap-guangzhou";
const bucketReplicate = new tencentcloud.CosBucket("bucket_replicate", {
bucket: appId.then(appId => `bucket-replicate-${appId}`),
acl: "private",
versioningEnable: true,
});
const bucketWithReplication = new tencentcloud.CosBucket("bucket_with_replication", {
bucket: appId.then(appId => `bucket-with-replication-${appId}`),
acl: "private",
versioningEnable: true,
replicaRole: Promise.all([ownerUin, uin]).then(([ownerUin, uin]) => `qcs::cam::uin/${ownerUin}:uin/${uin}`),
replicaRules: [
{
id: "rule1",
status: "Enabled",
priority: 1,
prefix: "/prefix",
filter: {
and: {
tags: [
{
key: "tagKey1",
value: "tagValue1",
},
{
key: "tagKey2",
value: "tagValue2",
},
],
},
},
destinationBucket: pulumi.interpolate`qcs::cos:${region}::${bucketReplicate.bucket}`,
destinationStorageClass: "Standard",
destinationEncryptionKmsKeyId: "4f14a617-7c7d-11ef-9a62-525400d3a886",
deleteMarkerReplication: {
status: "Disabled",
},
sourceSelectionCriteria: {
sseKmsEncryptedObjects: {
status: "Enabled",
},
},
},
{
id: "rule2",
status: "Enabled",
priority: 2,
destinationBucket: pulumi.interpolate`qcs::cos:${region}::${bucketReplicate.bucket}`,
destinationStorageClass: "Standard",
destinationEncryptionKmsKeyId: "4f14a617-7c7d-11ef-9a62-525400d3a886",
deleteMarkerReplication: {
status: "Enabled",
},
sourceSelectionCriteria: {
sseKmsEncryptedObjects: {
status: "Enabled",
},
},
},
],
});
import pulumi
import pulumi_tencentcloud as tencentcloud
info = tencentcloud.get_user_info()
app_id = info.app_id
uin = info.uin
owner_uin = info.owner_uin
region = "ap-guangzhou"
bucket_replicate = tencentcloud.CosBucket("bucket_replicate",
bucket=f"bucket-replicate-{app_id}",
acl="private",
versioning_enable=True)
bucket_with_replication = tencentcloud.CosBucket("bucket_with_replication",
bucket=f"bucket-with-replication-{app_id}",
acl="private",
versioning_enable=True,
replica_role=f"qcs::cam::uin/{owner_uin}:uin/{uin}",
replica_rules=[
{
"id": "rule1",
"status": "Enabled",
"priority": 1,
"prefix": "/prefix",
"filter": {
"and_": {
"tags": [
{
"key": "tagKey1",
"value": "tagValue1",
},
{
"key": "tagKey2",
"value": "tagValue2",
},
],
},
},
"destination_bucket": bucket_replicate.bucket.apply(lambda bucket: f"qcs::cos:{region}::{bucket}"),
"destination_storage_class": "Standard",
"destination_encryption_kms_key_id": "4f14a617-7c7d-11ef-9a62-525400d3a886",
"delete_marker_replication": {
"status": "Disabled",
},
"source_selection_criteria": {
"sse_kms_encrypted_objects": {
"status": "Enabled",
},
},
},
{
"id": "rule2",
"status": "Enabled",
"priority": 2,
"destination_bucket": bucket_replicate.bucket.apply(lambda bucket: f"qcs::cos:{region}::{bucket}"),
"destination_storage_class": "Standard",
"destination_encryption_kms_key_id": "4f14a617-7c7d-11ef-9a62-525400d3a886",
"delete_marker_replication": {
"status": "Enabled",
},
"source_selection_criteria": {
"sse_kms_encrypted_objects": {
"status": "Enabled",
},
},
},
])
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
uin := info.Uin
ownerUin := info.OwnerUin
region := "ap-guangzhou"
bucketReplicate, err := tencentcloud.NewCosBucket(ctx, "bucket_replicate", &tencentcloud.CosBucketArgs{
Bucket: pulumi.Sprintf("bucket-replicate-%v", appId),
Acl: pulumi.String("private"),
VersioningEnable: pulumi.Bool(true),
})
if err != nil {
return err
}
_, err = tencentcloud.NewCosBucket(ctx, "bucket_with_replication", &tencentcloud.CosBucketArgs{
Bucket: pulumi.Sprintf("bucket-with-replication-%v", appId),
Acl: pulumi.String("private"),
VersioningEnable: pulumi.Bool(true),
ReplicaRole: pulumi.Sprintf("qcs::cam::uin/%v:uin/%v", ownerUin, uin),
ReplicaRules: tencentcloud.CosBucketReplicaRuleArray{
&tencentcloud.CosBucketReplicaRuleArgs{
Id: pulumi.String("rule1"),
Status: pulumi.String("Enabled"),
Priority: pulumi.Float64(1),
Prefix: pulumi.String("/prefix"),
Filter: &tencentcloud.CosBucketReplicaRuleFilterArgs{
And: &tencentcloud.CosBucketReplicaRuleFilterAndArgs{
Tags: tencentcloud.CosBucketReplicaRuleFilterAndTagArray{
&tencentcloud.CosBucketReplicaRuleFilterAndTagArgs{
Key: pulumi.String("tagKey1"),
Value: pulumi.String("tagValue1"),
},
&tencentcloud.CosBucketReplicaRuleFilterAndTagArgs{
Key: pulumi.String("tagKey2"),
Value: pulumi.String("tagValue2"),
},
},
},
},
DestinationBucket: bucketReplicate.Bucket.ApplyT(func(bucket string) (string, error) {
return fmt.Sprintf("qcs::cos:%v::%v", region, bucket), nil
}).(pulumi.StringOutput),
DestinationStorageClass: pulumi.String("Standard"),
DestinationEncryptionKmsKeyId: pulumi.String("4f14a617-7c7d-11ef-9a62-525400d3a886"),
DeleteMarkerReplication: &tencentcloud.CosBucketReplicaRuleDeleteMarkerReplicationArgs{
Status: pulumi.String("Disabled"),
},
SourceSelectionCriteria: &tencentcloud.CosBucketReplicaRuleSourceSelectionCriteriaArgs{
SseKmsEncryptedObjects: &tencentcloud.CosBucketReplicaRuleSourceSelectionCriteriaSseKmsEncryptedObjectsArgs{
Status: pulumi.String("Enabled"),
},
},
},
&tencentcloud.CosBucketReplicaRuleArgs{
Id: pulumi.String("rule2"),
Status: pulumi.String("Enabled"),
Priority: pulumi.Float64(2),
DestinationBucket: bucketReplicate.Bucket.ApplyT(func(bucket string) (string, error) {
return fmt.Sprintf("qcs::cos:%v::%v", region, bucket), nil
}).(pulumi.StringOutput),
DestinationStorageClass: pulumi.String("Standard"),
DestinationEncryptionKmsKeyId: pulumi.String("4f14a617-7c7d-11ef-9a62-525400d3a886"),
DeleteMarkerReplication: &tencentcloud.CosBucketReplicaRuleDeleteMarkerReplicationArgs{
Status: pulumi.String("Enabled"),
},
SourceSelectionCriteria: &tencentcloud.CosBucketReplicaRuleSourceSelectionCriteriaArgs{
SseKmsEncryptedObjects: &tencentcloud.CosBucketReplicaRuleSourceSelectionCriteriaSseKmsEncryptedObjectsArgs{
Status: pulumi.String("Enabled"),
},
},
},
},
})
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 info = Tencentcloud.GetUserInfo.Invoke();
var appId = info.Apply(getUserInfoResult => getUserInfoResult.AppId);
var uin = info.Apply(getUserInfoResult => getUserInfoResult.Uin);
var ownerUin = info.Apply(getUserInfoResult => getUserInfoResult.OwnerUin);
var region = "ap-guangzhou";
var bucketReplicate = new Tencentcloud.CosBucket("bucket_replicate", new()
{
Bucket = appId.Apply(appId => $"bucket-replicate-{appId}"),
Acl = "private",
VersioningEnable = true,
});
var bucketWithReplication = new Tencentcloud.CosBucket("bucket_with_replication", new()
{
Bucket = appId.Apply(appId => $"bucket-with-replication-{appId}"),
Acl = "private",
VersioningEnable = true,
ReplicaRole = Output.Tuple(ownerUin, uin).Apply(values =>
{
var ownerUin = values.Item1;
var uin = values.Item2;
return $"qcs::cam::uin/{ownerUin}:uin/{uin}";
}),
ReplicaRules = new[]
{
new Tencentcloud.Inputs.CosBucketReplicaRuleArgs
{
Id = "rule1",
Status = "Enabled",
Priority = 1,
Prefix = "/prefix",
Filter = new Tencentcloud.Inputs.CosBucketReplicaRuleFilterArgs
{
And = new Tencentcloud.Inputs.CosBucketReplicaRuleFilterAndArgs
{
Tags = new[]
{
new Tencentcloud.Inputs.CosBucketReplicaRuleFilterAndTagArgs
{
Key = "tagKey1",
Value = "tagValue1",
},
new Tencentcloud.Inputs.CosBucketReplicaRuleFilterAndTagArgs
{
Key = "tagKey2",
Value = "tagValue2",
},
},
},
},
DestinationBucket = bucketReplicate.Bucket.Apply(bucket => $"qcs::cos:{region}::{bucket}"),
DestinationStorageClass = "Standard",
DestinationEncryptionKmsKeyId = "4f14a617-7c7d-11ef-9a62-525400d3a886",
DeleteMarkerReplication = new Tencentcloud.Inputs.CosBucketReplicaRuleDeleteMarkerReplicationArgs
{
Status = "Disabled",
},
SourceSelectionCriteria = new Tencentcloud.Inputs.CosBucketReplicaRuleSourceSelectionCriteriaArgs
{
SseKmsEncryptedObjects = new Tencentcloud.Inputs.CosBucketReplicaRuleSourceSelectionCriteriaSseKmsEncryptedObjectsArgs
{
Status = "Enabled",
},
},
},
new Tencentcloud.Inputs.CosBucketReplicaRuleArgs
{
Id = "rule2",
Status = "Enabled",
Priority = 2,
DestinationBucket = bucketReplicate.Bucket.Apply(bucket => $"qcs::cos:{region}::{bucket}"),
DestinationStorageClass = "Standard",
DestinationEncryptionKmsKeyId = "4f14a617-7c7d-11ef-9a62-525400d3a886",
DeleteMarkerReplication = new Tencentcloud.Inputs.CosBucketReplicaRuleDeleteMarkerReplicationArgs
{
Status = "Enabled",
},
SourceSelectionCriteria = new Tencentcloud.Inputs.CosBucketReplicaRuleSourceSelectionCriteriaArgs
{
SseKmsEncryptedObjects = new Tencentcloud.Inputs.CosBucketReplicaRuleSourceSelectionCriteriaSseKmsEncryptedObjectsArgs
{
Status = "Enabled",
},
},
},
},
});
});
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.inputs.CosBucketReplicaRuleArgs;
import com.pulumi.tencentcloud.inputs.CosBucketReplicaRuleFilterArgs;
import com.pulumi.tencentcloud.inputs.CosBucketReplicaRuleFilterAndArgs;
import com.pulumi.tencentcloud.inputs.CosBucketReplicaRuleDeleteMarkerReplicationArgs;
import com.pulumi.tencentcloud.inputs.CosBucketReplicaRuleSourceSelectionCriteriaArgs;
import com.pulumi.tencentcloud.inputs.CosBucketReplicaRuleSourceSelectionCriteriaSseKmsEncryptedObjectsArgs;
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(GetUserInfoArgs.builder()
.build());
final var appId = info.appId();
final var uin = info.uin();
final var ownerUin = info.ownerUin();
final var region = "ap-guangzhou";
var bucketReplicate = new CosBucket("bucketReplicate", CosBucketArgs.builder()
.bucket(String.format("bucket-replicate-%s", appId))
.acl("private")
.versioningEnable(true)
.build());
var bucketWithReplication = new CosBucket("bucketWithReplication", CosBucketArgs.builder()
.bucket(String.format("bucket-with-replication-%s", appId))
.acl("private")
.versioningEnable(true)
.replicaRole(String.format("qcs::cam::uin/%s:uin/%s", ownerUin,uin))
.replicaRules(
CosBucketReplicaRuleArgs.builder()
.id("rule1")
.status("Enabled")
.priority(1.0)
.prefix("/prefix")
.filter(CosBucketReplicaRuleFilterArgs.builder()
.and(CosBucketReplicaRuleFilterAndArgs.builder()
.tags(
CosBucketReplicaRuleFilterAndTagArgs.builder()
.key("tagKey1")
.value("tagValue1")
.build(),
CosBucketReplicaRuleFilterAndTagArgs.builder()
.key("tagKey2")
.value("tagValue2")
.build())
.build())
.build())
.destinationBucket(bucketReplicate.bucket().applyValue(_bucket -> String.format("qcs::cos:%s::%s", region,_bucket)))
.destinationStorageClass("Standard")
.destinationEncryptionKmsKeyId("4f14a617-7c7d-11ef-9a62-525400d3a886")
.deleteMarkerReplication(CosBucketReplicaRuleDeleteMarkerReplicationArgs.builder()
.status("Disabled")
.build())
.sourceSelectionCriteria(CosBucketReplicaRuleSourceSelectionCriteriaArgs.builder()
.sseKmsEncryptedObjects(CosBucketReplicaRuleSourceSelectionCriteriaSseKmsEncryptedObjectsArgs.builder()
.status("Enabled")
.build())
.build())
.build(),
CosBucketReplicaRuleArgs.builder()
.id("rule2")
.status("Enabled")
.priority(2.0)
.destinationBucket(bucketReplicate.bucket().applyValue(_bucket -> String.format("qcs::cos:%s::%s", region,_bucket)))
.destinationStorageClass("Standard")
.destinationEncryptionKmsKeyId("4f14a617-7c7d-11ef-9a62-525400d3a886")
.deleteMarkerReplication(CosBucketReplicaRuleDeleteMarkerReplicationArgs.builder()
.status("Enabled")
.build())
.sourceSelectionCriteria(CosBucketReplicaRuleSourceSelectionCriteriaArgs.builder()
.sseKmsEncryptedObjects(CosBucketReplicaRuleSourceSelectionCriteriaSseKmsEncryptedObjectsArgs.builder()
.status("Enabled")
.build())
.build())
.build())
.build());
}
}
resources:
bucketReplicate:
type: tencentcloud:CosBucket
name: bucket_replicate
properties:
bucket: bucket-replicate-${appId}
acl: private
versioningEnable: true
bucketWithReplication:
type: tencentcloud:CosBucket
name: bucket_with_replication
properties:
bucket: bucket-with-replication-${appId}
acl: private
versioningEnable: true
replicaRole: qcs::cam::uin/${ownerUin}:uin/${uin}
replicaRules:
- id: rule1
status: Enabled
priority: 1
prefix: /prefix
filter:
and:
tags:
- key: tagKey1
value: tagValue1
- key: tagKey2
value: tagValue2
destinationBucket: qcs::cos:${region}::${bucketReplicate.bucket}
destinationStorageClass: Standard
destinationEncryptionKmsKeyId: 4f14a617-7c7d-11ef-9a62-525400d3a886
deleteMarkerReplication:
status: Disabled
sourceSelectionCriteria:
sseKmsEncryptedObjects:
status: Enabled
- id: rule2
status: Enabled
priority: 2
destinationBucket: qcs::cos:${region}::${bucketReplicate.bucket}
destinationStorageClass: Standard
destinationEncryptionKmsKeyId: 4f14a617-7c7d-11ef-9a62-525400d3a886
deleteMarkerReplication:
status: Enabled
sourceSelectionCriteria:
sseKmsEncryptedObjects:
status: Enabled
variables:
info:
fn::invoke:
function: tencentcloud:getUserInfo
arguments: {}
appId: ${info.appId}
uin: ${info.uin}
ownerUin: ${info.ownerUin}
region: ap-guangzhou
Using intelligent tiering, Only enable intelligent tiering
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const info = tencentcloud.getUserInfo({});
const appId = info.then(info => info.appId);
const example = new tencentcloud.CosBucket("example", {
bucket: appId.then(appId => `bucket-intelligent-tiering-${appId}`),
acl: "private",
enableIntelligentTiering: true,
intelligentTieringDays: 30,
intelligentTieringRequestFrequent: 1,
});
import pulumi
import pulumi_tencentcloud as tencentcloud
info = tencentcloud.get_user_info()
app_id = info.app_id
example = tencentcloud.CosBucket("example",
bucket=f"bucket-intelligent-tiering-{app_id}",
acl="private",
enable_intelligent_tiering=True,
intelligent_tiering_days=30,
intelligent_tiering_request_frequent=1)
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
_, err = tencentcloud.NewCosBucket(ctx, "example", &tencentcloud.CosBucketArgs{
Bucket: pulumi.Sprintf("bucket-intelligent-tiering-%v", appId),
Acl: pulumi.String("private"),
EnableIntelligentTiering: pulumi.Bool(true),
IntelligentTieringDays: pulumi.Float64(30),
IntelligentTieringRequestFrequent: pulumi.Float64(1),
})
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 info = Tencentcloud.GetUserInfo.Invoke();
var appId = info.Apply(getUserInfoResult => getUserInfoResult.AppId);
var example = new Tencentcloud.CosBucket("example", new()
{
Bucket = appId.Apply(appId => $"bucket-intelligent-tiering-{appId}"),
Acl = "private",
EnableIntelligentTiering = true,
IntelligentTieringDays = 30,
IntelligentTieringRequestFrequent = 1,
});
});
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 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(GetUserInfoArgs.builder()
.build());
final var appId = info.appId();
var example = new CosBucket("example", CosBucketArgs.builder()
.bucket(String.format("bucket-intelligent-tiering-%s", appId))
.acl("private")
.enableIntelligentTiering(true)
.intelligentTieringDays(30.0)
.intelligentTieringRequestFrequent(1.0)
.build());
}
}
resources:
example:
type: tencentcloud:CosBucket
properties:
bucket: bucket-intelligent-tiering-${appId}
acl: private
enableIntelligentTiering: true
intelligentTieringDays: 30
intelligentTieringRequestFrequent: 1
variables:
info:
fn::invoke:
function: tencentcloud:getUserInfo
arguments: {}
appId: ${info.appId}
Using intelligent tiering and configure the intelligent tiered storage archiving and deep archiving rules list.
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const info = tencentcloud.getUserInfo({});
const appId = info.then(info => info.appId);
const example = new tencentcloud.CosBucket("example", {
bucket: appId.then(appId => `bucket-intelligent-tiering-${appId}`),
acl: "private",
enableIntelligentTiering: true,
intelligentTieringDays: 30,
intelligentTieringRequestFrequent: 1,
intelligentTieringArchivingRuleLists: [
{
ruleId: "rule1",
status: "Enabled",
tierings: [
{
accessTier: "ARCHIVE_ACCESS",
days: 91,
},
{
accessTier: "DEEP_ARCHIVE_ACCESS",
days: 180,
},
],
},
{
ruleId: "rule2",
status: "Enabled",
filter: {
prefix: "/prefix",
tags: [{
key: "tagKey",
value: "tagValue",
}],
},
tierings: [{
accessTier: "ARCHIVE_ACCESS",
days: 91,
}],
},
],
});
import pulumi
import pulumi_tencentcloud as tencentcloud
info = tencentcloud.get_user_info()
app_id = info.app_id
example = tencentcloud.CosBucket("example",
bucket=f"bucket-intelligent-tiering-{app_id}",
acl="private",
enable_intelligent_tiering=True,
intelligent_tiering_days=30,
intelligent_tiering_request_frequent=1,
intelligent_tiering_archiving_rule_lists=[
{
"rule_id": "rule1",
"status": "Enabled",
"tierings": [
{
"access_tier": "ARCHIVE_ACCESS",
"days": 91,
},
{
"access_tier": "DEEP_ARCHIVE_ACCESS",
"days": 180,
},
],
},
{
"rule_id": "rule2",
"status": "Enabled",
"filter": {
"prefix": "/prefix",
"tags": [{
"key": "tagKey",
"value": "tagValue",
}],
},
"tierings": [{
"access_tier": "ARCHIVE_ACCESS",
"days": 91,
}],
},
])
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
_, err = tencentcloud.NewCosBucket(ctx, "example", &tencentcloud.CosBucketArgs{
Bucket: pulumi.Sprintf("bucket-intelligent-tiering-%v", appId),
Acl: pulumi.String("private"),
EnableIntelligentTiering: pulumi.Bool(true),
IntelligentTieringDays: pulumi.Float64(30),
IntelligentTieringRequestFrequent: pulumi.Float64(1),
IntelligentTieringArchivingRuleLists: tencentcloud.CosBucketIntelligentTieringArchivingRuleListArray{
&tencentcloud.CosBucketIntelligentTieringArchivingRuleListArgs{
RuleId: pulumi.String("rule1"),
Status: pulumi.String("Enabled"),
Tierings: tencentcloud.CosBucketIntelligentTieringArchivingRuleListTieringArray{
&tencentcloud.CosBucketIntelligentTieringArchivingRuleListTieringArgs{
AccessTier: pulumi.String("ARCHIVE_ACCESS"),
Days: pulumi.Float64(91),
},
&tencentcloud.CosBucketIntelligentTieringArchivingRuleListTieringArgs{
AccessTier: pulumi.String("DEEP_ARCHIVE_ACCESS"),
Days: pulumi.Float64(180),
},
},
},
&tencentcloud.CosBucketIntelligentTieringArchivingRuleListArgs{
RuleId: pulumi.String("rule2"),
Status: pulumi.String("Enabled"),
Filter: &tencentcloud.CosBucketIntelligentTieringArchivingRuleListFilterArgs{
Prefix: pulumi.String("/prefix"),
Tags: tencentcloud.CosBucketIntelligentTieringArchivingRuleListFilterTagArray{
&tencentcloud.CosBucketIntelligentTieringArchivingRuleListFilterTagArgs{
Key: pulumi.String("tagKey"),
Value: pulumi.String("tagValue"),
},
},
},
Tierings: tencentcloud.CosBucketIntelligentTieringArchivingRuleListTieringArray{
&tencentcloud.CosBucketIntelligentTieringArchivingRuleListTieringArgs{
AccessTier: pulumi.String("ARCHIVE_ACCESS"),
Days: pulumi.Float64(91),
},
},
},
},
})
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 info = Tencentcloud.GetUserInfo.Invoke();
var appId = info.Apply(getUserInfoResult => getUserInfoResult.AppId);
var example = new Tencentcloud.CosBucket("example", new()
{
Bucket = appId.Apply(appId => $"bucket-intelligent-tiering-{appId}"),
Acl = "private",
EnableIntelligentTiering = true,
IntelligentTieringDays = 30,
IntelligentTieringRequestFrequent = 1,
IntelligentTieringArchivingRuleLists = new[]
{
new Tencentcloud.Inputs.CosBucketIntelligentTieringArchivingRuleListArgs
{
RuleId = "rule1",
Status = "Enabled",
Tierings = new[]
{
new Tencentcloud.Inputs.CosBucketIntelligentTieringArchivingRuleListTieringArgs
{
AccessTier = "ARCHIVE_ACCESS",
Days = 91,
},
new Tencentcloud.Inputs.CosBucketIntelligentTieringArchivingRuleListTieringArgs
{
AccessTier = "DEEP_ARCHIVE_ACCESS",
Days = 180,
},
},
},
new Tencentcloud.Inputs.CosBucketIntelligentTieringArchivingRuleListArgs
{
RuleId = "rule2",
Status = "Enabled",
Filter = new Tencentcloud.Inputs.CosBucketIntelligentTieringArchivingRuleListFilterArgs
{
Prefix = "/prefix",
Tags = new[]
{
new Tencentcloud.Inputs.CosBucketIntelligentTieringArchivingRuleListFilterTagArgs
{
Key = "tagKey",
Value = "tagValue",
},
},
},
Tierings = new[]
{
new Tencentcloud.Inputs.CosBucketIntelligentTieringArchivingRuleListTieringArgs
{
AccessTier = "ARCHIVE_ACCESS",
Days = 91,
},
},
},
},
});
});
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.inputs.CosBucketIntelligentTieringArchivingRuleListArgs;
import com.pulumi.tencentcloud.inputs.CosBucketIntelligentTieringArchivingRuleListFilterArgs;
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(GetUserInfoArgs.builder()
.build());
final var appId = info.appId();
var example = new CosBucket("example", CosBucketArgs.builder()
.bucket(String.format("bucket-intelligent-tiering-%s", appId))
.acl("private")
.enableIntelligentTiering(true)
.intelligentTieringDays(30.0)
.intelligentTieringRequestFrequent(1.0)
.intelligentTieringArchivingRuleLists(
CosBucketIntelligentTieringArchivingRuleListArgs.builder()
.ruleId("rule1")
.status("Enabled")
.tierings(
CosBucketIntelligentTieringArchivingRuleListTieringArgs.builder()
.accessTier("ARCHIVE_ACCESS")
.days(91.0)
.build(),
CosBucketIntelligentTieringArchivingRuleListTieringArgs.builder()
.accessTier("DEEP_ARCHIVE_ACCESS")
.days(180.0)
.build())
.build(),
CosBucketIntelligentTieringArchivingRuleListArgs.builder()
.ruleId("rule2")
.status("Enabled")
.filter(CosBucketIntelligentTieringArchivingRuleListFilterArgs.builder()
.prefix("/prefix")
.tags(CosBucketIntelligentTieringArchivingRuleListFilterTagArgs.builder()
.key("tagKey")
.value("tagValue")
.build())
.build())
.tierings(CosBucketIntelligentTieringArchivingRuleListTieringArgs.builder()
.accessTier("ARCHIVE_ACCESS")
.days(91.0)
.build())
.build())
.build());
}
}
resources:
example:
type: tencentcloud:CosBucket
properties:
bucket: bucket-intelligent-tiering-${appId}
acl: private
enableIntelligentTiering: true
intelligentTieringDays: 30
intelligentTieringRequestFrequent: 1
intelligentTieringArchivingRuleLists:
- ruleId: rule1
status: Enabled
tierings:
- accessTier: ARCHIVE_ACCESS
days: 91
- accessTier: DEEP_ARCHIVE_ACCESS
days: 180
- ruleId: rule2
status: Enabled
filter:
prefix: /prefix
tags:
- key: tagKey
value: tagValue
tierings:
- accessTier: ARCHIVE_ACCESS
days: 91
variables:
info:
fn::invoke:
function: tencentcloud:getUserInfo
arguments: {}
appId: ${info.appId}
Using object lock config
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const info = tencentcloud.getUserInfo({});
const appId = info.then(info => info.appId);
const example = new tencentcloud.CosBucket("example", {
bucket: appId.then(appId => `bucket-intelligent-tiering-${appId}`),
acl: "private",
objectLockConfiguration: {
enabled: true,
rule: {
days: 30,
},
},
});
import pulumi
import pulumi_tencentcloud as tencentcloud
info = tencentcloud.get_user_info()
app_id = info.app_id
example = tencentcloud.CosBucket("example",
bucket=f"bucket-intelligent-tiering-{app_id}",
acl="private",
object_lock_configuration={
"enabled": True,
"rule": {
"days": 30,
},
})
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
_, err = tencentcloud.NewCosBucket(ctx, "example", &tencentcloud.CosBucketArgs{
Bucket: pulumi.Sprintf("bucket-intelligent-tiering-%v", appId),
Acl: pulumi.String("private"),
ObjectLockConfiguration: &tencentcloud.CosBucketObjectLockConfigurationArgs{
Enabled: pulumi.Bool(true),
Rule: &tencentcloud.CosBucketObjectLockConfigurationRuleArgs{
Days: pulumi.Float64(30),
},
},
})
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 info = Tencentcloud.GetUserInfo.Invoke();
var appId = info.Apply(getUserInfoResult => getUserInfoResult.AppId);
var example = new Tencentcloud.CosBucket("example", new()
{
Bucket = appId.Apply(appId => $"bucket-intelligent-tiering-{appId}"),
Acl = "private",
ObjectLockConfiguration = new Tencentcloud.Inputs.CosBucketObjectLockConfigurationArgs
{
Enabled = true,
Rule = new Tencentcloud.Inputs.CosBucketObjectLockConfigurationRuleArgs
{
Days = 30,
},
},
});
});
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.inputs.CosBucketObjectLockConfigurationArgs;
import com.pulumi.tencentcloud.inputs.CosBucketObjectLockConfigurationRuleArgs;
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(GetUserInfoArgs.builder()
.build());
final var appId = info.appId();
var example = new CosBucket("example", CosBucketArgs.builder()
.bucket(String.format("bucket-intelligent-tiering-%s", appId))
.acl("private")
.objectLockConfiguration(CosBucketObjectLockConfigurationArgs.builder()
.enabled(true)
.rule(CosBucketObjectLockConfigurationRuleArgs.builder()
.days(30.0)
.build())
.build())
.build());
}
}
resources:
example:
type: tencentcloud:CosBucket
properties:
bucket: bucket-intelligent-tiering-${appId}
acl: private
objectLockConfiguration:
enabled: true
rule:
days: 30
variables:
info:
fn::invoke:
function: tencentcloud:getUserInfo
arguments: {}
appId: ${info.appId}
Using OFS
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const info = tencentcloud.getUserInfo({});
const appId = info.then(info => info.appId);
const example = new tencentcloud.CosBucket("example", {
bucket: appId.then(appId => `private-ofs-bucket-${appId}`),
acl: "private",
chdfsOfs: true,
});
import pulumi
import pulumi_tencentcloud as tencentcloud
info = tencentcloud.get_user_info()
app_id = info.app_id
example = tencentcloud.CosBucket("example",
bucket=f"private-ofs-bucket-{app_id}",
acl="private",
chdfs_ofs=True)
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
_, err = tencentcloud.NewCosBucket(ctx, "example", &tencentcloud.CosBucketArgs{
Bucket: pulumi.Sprintf("private-ofs-bucket-%v", appId),
Acl: pulumi.String("private"),
ChdfsOfs: pulumi.Bool(true),
})
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 info = Tencentcloud.GetUserInfo.Invoke();
var appId = info.Apply(getUserInfoResult => getUserInfoResult.AppId);
var example = new Tencentcloud.CosBucket("example", new()
{
Bucket = appId.Apply(appId => $"private-ofs-bucket-{appId}"),
Acl = "private",
ChdfsOfs = true,
});
});
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 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(GetUserInfoArgs.builder()
.build());
final var appId = info.appId();
var example = new CosBucket("example", CosBucketArgs.builder()
.bucket(String.format("private-ofs-bucket-%s", appId))
.acl("private")
.chdfsOfs(true)
.build());
}
}
resources:
example:
type: tencentcloud:CosBucket
properties:
bucket: private-ofs-bucket-${appId}
acl: private
chdfsOfs: true
variables:
info:
fn::invoke:
function: tencentcloud:getUserInfo
arguments: {}
appId: ${info.appId}
Create CosBucket Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new CosBucket(name: string, args: CosBucketArgs, opts?: CustomResourceOptions);@overload
def CosBucket(resource_name: str,
args: CosBucketArgs,
opts: Optional[ResourceOptions] = None)
@overload
def CosBucket(resource_name: str,
opts: Optional[ResourceOptions] = None,
bucket: Optional[str] = None,
kms_id: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
acl: Optional[str] = None,
cdc_id: Optional[str] = None,
chdfs_ofs: Optional[bool] = None,
cors_rules: Optional[Sequence[CosBucketCorsRuleArgs]] = None,
cos_bucket_id: Optional[str] = None,
enable_intelligent_tiering: Optional[bool] = None,
encryption_algorithm: Optional[str] = None,
force_clean: Optional[bool] = None,
intelligent_tiering_archiving_rule_lists: Optional[Sequence[CosBucketIntelligentTieringArchivingRuleListArgs]] = None,
lifecycle_rules: Optional[Sequence[CosBucketLifecycleRuleArgs]] = None,
acl_body: Optional[str] = None,
intelligent_tiering_request_frequent: Optional[float] = None,
intelligent_tiering_days: Optional[float] = None,
log_enable: Optional[bool] = None,
log_prefix: Optional[str] = None,
log_target_bucket: Optional[str] = None,
multi_az: Optional[bool] = None,
object_lock_configuration: Optional[CosBucketObjectLockConfigurationArgs] = None,
origin_domain_rules: Optional[Sequence[CosBucketOriginDomainRuleArgs]] = None,
origin_pull_rules: Optional[Sequence[CosBucketOriginPullRuleArgs]] = None,
replica_role: Optional[str] = None,
replica_rules: Optional[Sequence[CosBucketReplicaRuleArgs]] = None,
acceleration_enable: Optional[bool] = None,
versioning_enable: Optional[bool] = None,
website: Optional[CosBucketWebsiteArgs] = None)func NewCosBucket(ctx *Context, name string, args CosBucketArgs, opts ...ResourceOption) (*CosBucket, error)public CosBucket(string name, CosBucketArgs args, CustomResourceOptions? opts = null)
public CosBucket(String name, CosBucketArgs args)
public CosBucket(String name, CosBucketArgs args, CustomResourceOptions options)
type: tencentcloud:CosBucket
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 CosBucketArgs
- 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 CosBucketArgs
- 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 CosBucketArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CosBucketArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CosBucketArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
CosBucket 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 CosBucket resource accepts the following input properties:
- Bucket string
- The name of a bucket to be created. Bucket format should be [custom name]-[appid], for example
mycos-1258798060. - Acceleration
Enable bool - Enable bucket acceleration.
- Acl string
- The canned ACL to apply. Valid values: private, public-read, and public-read-write. Defaults to private.
- Acl
Body string - ACL XML body for multiple grant info. NOTE: this argument will overwrite
acl. Check https://intl.cloud.tencent.com/document/product/436/7737 for more detail. - Cdc
Id string - CDC cluster ID.
- Chdfs
Ofs bool - Indicates whether to create a bucket of metadata acceleration. For more information, please refer to
https://www.tencentcloud.com/document/product/436/43305. - Cors
Rules List<CosBucket Cors Rule> - A rule of Cross-Origin Resource Sharing (documented below).
- Cos
Bucket stringId - ID of the resource.
- Enable
Intelligent boolTiering - Enable intelligent tiering. NOTE: When intelligent tiering configuration is enabled, it cannot be turned off or modified.
- Encryption
Algorithm string - The server-side encryption algorithm to use. Valid values are
AES256,KMSandSM4. - Force
Clean bool - Force cleanup all objects before delete bucket.
- Intelligent
Tiering List<CosArchiving Rule Lists Bucket Intelligent Tiering Archiving Rule List> - List of intelligent tiered storage, archiving, and deep archiving rules. NOTE: only
enable_intelligent_tieringis true can configure this argument. - Intelligent
Tiering doubleDays - Specifies the limit of days for standard-tier data to low-frequency data in an intelligent tiered storage configuration, with optional days of 30, 60, 90. Default value is 30.
- Intelligent
Tiering doubleRequest Frequent - Specify the access limit for converting standard layer data into low-frequency layer data in the configuration. The default value is once, which can be used in combination with the number of days to achieve the conversion effect. For example, if the parameter is set to 1 and the number of access days is 30, it means that objects with less than one visit in 30 consecutive days will be reduced from the standard layer to the low frequency layer.
- Kms
Id string - The KMS Master Key ID. This value is valid only when
encryption_algorithmis set to KMS. Set kms id to the specified value. If not specified, the default kms id is used. - Lifecycle
Rules List<CosBucket Lifecycle Rule> - A configuration of object lifecycle management (documented below).
- Log
Enable bool - Indicate the access log of this bucket to be saved or not. Default is
false. If settrue, the access log will be saved withlog_target_bucket. To enable log, the full access of log service must be granted. Full Access Role Policy. - Log
Prefix string - The prefix log name which saves the access log of this bucket per 5 minutes. Eg.
MyLogPrefix/. The log access file format islog_target_bucket/log_prefix{YYYY}/{MM}/{DD}/{time}{random}{index}.gz. Only valid whenlog_enableistrue. - Log
Target stringBucket - The target bucket name which saves the access log of this bucket per 5 minutes. The log access file format is
log_target_bucket/log_prefix{YYYY}/{MM}/{DD}/{time}{random}{index}.gz. Only valid whenlog_enableistrue. User must have full access on this bucket. - Multi
Az bool - Indicates whether to create a bucket of multi available zone.
- Object
Lock CosConfiguration Bucket Object Lock Configuration - Object locking configuration. Once enabled, this feature cannot be disabled.
- Origin
Domain List<CosRules Bucket Origin Domain Rule> - Bucket Origin Domain settings.
- Origin
Pull List<CosRules Bucket Origin Pull Rule> - Bucket Origin-Pull settings.
- Replica
Role string - Request initiator identifier, format:
qcs::cam::uin/<owneruin>:uin/<subuin>. NOTE: onlyversioning_enableis true can configure this argument. - Replica
Rules List<CosBucket Replica Rule> - List of replica rule. NOTE: only
versioning_enableis true andreplica_roleset can configure this argument. - Dictionary<string, string>
- The tags of a bucket.
- Versioning
Enable bool - Enable bucket versioning. NOTE: The
multi_azfeature is true for the current bucket, cannot disable version control. - Website
Cos
Bucket Website - A website object(documented below).
- Bucket string
- The name of a bucket to be created. Bucket format should be [custom name]-[appid], for example
mycos-1258798060. - Acceleration
Enable bool - Enable bucket acceleration.
- Acl string
- The canned ACL to apply. Valid values: private, public-read, and public-read-write. Defaults to private.
- Acl
Body string - ACL XML body for multiple grant info. NOTE: this argument will overwrite
acl. Check https://intl.cloud.tencent.com/document/product/436/7737 for more detail. - Cdc
Id string - CDC cluster ID.
- Chdfs
Ofs bool - Indicates whether to create a bucket of metadata acceleration. For more information, please refer to
https://www.tencentcloud.com/document/product/436/43305. - Cors
Rules []CosBucket Cors Rule Args - A rule of Cross-Origin Resource Sharing (documented below).
- Cos
Bucket stringId - ID of the resource.
- Enable
Intelligent boolTiering - Enable intelligent tiering. NOTE: When intelligent tiering configuration is enabled, it cannot be turned off or modified.
- Encryption
Algorithm string - The server-side encryption algorithm to use. Valid values are
AES256,KMSandSM4. - Force
Clean bool - Force cleanup all objects before delete bucket.
- Intelligent
Tiering []CosArchiving Rule Lists Bucket Intelligent Tiering Archiving Rule List Args - List of intelligent tiered storage, archiving, and deep archiving rules. NOTE: only
enable_intelligent_tieringis true can configure this argument. - Intelligent
Tiering float64Days - Specifies the limit of days for standard-tier data to low-frequency data in an intelligent tiered storage configuration, with optional days of 30, 60, 90. Default value is 30.
- Intelligent
Tiering float64Request Frequent - Specify the access limit for converting standard layer data into low-frequency layer data in the configuration. The default value is once, which can be used in combination with the number of days to achieve the conversion effect. For example, if the parameter is set to 1 and the number of access days is 30, it means that objects with less than one visit in 30 consecutive days will be reduced from the standard layer to the low frequency layer.
- Kms
Id string - The KMS Master Key ID. This value is valid only when
encryption_algorithmis set to KMS. Set kms id to the specified value. If not specified, the default kms id is used. - Lifecycle
Rules []CosBucket Lifecycle Rule Args - A configuration of object lifecycle management (documented below).
- Log
Enable bool - Indicate the access log of this bucket to be saved or not. Default is
false. If settrue, the access log will be saved withlog_target_bucket. To enable log, the full access of log service must be granted. Full Access Role Policy. - Log
Prefix string - The prefix log name which saves the access log of this bucket per 5 minutes. Eg.
MyLogPrefix/. The log access file format islog_target_bucket/log_prefix{YYYY}/{MM}/{DD}/{time}{random}{index}.gz. Only valid whenlog_enableistrue. - Log
Target stringBucket - The target bucket name which saves the access log of this bucket per 5 minutes. The log access file format is
log_target_bucket/log_prefix{YYYY}/{MM}/{DD}/{time}{random}{index}.gz. Only valid whenlog_enableistrue. User must have full access on this bucket. - Multi
Az bool - Indicates whether to create a bucket of multi available zone.
- Object
Lock CosConfiguration Bucket Object Lock Configuration Args - Object locking configuration. Once enabled, this feature cannot be disabled.
- Origin
Domain []CosRules Bucket Origin Domain Rule Args - Bucket Origin Domain settings.
- Origin
Pull []CosRules Bucket Origin Pull Rule Args - Bucket Origin-Pull settings.
- Replica
Role string - Request initiator identifier, format:
qcs::cam::uin/<owneruin>:uin/<subuin>. NOTE: onlyversioning_enableis true can configure this argument. - Replica
Rules []CosBucket Replica Rule Args - List of replica rule. NOTE: only
versioning_enableis true andreplica_roleset can configure this argument. - map[string]string
- The tags of a bucket.
- Versioning
Enable bool - Enable bucket versioning. NOTE: The
multi_azfeature is true for the current bucket, cannot disable version control. - Website
Cos
Bucket Website Args - A website object(documented below).
- bucket String
- The name of a bucket to be created. Bucket format should be [custom name]-[appid], for example
mycos-1258798060. - acceleration
Enable Boolean - Enable bucket acceleration.
- acl String
- The canned ACL to apply. Valid values: private, public-read, and public-read-write. Defaults to private.
- acl
Body String - ACL XML body for multiple grant info. NOTE: this argument will overwrite
acl. Check https://intl.cloud.tencent.com/document/product/436/7737 for more detail. - cdc
Id String - CDC cluster ID.
- chdfs
Ofs Boolean - Indicates whether to create a bucket of metadata acceleration. For more information, please refer to
https://www.tencentcloud.com/document/product/436/43305. - cors
Rules List<CosBucket Cors Rule> - A rule of Cross-Origin Resource Sharing (documented below).
- cos
Bucket StringId - ID of the resource.
- enable
Intelligent BooleanTiering - Enable intelligent tiering. NOTE: When intelligent tiering configuration is enabled, it cannot be turned off or modified.
- encryption
Algorithm String - The server-side encryption algorithm to use. Valid values are
AES256,KMSandSM4. - force
Clean Boolean - Force cleanup all objects before delete bucket.
- intelligent
Tiering List<CosArchiving Rule Lists Bucket Intelligent Tiering Archiving Rule List> - List of intelligent tiered storage, archiving, and deep archiving rules. NOTE: only
enable_intelligent_tieringis true can configure this argument. - intelligent
Tiering DoubleDays - Specifies the limit of days for standard-tier data to low-frequency data in an intelligent tiered storage configuration, with optional days of 30, 60, 90. Default value is 30.
- intelligent
Tiering DoubleRequest Frequent - Specify the access limit for converting standard layer data into low-frequency layer data in the configuration. The default value is once, which can be used in combination with the number of days to achieve the conversion effect. For example, if the parameter is set to 1 and the number of access days is 30, it means that objects with less than one visit in 30 consecutive days will be reduced from the standard layer to the low frequency layer.
- kms
Id String - The KMS Master Key ID. This value is valid only when
encryption_algorithmis set to KMS. Set kms id to the specified value. If not specified, the default kms id is used. - lifecycle
Rules List<CosBucket Lifecycle Rule> - A configuration of object lifecycle management (documented below).
- log
Enable Boolean - Indicate the access log of this bucket to be saved or not. Default is
false. If settrue, the access log will be saved withlog_target_bucket. To enable log, the full access of log service must be granted. Full Access Role Policy. - log
Prefix String - The prefix log name which saves the access log of this bucket per 5 minutes. Eg.
MyLogPrefix/. The log access file format islog_target_bucket/log_prefix{YYYY}/{MM}/{DD}/{time}{random}{index}.gz. Only valid whenlog_enableistrue. - log
Target StringBucket - The target bucket name which saves the access log of this bucket per 5 minutes. The log access file format is
log_target_bucket/log_prefix{YYYY}/{MM}/{DD}/{time}{random}{index}.gz. Only valid whenlog_enableistrue. User must have full access on this bucket. - multi
Az Boolean - Indicates whether to create a bucket of multi available zone.
- object
Lock CosConfiguration Bucket Object Lock Configuration - Object locking configuration. Once enabled, this feature cannot be disabled.
- origin
Domain List<CosRules Bucket Origin Domain Rule> - Bucket Origin Domain settings.
- origin
Pull List<CosRules Bucket Origin Pull Rule> - Bucket Origin-Pull settings.
- replica
Role String - Request initiator identifier, format:
qcs::cam::uin/<owneruin>:uin/<subuin>. NOTE: onlyversioning_enableis true can configure this argument. - replica
Rules List<CosBucket Replica Rule> - List of replica rule. NOTE: only
versioning_enableis true andreplica_roleset can configure this argument. - Map<String,String>
- The tags of a bucket.
- versioning
Enable Boolean - Enable bucket versioning. NOTE: The
multi_azfeature is true for the current bucket, cannot disable version control. - website
Cos
Bucket Website - A website object(documented below).
- bucket string
- The name of a bucket to be created. Bucket format should be [custom name]-[appid], for example
mycos-1258798060. - acceleration
Enable boolean - Enable bucket acceleration.
- acl string
- The canned ACL to apply. Valid values: private, public-read, and public-read-write. Defaults to private.
- acl
Body string - ACL XML body for multiple grant info. NOTE: this argument will overwrite
acl. Check https://intl.cloud.tencent.com/document/product/436/7737 for more detail. - cdc
Id string - CDC cluster ID.
- chdfs
Ofs boolean - Indicates whether to create a bucket of metadata acceleration. For more information, please refer to
https://www.tencentcloud.com/document/product/436/43305. - cors
Rules CosBucket Cors Rule[] - A rule of Cross-Origin Resource Sharing (documented below).
- cos
Bucket stringId - ID of the resource.
- enable
Intelligent booleanTiering - Enable intelligent tiering. NOTE: When intelligent tiering configuration is enabled, it cannot be turned off or modified.
- encryption
Algorithm string - The server-side encryption algorithm to use. Valid values are
AES256,KMSandSM4. - force
Clean boolean - Force cleanup all objects before delete bucket.
- intelligent
Tiering CosArchiving Rule Lists Bucket Intelligent Tiering Archiving Rule List[] - List of intelligent tiered storage, archiving, and deep archiving rules. NOTE: only
enable_intelligent_tieringis true can configure this argument. - intelligent
Tiering numberDays - Specifies the limit of days for standard-tier data to low-frequency data in an intelligent tiered storage configuration, with optional days of 30, 60, 90. Default value is 30.
- intelligent
Tiering numberRequest Frequent - Specify the access limit for converting standard layer data into low-frequency layer data in the configuration. The default value is once, which can be used in combination with the number of days to achieve the conversion effect. For example, if the parameter is set to 1 and the number of access days is 30, it means that objects with less than one visit in 30 consecutive days will be reduced from the standard layer to the low frequency layer.
- kms
Id string - The KMS Master Key ID. This value is valid only when
encryption_algorithmis set to KMS. Set kms id to the specified value. If not specified, the default kms id is used. - lifecycle
Rules CosBucket Lifecycle Rule[] - A configuration of object lifecycle management (documented below).
- log
Enable boolean - Indicate the access log of this bucket to be saved or not. Default is
false. If settrue, the access log will be saved withlog_target_bucket. To enable log, the full access of log service must be granted. Full Access Role Policy. - log
Prefix string - The prefix log name which saves the access log of this bucket per 5 minutes. Eg.
MyLogPrefix/. The log access file format islog_target_bucket/log_prefix{YYYY}/{MM}/{DD}/{time}{random}{index}.gz. Only valid whenlog_enableistrue. - log
Target stringBucket - The target bucket name which saves the access log of this bucket per 5 minutes. The log access file format is
log_target_bucket/log_prefix{YYYY}/{MM}/{DD}/{time}{random}{index}.gz. Only valid whenlog_enableistrue. User must have full access on this bucket. - multi
Az boolean - Indicates whether to create a bucket of multi available zone.
- object
Lock CosConfiguration Bucket Object Lock Configuration - Object locking configuration. Once enabled, this feature cannot be disabled.
- origin
Domain CosRules Bucket Origin Domain Rule[] - Bucket Origin Domain settings.
- origin
Pull CosRules Bucket Origin Pull Rule[] - Bucket Origin-Pull settings.
- replica
Role string - Request initiator identifier, format:
qcs::cam::uin/<owneruin>:uin/<subuin>. NOTE: onlyversioning_enableis true can configure this argument. - replica
Rules CosBucket Replica Rule[] - List of replica rule. NOTE: only
versioning_enableis true andreplica_roleset can configure this argument. - {[key: string]: string}
- The tags of a bucket.
- versioning
Enable boolean - Enable bucket versioning. NOTE: The
multi_azfeature is true for the current bucket, cannot disable version control. - website
Cos
Bucket Website - A website object(documented below).
- bucket str
- The name of a bucket to be created. Bucket format should be [custom name]-[appid], for example
mycos-1258798060. - acceleration_
enable bool - Enable bucket acceleration.
- acl str
- The canned ACL to apply. Valid values: private, public-read, and public-read-write. Defaults to private.
- acl_
body str - ACL XML body for multiple grant info. NOTE: this argument will overwrite
acl. Check https://intl.cloud.tencent.com/document/product/436/7737 for more detail. - cdc_
id str - CDC cluster ID.
- chdfs_
ofs bool - Indicates whether to create a bucket of metadata acceleration. For more information, please refer to
https://www.tencentcloud.com/document/product/436/43305. - cors_
rules Sequence[CosBucket Cors Rule Args] - A rule of Cross-Origin Resource Sharing (documented below).
- cos_
bucket_ strid - ID of the resource.
- enable_
intelligent_ booltiering - Enable intelligent tiering. NOTE: When intelligent tiering configuration is enabled, it cannot be turned off or modified.
- encryption_
algorithm str - The server-side encryption algorithm to use. Valid values are
AES256,KMSandSM4. - force_
clean bool - Force cleanup all objects before delete bucket.
- intelligent_
tiering_ Sequence[Cosarchiving_ rule_ lists Bucket Intelligent Tiering Archiving Rule List Args] - List of intelligent tiered storage, archiving, and deep archiving rules. NOTE: only
enable_intelligent_tieringis true can configure this argument. - intelligent_
tiering_ floatdays - Specifies the limit of days for standard-tier data to low-frequency data in an intelligent tiered storage configuration, with optional days of 30, 60, 90. Default value is 30.
- intelligent_
tiering_ floatrequest_ frequent - Specify the access limit for converting standard layer data into low-frequency layer data in the configuration. The default value is once, which can be used in combination with the number of days to achieve the conversion effect. For example, if the parameter is set to 1 and the number of access days is 30, it means that objects with less than one visit in 30 consecutive days will be reduced from the standard layer to the low frequency layer.
- kms_
id str - The KMS Master Key ID. This value is valid only when
encryption_algorithmis set to KMS. Set kms id to the specified value. If not specified, the default kms id is used. - lifecycle_
rules Sequence[CosBucket Lifecycle Rule Args] - A configuration of object lifecycle management (documented below).
- log_
enable bool - Indicate the access log of this bucket to be saved or not. Default is
false. If settrue, the access log will be saved withlog_target_bucket. To enable log, the full access of log service must be granted. Full Access Role Policy. - log_
prefix str - The prefix log name which saves the access log of this bucket per 5 minutes. Eg.
MyLogPrefix/. The log access file format islog_target_bucket/log_prefix{YYYY}/{MM}/{DD}/{time}{random}{index}.gz. Only valid whenlog_enableistrue. - log_
target_ strbucket - The target bucket name which saves the access log of this bucket per 5 minutes. The log access file format is
log_target_bucket/log_prefix{YYYY}/{MM}/{DD}/{time}{random}{index}.gz. Only valid whenlog_enableistrue. User must have full access on this bucket. - multi_
az bool - Indicates whether to create a bucket of multi available zone.
- object_
lock_ Cosconfiguration Bucket Object Lock Configuration Args - Object locking configuration. Once enabled, this feature cannot be disabled.
- origin_
domain_ Sequence[Cosrules Bucket Origin Domain Rule Args] - Bucket Origin Domain settings.
- origin_
pull_ Sequence[Cosrules Bucket Origin Pull Rule Args] - Bucket Origin-Pull settings.
- replica_
role str - Request initiator identifier, format:
qcs::cam::uin/<owneruin>:uin/<subuin>. NOTE: onlyversioning_enableis true can configure this argument. - replica_
rules Sequence[CosBucket Replica Rule Args] - List of replica rule. NOTE: only
versioning_enableis true andreplica_roleset can configure this argument. - Mapping[str, str]
- The tags of a bucket.
- versioning_
enable bool - Enable bucket versioning. NOTE: The
multi_azfeature is true for the current bucket, cannot disable version control. - website
Cos
Bucket Website Args - A website object(documented below).
- bucket String
- The name of a bucket to be created. Bucket format should be [custom name]-[appid], for example
mycos-1258798060. - acceleration
Enable Boolean - Enable bucket acceleration.
- acl String
- The canned ACL to apply. Valid values: private, public-read, and public-read-write. Defaults to private.
- acl
Body String - ACL XML body for multiple grant info. NOTE: this argument will overwrite
acl. Check https://intl.cloud.tencent.com/document/product/436/7737 for more detail. - cdc
Id String - CDC cluster ID.
- chdfs
Ofs Boolean - Indicates whether to create a bucket of metadata acceleration. For more information, please refer to
https://www.tencentcloud.com/document/product/436/43305. - cors
Rules List<Property Map> - A rule of Cross-Origin Resource Sharing (documented below).
- cos
Bucket StringId - ID of the resource.
- enable
Intelligent BooleanTiering - Enable intelligent tiering. NOTE: When intelligent tiering configuration is enabled, it cannot be turned off or modified.
- encryption
Algorithm String - The server-side encryption algorithm to use. Valid values are
AES256,KMSandSM4. - force
Clean Boolean - Force cleanup all objects before delete bucket.
- intelligent
Tiering List<Property Map>Archiving Rule Lists - List of intelligent tiered storage, archiving, and deep archiving rules. NOTE: only
enable_intelligent_tieringis true can configure this argument. - intelligent
Tiering NumberDays - Specifies the limit of days for standard-tier data to low-frequency data in an intelligent tiered storage configuration, with optional days of 30, 60, 90. Default value is 30.
- intelligent
Tiering NumberRequest Frequent - Specify the access limit for converting standard layer data into low-frequency layer data in the configuration. The default value is once, which can be used in combination with the number of days to achieve the conversion effect. For example, if the parameter is set to 1 and the number of access days is 30, it means that objects with less than one visit in 30 consecutive days will be reduced from the standard layer to the low frequency layer.
- kms
Id String - The KMS Master Key ID. This value is valid only when
encryption_algorithmis set to KMS. Set kms id to the specified value. If not specified, the default kms id is used. - lifecycle
Rules List<Property Map> - A configuration of object lifecycle management (documented below).
- log
Enable Boolean - Indicate the access log of this bucket to be saved or not. Default is
false. If settrue, the access log will be saved withlog_target_bucket. To enable log, the full access of log service must be granted. Full Access Role Policy. - log
Prefix String - The prefix log name which saves the access log of this bucket per 5 minutes. Eg.
MyLogPrefix/. The log access file format islog_target_bucket/log_prefix{YYYY}/{MM}/{DD}/{time}{random}{index}.gz. Only valid whenlog_enableistrue. - log
Target StringBucket - The target bucket name which saves the access log of this bucket per 5 minutes. The log access file format is
log_target_bucket/log_prefix{YYYY}/{MM}/{DD}/{time}{random}{index}.gz. Only valid whenlog_enableistrue. User must have full access on this bucket. - multi
Az Boolean - Indicates whether to create a bucket of multi available zone.
- object
Lock Property MapConfiguration - Object locking configuration. Once enabled, this feature cannot be disabled.
- origin
Domain List<Property Map>Rules - Bucket Origin Domain settings.
- origin
Pull List<Property Map>Rules - Bucket Origin-Pull settings.
- replica
Role String - Request initiator identifier, format:
qcs::cam::uin/<owneruin>:uin/<subuin>. NOTE: onlyversioning_enableis true can configure this argument. - replica
Rules List<Property Map> - List of replica rule. NOTE: only
versioning_enableis true andreplica_roleset can configure this argument. - Map<String>
- The tags of a bucket.
- versioning
Enable Boolean - Enable bucket versioning. NOTE: The
multi_azfeature is true for the current bucket, cannot disable version control. - website Property Map
- A website object(documented below).
Outputs
All input properties are implicitly available as output properties. Additionally, the CosBucket resource produces the following output properties:
- Cos
Bucket stringUrl - The URL of this cos bucket.
- Id string
- The provider-assigned unique ID for this managed resource.
- Cos
Bucket stringUrl - The URL of this cos bucket.
- Id string
- The provider-assigned unique ID for this managed resource.
- cos
Bucket StringUrl - The URL of this cos bucket.
- id String
- The provider-assigned unique ID for this managed resource.
- cos
Bucket stringUrl - The URL of this cos bucket.
- id string
- The provider-assigned unique ID for this managed resource.
- cos_
bucket_ strurl - The URL of this cos bucket.
- id str
- The provider-assigned unique ID for this managed resource.
- cos
Bucket StringUrl - The URL of this cos bucket.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing CosBucket Resource
Get an existing CosBucket 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?: CosBucketState, opts?: CustomResourceOptions): CosBucket@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
acceleration_enable: Optional[bool] = None,
acl: Optional[str] = None,
acl_body: Optional[str] = None,
bucket: Optional[str] = None,
cdc_id: Optional[str] = None,
chdfs_ofs: Optional[bool] = None,
cors_rules: Optional[Sequence[CosBucketCorsRuleArgs]] = None,
cos_bucket_id: Optional[str] = None,
cos_bucket_url: Optional[str] = None,
enable_intelligent_tiering: Optional[bool] = None,
encryption_algorithm: Optional[str] = None,
force_clean: Optional[bool] = None,
intelligent_tiering_archiving_rule_lists: Optional[Sequence[CosBucketIntelligentTieringArchivingRuleListArgs]] = None,
intelligent_tiering_days: Optional[float] = None,
intelligent_tiering_request_frequent: Optional[float] = None,
kms_id: Optional[str] = None,
lifecycle_rules: Optional[Sequence[CosBucketLifecycleRuleArgs]] = None,
log_enable: Optional[bool] = None,
log_prefix: Optional[str] = None,
log_target_bucket: Optional[str] = None,
multi_az: Optional[bool] = None,
object_lock_configuration: Optional[CosBucketObjectLockConfigurationArgs] = None,
origin_domain_rules: Optional[Sequence[CosBucketOriginDomainRuleArgs]] = None,
origin_pull_rules: Optional[Sequence[CosBucketOriginPullRuleArgs]] = None,
replica_role: Optional[str] = None,
replica_rules: Optional[Sequence[CosBucketReplicaRuleArgs]] = None,
tags: Optional[Mapping[str, str]] = None,
versioning_enable: Optional[bool] = None,
website: Optional[CosBucketWebsiteArgs] = None) -> CosBucketfunc GetCosBucket(ctx *Context, name string, id IDInput, state *CosBucketState, opts ...ResourceOption) (*CosBucket, error)public static CosBucket Get(string name, Input<string> id, CosBucketState? state, CustomResourceOptions? opts = null)public static CosBucket get(String name, Output<String> id, CosBucketState state, CustomResourceOptions options)resources: _: type: tencentcloud:CosBucket 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.
- Acceleration
Enable bool - Enable bucket acceleration.
- Acl string
- The canned ACL to apply. Valid values: private, public-read, and public-read-write. Defaults to private.
- Acl
Body string - ACL XML body for multiple grant info. NOTE: this argument will overwrite
acl. Check https://intl.cloud.tencent.com/document/product/436/7737 for more detail. - Bucket string
- The name of a bucket to be created. Bucket format should be [custom name]-[appid], for example
mycos-1258798060. - Cdc
Id string - CDC cluster ID.
- Chdfs
Ofs bool - Indicates whether to create a bucket of metadata acceleration. For more information, please refer to
https://www.tencentcloud.com/document/product/436/43305. - Cors
Rules List<CosBucket Cors Rule> - A rule of Cross-Origin Resource Sharing (documented below).
- Cos
Bucket stringId - ID of the resource.
- Cos
Bucket stringUrl - The URL of this cos bucket.
- Enable
Intelligent boolTiering - Enable intelligent tiering. NOTE: When intelligent tiering configuration is enabled, it cannot be turned off or modified.
- Encryption
Algorithm string - The server-side encryption algorithm to use. Valid values are
AES256,KMSandSM4. - Force
Clean bool - Force cleanup all objects before delete bucket.
- Intelligent
Tiering List<CosArchiving Rule Lists Bucket Intelligent Tiering Archiving Rule List> - List of intelligent tiered storage, archiving, and deep archiving rules. NOTE: only
enable_intelligent_tieringis true can configure this argument. - Intelligent
Tiering doubleDays - Specifies the limit of days for standard-tier data to low-frequency data in an intelligent tiered storage configuration, with optional days of 30, 60, 90. Default value is 30.
- Intelligent
Tiering doubleRequest Frequent - Specify the access limit for converting standard layer data into low-frequency layer data in the configuration. The default value is once, which can be used in combination with the number of days to achieve the conversion effect. For example, if the parameter is set to 1 and the number of access days is 30, it means that objects with less than one visit in 30 consecutive days will be reduced from the standard layer to the low frequency layer.
- Kms
Id string - The KMS Master Key ID. This value is valid only when
encryption_algorithmis set to KMS. Set kms id to the specified value. If not specified, the default kms id is used. - Lifecycle
Rules List<CosBucket Lifecycle Rule> - A configuration of object lifecycle management (documented below).
- Log
Enable bool - Indicate the access log of this bucket to be saved or not. Default is
false. If settrue, the access log will be saved withlog_target_bucket. To enable log, the full access of log service must be granted. Full Access Role Policy. - Log
Prefix string - The prefix log name which saves the access log of this bucket per 5 minutes. Eg.
MyLogPrefix/. The log access file format islog_target_bucket/log_prefix{YYYY}/{MM}/{DD}/{time}{random}{index}.gz. Only valid whenlog_enableistrue. - Log
Target stringBucket - The target bucket name which saves the access log of this bucket per 5 minutes. The log access file format is
log_target_bucket/log_prefix{YYYY}/{MM}/{DD}/{time}{random}{index}.gz. Only valid whenlog_enableistrue. User must have full access on this bucket. - Multi
Az bool - Indicates whether to create a bucket of multi available zone.
- Object
Lock CosConfiguration Bucket Object Lock Configuration - Object locking configuration. Once enabled, this feature cannot be disabled.
- Origin
Domain List<CosRules Bucket Origin Domain Rule> - Bucket Origin Domain settings.
- Origin
Pull List<CosRules Bucket Origin Pull Rule> - Bucket Origin-Pull settings.
- Replica
Role string - Request initiator identifier, format:
qcs::cam::uin/<owneruin>:uin/<subuin>. NOTE: onlyversioning_enableis true can configure this argument. - Replica
Rules List<CosBucket Replica Rule> - List of replica rule. NOTE: only
versioning_enableis true andreplica_roleset can configure this argument. - Dictionary<string, string>
- The tags of a bucket.
- Versioning
Enable bool - Enable bucket versioning. NOTE: The
multi_azfeature is true for the current bucket, cannot disable version control. - Website
Cos
Bucket Website - A website object(documented below).
- Acceleration
Enable bool - Enable bucket acceleration.
- Acl string
- The canned ACL to apply. Valid values: private, public-read, and public-read-write. Defaults to private.
- Acl
Body string - ACL XML body for multiple grant info. NOTE: this argument will overwrite
acl. Check https://intl.cloud.tencent.com/document/product/436/7737 for more detail. - Bucket string
- The name of a bucket to be created. Bucket format should be [custom name]-[appid], for example
mycos-1258798060. - Cdc
Id string - CDC cluster ID.
- Chdfs
Ofs bool - Indicates whether to create a bucket of metadata acceleration. For more information, please refer to
https://www.tencentcloud.com/document/product/436/43305. - Cors
Rules []CosBucket Cors Rule Args - A rule of Cross-Origin Resource Sharing (documented below).
- Cos
Bucket stringId - ID of the resource.
- Cos
Bucket stringUrl - The URL of this cos bucket.
- Enable
Intelligent boolTiering - Enable intelligent tiering. NOTE: When intelligent tiering configuration is enabled, it cannot be turned off or modified.
- Encryption
Algorithm string - The server-side encryption algorithm to use. Valid values are
AES256,KMSandSM4. - Force
Clean bool - Force cleanup all objects before delete bucket.
- Intelligent
Tiering []CosArchiving Rule Lists Bucket Intelligent Tiering Archiving Rule List Args - List of intelligent tiered storage, archiving, and deep archiving rules. NOTE: only
enable_intelligent_tieringis true can configure this argument. - Intelligent
Tiering float64Days - Specifies the limit of days for standard-tier data to low-frequency data in an intelligent tiered storage configuration, with optional days of 30, 60, 90. Default value is 30.
- Intelligent
Tiering float64Request Frequent - Specify the access limit for converting standard layer data into low-frequency layer data in the configuration. The default value is once, which can be used in combination with the number of days to achieve the conversion effect. For example, if the parameter is set to 1 and the number of access days is 30, it means that objects with less than one visit in 30 consecutive days will be reduced from the standard layer to the low frequency layer.
- Kms
Id string - The KMS Master Key ID. This value is valid only when
encryption_algorithmis set to KMS. Set kms id to the specified value. If not specified, the default kms id is used. - Lifecycle
Rules []CosBucket Lifecycle Rule Args - A configuration of object lifecycle management (documented below).
- Log
Enable bool - Indicate the access log of this bucket to be saved or not. Default is
false. If settrue, the access log will be saved withlog_target_bucket. To enable log, the full access of log service must be granted. Full Access Role Policy. - Log
Prefix string - The prefix log name which saves the access log of this bucket per 5 minutes. Eg.
MyLogPrefix/. The log access file format islog_target_bucket/log_prefix{YYYY}/{MM}/{DD}/{time}{random}{index}.gz. Only valid whenlog_enableistrue. - Log
Target stringBucket - The target bucket name which saves the access log of this bucket per 5 minutes. The log access file format is
log_target_bucket/log_prefix{YYYY}/{MM}/{DD}/{time}{random}{index}.gz. Only valid whenlog_enableistrue. User must have full access on this bucket. - Multi
Az bool - Indicates whether to create a bucket of multi available zone.
- Object
Lock CosConfiguration Bucket Object Lock Configuration Args - Object locking configuration. Once enabled, this feature cannot be disabled.
- Origin
Domain []CosRules Bucket Origin Domain Rule Args - Bucket Origin Domain settings.
- Origin
Pull []CosRules Bucket Origin Pull Rule Args - Bucket Origin-Pull settings.
- Replica
Role string - Request initiator identifier, format:
qcs::cam::uin/<owneruin>:uin/<subuin>. NOTE: onlyversioning_enableis true can configure this argument. - Replica
Rules []CosBucket Replica Rule Args - List of replica rule. NOTE: only
versioning_enableis true andreplica_roleset can configure this argument. - map[string]string
- The tags of a bucket.
- Versioning
Enable bool - Enable bucket versioning. NOTE: The
multi_azfeature is true for the current bucket, cannot disable version control. - Website
Cos
Bucket Website Args - A website object(documented below).
- acceleration
Enable Boolean - Enable bucket acceleration.
- acl String
- The canned ACL to apply. Valid values: private, public-read, and public-read-write. Defaults to private.
- acl
Body String - ACL XML body for multiple grant info. NOTE: this argument will overwrite
acl. Check https://intl.cloud.tencent.com/document/product/436/7737 for more detail. - bucket String
- The name of a bucket to be created. Bucket format should be [custom name]-[appid], for example
mycos-1258798060. - cdc
Id String - CDC cluster ID.
- chdfs
Ofs Boolean - Indicates whether to create a bucket of metadata acceleration. For more information, please refer to
https://www.tencentcloud.com/document/product/436/43305. - cors
Rules List<CosBucket Cors Rule> - A rule of Cross-Origin Resource Sharing (documented below).
- cos
Bucket StringId - ID of the resource.
- cos
Bucket StringUrl - The URL of this cos bucket.
- enable
Intelligent BooleanTiering - Enable intelligent tiering. NOTE: When intelligent tiering configuration is enabled, it cannot be turned off or modified.
- encryption
Algorithm String - The server-side encryption algorithm to use. Valid values are
AES256,KMSandSM4. - force
Clean Boolean - Force cleanup all objects before delete bucket.
- intelligent
Tiering List<CosArchiving Rule Lists Bucket Intelligent Tiering Archiving Rule List> - List of intelligent tiered storage, archiving, and deep archiving rules. NOTE: only
enable_intelligent_tieringis true can configure this argument. - intelligent
Tiering DoubleDays - Specifies the limit of days for standard-tier data to low-frequency data in an intelligent tiered storage configuration, with optional days of 30, 60, 90. Default value is 30.
- intelligent
Tiering DoubleRequest Frequent - Specify the access limit for converting standard layer data into low-frequency layer data in the configuration. The default value is once, which can be used in combination with the number of days to achieve the conversion effect. For example, if the parameter is set to 1 and the number of access days is 30, it means that objects with less than one visit in 30 consecutive days will be reduced from the standard layer to the low frequency layer.
- kms
Id String - The KMS Master Key ID. This value is valid only when
encryption_algorithmis set to KMS. Set kms id to the specified value. If not specified, the default kms id is used. - lifecycle
Rules List<CosBucket Lifecycle Rule> - A configuration of object lifecycle management (documented below).
- log
Enable Boolean - Indicate the access log of this bucket to be saved or not. Default is
false. If settrue, the access log will be saved withlog_target_bucket. To enable log, the full access of log service must be granted. Full Access Role Policy. - log
Prefix String - The prefix log name which saves the access log of this bucket per 5 minutes. Eg.
MyLogPrefix/. The log access file format islog_target_bucket/log_prefix{YYYY}/{MM}/{DD}/{time}{random}{index}.gz. Only valid whenlog_enableistrue. - log
Target StringBucket - The target bucket name which saves the access log of this bucket per 5 minutes. The log access file format is
log_target_bucket/log_prefix{YYYY}/{MM}/{DD}/{time}{random}{index}.gz. Only valid whenlog_enableistrue. User must have full access on this bucket. - multi
Az Boolean - Indicates whether to create a bucket of multi available zone.
- object
Lock CosConfiguration Bucket Object Lock Configuration - Object locking configuration. Once enabled, this feature cannot be disabled.
- origin
Domain List<CosRules Bucket Origin Domain Rule> - Bucket Origin Domain settings.
- origin
Pull List<CosRules Bucket Origin Pull Rule> - Bucket Origin-Pull settings.
- replica
Role String - Request initiator identifier, format:
qcs::cam::uin/<owneruin>:uin/<subuin>. NOTE: onlyversioning_enableis true can configure this argument. - replica
Rules List<CosBucket Replica Rule> - List of replica rule. NOTE: only
versioning_enableis true andreplica_roleset can configure this argument. - Map<String,String>
- The tags of a bucket.
- versioning
Enable Boolean - Enable bucket versioning. NOTE: The
multi_azfeature is true for the current bucket, cannot disable version control. - website
Cos
Bucket Website - A website object(documented below).
- acceleration
Enable boolean - Enable bucket acceleration.
- acl string
- The canned ACL to apply. Valid values: private, public-read, and public-read-write. Defaults to private.
- acl
Body string - ACL XML body for multiple grant info. NOTE: this argument will overwrite
acl. Check https://intl.cloud.tencent.com/document/product/436/7737 for more detail. - bucket string
- The name of a bucket to be created. Bucket format should be [custom name]-[appid], for example
mycos-1258798060. - cdc
Id string - CDC cluster ID.
- chdfs
Ofs boolean - Indicates whether to create a bucket of metadata acceleration. For more information, please refer to
https://www.tencentcloud.com/document/product/436/43305. - cors
Rules CosBucket Cors Rule[] - A rule of Cross-Origin Resource Sharing (documented below).
- cos
Bucket stringId - ID of the resource.
- cos
Bucket stringUrl - The URL of this cos bucket.
- enable
Intelligent booleanTiering - Enable intelligent tiering. NOTE: When intelligent tiering configuration is enabled, it cannot be turned off or modified.
- encryption
Algorithm string - The server-side encryption algorithm to use. Valid values are
AES256,KMSandSM4. - force
Clean boolean - Force cleanup all objects before delete bucket.
- intelligent
Tiering CosArchiving Rule Lists Bucket Intelligent Tiering Archiving Rule List[] - List of intelligent tiered storage, archiving, and deep archiving rules. NOTE: only
enable_intelligent_tieringis true can configure this argument. - intelligent
Tiering numberDays - Specifies the limit of days for standard-tier data to low-frequency data in an intelligent tiered storage configuration, with optional days of 30, 60, 90. Default value is 30.
- intelligent
Tiering numberRequest Frequent - Specify the access limit for converting standard layer data into low-frequency layer data in the configuration. The default value is once, which can be used in combination with the number of days to achieve the conversion effect. For example, if the parameter is set to 1 and the number of access days is 30, it means that objects with less than one visit in 30 consecutive days will be reduced from the standard layer to the low frequency layer.
- kms
Id string - The KMS Master Key ID. This value is valid only when
encryption_algorithmis set to KMS. Set kms id to the specified value. If not specified, the default kms id is used. - lifecycle
Rules CosBucket Lifecycle Rule[] - A configuration of object lifecycle management (documented below).
- log
Enable boolean - Indicate the access log of this bucket to be saved or not. Default is
false. If settrue, the access log will be saved withlog_target_bucket. To enable log, the full access of log service must be granted. Full Access Role Policy. - log
Prefix string - The prefix log name which saves the access log of this bucket per 5 minutes. Eg.
MyLogPrefix/. The log access file format islog_target_bucket/log_prefix{YYYY}/{MM}/{DD}/{time}{random}{index}.gz. Only valid whenlog_enableistrue. - log
Target stringBucket - The target bucket name which saves the access log of this bucket per 5 minutes. The log access file format is
log_target_bucket/log_prefix{YYYY}/{MM}/{DD}/{time}{random}{index}.gz. Only valid whenlog_enableistrue. User must have full access on this bucket. - multi
Az boolean - Indicates whether to create a bucket of multi available zone.
- object
Lock CosConfiguration Bucket Object Lock Configuration - Object locking configuration. Once enabled, this feature cannot be disabled.
- origin
Domain CosRules Bucket Origin Domain Rule[] - Bucket Origin Domain settings.
- origin
Pull CosRules Bucket Origin Pull Rule[] - Bucket Origin-Pull settings.
- replica
Role string - Request initiator identifier, format:
qcs::cam::uin/<owneruin>:uin/<subuin>. NOTE: onlyversioning_enableis true can configure this argument. - replica
Rules CosBucket Replica Rule[] - List of replica rule. NOTE: only
versioning_enableis true andreplica_roleset can configure this argument. - {[key: string]: string}
- The tags of a bucket.
- versioning
Enable boolean - Enable bucket versioning. NOTE: The
multi_azfeature is true for the current bucket, cannot disable version control. - website
Cos
Bucket Website - A website object(documented below).
- acceleration_
enable bool - Enable bucket acceleration.
- acl str
- The canned ACL to apply. Valid values: private, public-read, and public-read-write. Defaults to private.
- acl_
body str - ACL XML body for multiple grant info. NOTE: this argument will overwrite
acl. Check https://intl.cloud.tencent.com/document/product/436/7737 for more detail. - bucket str
- The name of a bucket to be created. Bucket format should be [custom name]-[appid], for example
mycos-1258798060. - cdc_
id str - CDC cluster ID.
- chdfs_
ofs bool - Indicates whether to create a bucket of metadata acceleration. For more information, please refer to
https://www.tencentcloud.com/document/product/436/43305. - cors_
rules Sequence[CosBucket Cors Rule Args] - A rule of Cross-Origin Resource Sharing (documented below).
- cos_
bucket_ strid - ID of the resource.
- cos_
bucket_ strurl - The URL of this cos bucket.
- enable_
intelligent_ booltiering - Enable intelligent tiering. NOTE: When intelligent tiering configuration is enabled, it cannot be turned off or modified.
- encryption_
algorithm str - The server-side encryption algorithm to use. Valid values are
AES256,KMSandSM4. - force_
clean bool - Force cleanup all objects before delete bucket.
- intelligent_
tiering_ Sequence[Cosarchiving_ rule_ lists Bucket Intelligent Tiering Archiving Rule List Args] - List of intelligent tiered storage, archiving, and deep archiving rules. NOTE: only
enable_intelligent_tieringis true can configure this argument. - intelligent_
tiering_ floatdays - Specifies the limit of days for standard-tier data to low-frequency data in an intelligent tiered storage configuration, with optional days of 30, 60, 90. Default value is 30.
- intelligent_
tiering_ floatrequest_ frequent - Specify the access limit for converting standard layer data into low-frequency layer data in the configuration. The default value is once, which can be used in combination with the number of days to achieve the conversion effect. For example, if the parameter is set to 1 and the number of access days is 30, it means that objects with less than one visit in 30 consecutive days will be reduced from the standard layer to the low frequency layer.
- kms_
id str - The KMS Master Key ID. This value is valid only when
encryption_algorithmis set to KMS. Set kms id to the specified value. If not specified, the default kms id is used. - lifecycle_
rules Sequence[CosBucket Lifecycle Rule Args] - A configuration of object lifecycle management (documented below).
- log_
enable bool - Indicate the access log of this bucket to be saved or not. Default is
false. If settrue, the access log will be saved withlog_target_bucket. To enable log, the full access of log service must be granted. Full Access Role Policy. - log_
prefix str - The prefix log name which saves the access log of this bucket per 5 minutes. Eg.
MyLogPrefix/. The log access file format islog_target_bucket/log_prefix{YYYY}/{MM}/{DD}/{time}{random}{index}.gz. Only valid whenlog_enableistrue. - log_
target_ strbucket - The target bucket name which saves the access log of this bucket per 5 minutes. The log access file format is
log_target_bucket/log_prefix{YYYY}/{MM}/{DD}/{time}{random}{index}.gz. Only valid whenlog_enableistrue. User must have full access on this bucket. - multi_
az bool - Indicates whether to create a bucket of multi available zone.
- object_
lock_ Cosconfiguration Bucket Object Lock Configuration Args - Object locking configuration. Once enabled, this feature cannot be disabled.
- origin_
domain_ Sequence[Cosrules Bucket Origin Domain Rule Args] - Bucket Origin Domain settings.
- origin_
pull_ Sequence[Cosrules Bucket Origin Pull Rule Args] - Bucket Origin-Pull settings.
- replica_
role str - Request initiator identifier, format:
qcs::cam::uin/<owneruin>:uin/<subuin>. NOTE: onlyversioning_enableis true can configure this argument. - replica_
rules Sequence[CosBucket Replica Rule Args] - List of replica rule. NOTE: only
versioning_enableis true andreplica_roleset can configure this argument. - Mapping[str, str]
- The tags of a bucket.
- versioning_
enable bool - Enable bucket versioning. NOTE: The
multi_azfeature is true for the current bucket, cannot disable version control. - website
Cos
Bucket Website Args - A website object(documented below).
- acceleration
Enable Boolean - Enable bucket acceleration.
- acl String
- The canned ACL to apply. Valid values: private, public-read, and public-read-write. Defaults to private.
- acl
Body String - ACL XML body for multiple grant info. NOTE: this argument will overwrite
acl. Check https://intl.cloud.tencent.com/document/product/436/7737 for more detail. - bucket String
- The name of a bucket to be created. Bucket format should be [custom name]-[appid], for example
mycos-1258798060. - cdc
Id String - CDC cluster ID.
- chdfs
Ofs Boolean - Indicates whether to create a bucket of metadata acceleration. For more information, please refer to
https://www.tencentcloud.com/document/product/436/43305. - cors
Rules List<Property Map> - A rule of Cross-Origin Resource Sharing (documented below).
- cos
Bucket StringId - ID of the resource.
- cos
Bucket StringUrl - The URL of this cos bucket.
- enable
Intelligent BooleanTiering - Enable intelligent tiering. NOTE: When intelligent tiering configuration is enabled, it cannot be turned off or modified.
- encryption
Algorithm String - The server-side encryption algorithm to use. Valid values are
AES256,KMSandSM4. - force
Clean Boolean - Force cleanup all objects before delete bucket.
- intelligent
Tiering List<Property Map>Archiving Rule Lists - List of intelligent tiered storage, archiving, and deep archiving rules. NOTE: only
enable_intelligent_tieringis true can configure this argument. - intelligent
Tiering NumberDays - Specifies the limit of days for standard-tier data to low-frequency data in an intelligent tiered storage configuration, with optional days of 30, 60, 90. Default value is 30.
- intelligent
Tiering NumberRequest Frequent - Specify the access limit for converting standard layer data into low-frequency layer data in the configuration. The default value is once, which can be used in combination with the number of days to achieve the conversion effect. For example, if the parameter is set to 1 and the number of access days is 30, it means that objects with less than one visit in 30 consecutive days will be reduced from the standard layer to the low frequency layer.
- kms
Id String - The KMS Master Key ID. This value is valid only when
encryption_algorithmis set to KMS. Set kms id to the specified value. If not specified, the default kms id is used. - lifecycle
Rules List<Property Map> - A configuration of object lifecycle management (documented below).
- log
Enable Boolean - Indicate the access log of this bucket to be saved or not. Default is
false. If settrue, the access log will be saved withlog_target_bucket. To enable log, the full access of log service must be granted. Full Access Role Policy. - log
Prefix String - The prefix log name which saves the access log of this bucket per 5 minutes. Eg.
MyLogPrefix/. The log access file format islog_target_bucket/log_prefix{YYYY}/{MM}/{DD}/{time}{random}{index}.gz. Only valid whenlog_enableistrue. - log
Target StringBucket - The target bucket name which saves the access log of this bucket per 5 minutes. The log access file format is
log_target_bucket/log_prefix{YYYY}/{MM}/{DD}/{time}{random}{index}.gz. Only valid whenlog_enableistrue. User must have full access on this bucket. - multi
Az Boolean - Indicates whether to create a bucket of multi available zone.
- object
Lock Property MapConfiguration - Object locking configuration. Once enabled, this feature cannot be disabled.
- origin
Domain List<Property Map>Rules - Bucket Origin Domain settings.
- origin
Pull List<Property Map>Rules - Bucket Origin-Pull settings.
- replica
Role String - Request initiator identifier, format:
qcs::cam::uin/<owneruin>:uin/<subuin>. NOTE: onlyversioning_enableis true can configure this argument. - replica
Rules List<Property Map> - List of replica rule. NOTE: only
versioning_enableis true andreplica_roleset can configure this argument. - Map<String>
- The tags of a bucket.
- versioning
Enable Boolean - Enable bucket versioning. NOTE: The
multi_azfeature is true for the current bucket, cannot disable version control. - website Property Map
- A website object(documented below).
Supporting Types
CosBucketCorsRule, CosBucketCorsRuleArgs
- Allowed
Headers List<string> - Specifies which headers are allowed.
- Allowed
Methods List<string> - Specifies which methods are allowed. Can be
GET,PUT,POST,DELETEorHEAD. - Allowed
Origins List<string> - Specifies which origins are allowed.
- Expose
Headers List<string> - Specifies expose header in the response.
- Max
Age doubleSeconds - Specifies time in seconds that browser can cache the response for a preflight request.
- Allowed
Headers []string - Specifies which headers are allowed.
- Allowed
Methods []string - Specifies which methods are allowed. Can be
GET,PUT,POST,DELETEorHEAD. - Allowed
Origins []string - Specifies which origins are allowed.
- Expose
Headers []string - Specifies expose header in the response.
- Max
Age float64Seconds - Specifies time in seconds that browser can cache the response for a preflight request.
- allowed
Headers List<String> - Specifies which headers are allowed.
- allowed
Methods List<String> - Specifies which methods are allowed. Can be
GET,PUT,POST,DELETEorHEAD. - allowed
Origins List<String> - Specifies which origins are allowed.
- expose
Headers List<String> - Specifies expose header in the response.
- max
Age DoubleSeconds - Specifies time in seconds that browser can cache the response for a preflight request.
- allowed
Headers string[] - Specifies which headers are allowed.
- allowed
Methods string[] - Specifies which methods are allowed. Can be
GET,PUT,POST,DELETEorHEAD. - allowed
Origins string[] - Specifies which origins are allowed.
- expose
Headers string[] - Specifies expose header in the response.
- max
Age numberSeconds - Specifies time in seconds that browser can cache the response for a preflight request.
- allowed_
headers Sequence[str] - Specifies which headers are allowed.
- allowed_
methods Sequence[str] - Specifies which methods are allowed. Can be
GET,PUT,POST,DELETEorHEAD. - allowed_
origins Sequence[str] - Specifies which origins are allowed.
- expose_
headers Sequence[str] - Specifies expose header in the response.
- max_
age_ floatseconds - Specifies time in seconds that browser can cache the response for a preflight request.
- allowed
Headers List<String> - Specifies which headers are allowed.
- allowed
Methods List<String> - Specifies which methods are allowed. Can be
GET,PUT,POST,DELETEorHEAD. - allowed
Origins List<String> - Specifies which origins are allowed.
- expose
Headers List<String> - Specifies expose header in the response.
- max
Age NumberSeconds - Specifies time in seconds that browser can cache the response for a preflight request.
CosBucketIntelligentTieringArchivingRuleList, CosBucketIntelligentTieringArchivingRuleListArgs
- Rule
Id string - The name of the intelligent tiering rule name list task, with the ID set to a non-default string, indicates that this rule is a conversion rule for archive and deep archive tiers.
- Status string
- Indicates whether the intelligent tiering rule is enabled. Possible values: Enabled, Disabled. When the ID is
default, onlyEnabledis supported. - Tierings
List<Cos
Bucket Intelligent Tiering Archiving Rule List Tiering> - Specifies configuration information related to data transformation in the intelligent tiered storage configuration.
- Filter
Cos
Bucket Intelligent Tiering Archiving Rule List Filter - Specifies configuration information related to data transformation in the intelligent tiered storage configuration.
- Rule
Id string - The name of the intelligent tiering rule name list task, with the ID set to a non-default string, indicates that this rule is a conversion rule for archive and deep archive tiers.
- Status string
- Indicates whether the intelligent tiering rule is enabled. Possible values: Enabled, Disabled. When the ID is
default, onlyEnabledis supported. - Tierings
[]Cos
Bucket Intelligent Tiering Archiving Rule List Tiering - Specifies configuration information related to data transformation in the intelligent tiered storage configuration.
- Filter
Cos
Bucket Intelligent Tiering Archiving Rule List Filter - Specifies configuration information related to data transformation in the intelligent tiered storage configuration.
- rule
Id String - The name of the intelligent tiering rule name list task, with the ID set to a non-default string, indicates that this rule is a conversion rule for archive and deep archive tiers.
- status String
- Indicates whether the intelligent tiering rule is enabled. Possible values: Enabled, Disabled. When the ID is
default, onlyEnabledis supported. - tierings
List<Cos
Bucket Intelligent Tiering Archiving Rule List Tiering> - Specifies configuration information related to data transformation in the intelligent tiered storage configuration.
- filter
Cos
Bucket Intelligent Tiering Archiving Rule List Filter - Specifies configuration information related to data transformation in the intelligent tiered storage configuration.
- rule
Id string - The name of the intelligent tiering rule name list task, with the ID set to a non-default string, indicates that this rule is a conversion rule for archive and deep archive tiers.
- status string
- Indicates whether the intelligent tiering rule is enabled. Possible values: Enabled, Disabled. When the ID is
default, onlyEnabledis supported. - tierings
Cos
Bucket Intelligent Tiering Archiving Rule List Tiering[] - Specifies configuration information related to data transformation in the intelligent tiered storage configuration.
- filter
Cos
Bucket Intelligent Tiering Archiving Rule List Filter - Specifies configuration information related to data transformation in the intelligent tiered storage configuration.
- rule_
id str - The name of the intelligent tiering rule name list task, with the ID set to a non-default string, indicates that this rule is a conversion rule for archive and deep archive tiers.
- status str
- Indicates whether the intelligent tiering rule is enabled. Possible values: Enabled, Disabled. When the ID is
default, onlyEnabledis supported. - tierings
Sequence[Cos
Bucket Intelligent Tiering Archiving Rule List Tiering] - Specifies configuration information related to data transformation in the intelligent tiered storage configuration.
- filter
Cos
Bucket Intelligent Tiering Archiving Rule List Filter - Specifies configuration information related to data transformation in the intelligent tiered storage configuration.
- rule
Id String - The name of the intelligent tiering rule name list task, with the ID set to a non-default string, indicates that this rule is a conversion rule for archive and deep archive tiers.
- status String
- Indicates whether the intelligent tiering rule is enabled. Possible values: Enabled, Disabled. When the ID is
default, onlyEnabledis supported. - tierings List<Property Map>
- Specifies configuration information related to data transformation in the intelligent tiered storage configuration.
- filter Property Map
- Specifies configuration information related to data transformation in the intelligent tiered storage configuration.
CosBucketIntelligentTieringArchivingRuleListFilter, CosBucketIntelligentTieringArchivingRuleListFilterArgs
- And
Cos
Bucket Intelligent Tiering Archiving Rule List Filter And - When filtering objects to be copied, if both prefix and object tag conditions are required simultaneously, or if multiple object tag conditions are needed, they must be enclosed in an
Andstatement. - Prefix string
- Filter objects by prefix; you can specify at most one prefix.
-
List<Cos
Bucket Intelligent Tiering Archiving Rule List Filter Tag> - When filtering objects for analysis, you can use object tags (multiple tags are supported) as filtering criteria.
- And
Cos
Bucket Intelligent Tiering Archiving Rule List Filter And - When filtering objects to be copied, if both prefix and object tag conditions are required simultaneously, or if multiple object tag conditions are needed, they must be enclosed in an
Andstatement. - Prefix string
- Filter objects by prefix; you can specify at most one prefix.
-
[]Cos
Bucket Intelligent Tiering Archiving Rule List Filter Tag - When filtering objects for analysis, you can use object tags (multiple tags are supported) as filtering criteria.
- and
Cos
Bucket Intelligent Tiering Archiving Rule List Filter And - When filtering objects to be copied, if both prefix and object tag conditions are required simultaneously, or if multiple object tag conditions are needed, they must be enclosed in an
Andstatement. - prefix String
- Filter objects by prefix; you can specify at most one prefix.
-
List<Cos
Bucket Intelligent Tiering Archiving Rule List Filter Tag> - When filtering objects for analysis, you can use object tags (multiple tags are supported) as filtering criteria.
- and
Cos
Bucket Intelligent Tiering Archiving Rule List Filter And - When filtering objects to be copied, if both prefix and object tag conditions are required simultaneously, or if multiple object tag conditions are needed, they must be enclosed in an
Andstatement. - prefix string
- Filter objects by prefix; you can specify at most one prefix.
-
Cos
Bucket Intelligent Tiering Archiving Rule List Filter Tag[] - When filtering objects for analysis, you can use object tags (multiple tags are supported) as filtering criteria.
- and_
Cos
Bucket Intelligent Tiering Archiving Rule List Filter And - When filtering objects to be copied, if both prefix and object tag conditions are required simultaneously, or if multiple object tag conditions are needed, they must be enclosed in an
Andstatement. - prefix str
- Filter objects by prefix; you can specify at most one prefix.
-
Sequence[Cos
Bucket Intelligent Tiering Archiving Rule List Filter Tag] - When filtering objects for analysis, you can use object tags (multiple tags are supported) as filtering criteria.
- and Property Map
- When filtering objects to be copied, if both prefix and object tag conditions are required simultaneously, or if multiple object tag conditions are needed, they must be enclosed in an
Andstatement. - prefix String
- Filter objects by prefix; you can specify at most one prefix.
- List<Property Map>
- When filtering objects for analysis, you can use object tags (multiple tags are supported) as filtering criteria.
CosBucketIntelligentTieringArchivingRuleListFilterAnd, CosBucketIntelligentTieringArchivingRuleListFilterAndArgs
- Prefix string
- Filter objects by prefix; you can specify at most one prefix.
-
List<Cos
Bucket Intelligent Tiering Archiving Rule List Filter And Tag> - When filtering objects to be copied, you can use object tags (multiple tags are supported) as filtering criteria, with a maximum of 10 tags allowed. After adding tags as filtering criteria, the
delete_marker_replication.statusoption must be set to false.
- Prefix string
- Filter objects by prefix; you can specify at most one prefix.
-
[]Cos
Bucket Intelligent Tiering Archiving Rule List Filter And Tag - When filtering objects to be copied, you can use object tags (multiple tags are supported) as filtering criteria, with a maximum of 10 tags allowed. After adding tags as filtering criteria, the
delete_marker_replication.statusoption must be set to false.
- prefix String
- Filter objects by prefix; you can specify at most one prefix.
-
List<Cos
Bucket Intelligent Tiering Archiving Rule List Filter And Tag> - When filtering objects to be copied, you can use object tags (multiple tags are supported) as filtering criteria, with a maximum of 10 tags allowed. After adding tags as filtering criteria, the
delete_marker_replication.statusoption must be set to false.
- prefix string
- Filter objects by prefix; you can specify at most one prefix.
-
Cos
Bucket Intelligent Tiering Archiving Rule List Filter And Tag[] - When filtering objects to be copied, you can use object tags (multiple tags are supported) as filtering criteria, with a maximum of 10 tags allowed. After adding tags as filtering criteria, the
delete_marker_replication.statusoption must be set to false.
- prefix str
- Filter objects by prefix; you can specify at most one prefix.
-
Sequence[Cos
Bucket Intelligent Tiering Archiving Rule List Filter And Tag] - When filtering objects to be copied, you can use object tags (multiple tags are supported) as filtering criteria, with a maximum of 10 tags allowed. After adding tags as filtering criteria, the
delete_marker_replication.statusoption must be set to false.
- prefix String
- Filter objects by prefix; you can specify at most one prefix.
- List<Property Map>
- When filtering objects to be copied, you can use object tags (multiple tags are supported) as filtering criteria, with a maximum of 10 tags allowed. After adding tags as filtering criteria, the
delete_marker_replication.statusoption must be set to false.
CosBucketIntelligentTieringArchivingRuleListFilterAndTag, CosBucketIntelligentTieringArchivingRuleListFilterAndTagArgs
CosBucketIntelligentTieringArchivingRuleListFilterTag, CosBucketIntelligentTieringArchivingRuleListFilterTagArgs
CosBucketIntelligentTieringArchivingRuleListTiering, CosBucketIntelligentTieringArchivingRuleListTieringArgs
- Access
Tier string - When
rule_idis notdefault, this parameter is used to specify the archiving or deep archiving tier. The possible value are: ARCHIVE_ACCESS, DEEP_ARCHIVE_ACCESS. - Days double
- When the
rule_idis not set to default, this specifies the number of days after which data is transitioned to the archive or deep archive tier in the intelligent tiering storage configuration. The archive tier (ARCHIVE_ACCESS) supports a range of 91 to 730 days. The deep archive tier (DEEP_ARCHIVE_ACCESS) supports a range of 180 to 730 days. Within the same rule, the number of days for the deep archive tier must be greater than the number of days for the archive tier.
- Access
Tier string - When
rule_idis notdefault, this parameter is used to specify the archiving or deep archiving tier. The possible value are: ARCHIVE_ACCESS, DEEP_ARCHIVE_ACCESS. - Days float64
- When the
rule_idis not set to default, this specifies the number of days after which data is transitioned to the archive or deep archive tier in the intelligent tiering storage configuration. The archive tier (ARCHIVE_ACCESS) supports a range of 91 to 730 days. The deep archive tier (DEEP_ARCHIVE_ACCESS) supports a range of 180 to 730 days. Within the same rule, the number of days for the deep archive tier must be greater than the number of days for the archive tier.
- access
Tier String - When
rule_idis notdefault, this parameter is used to specify the archiving or deep archiving tier. The possible value are: ARCHIVE_ACCESS, DEEP_ARCHIVE_ACCESS. - days Double
- When the
rule_idis not set to default, this specifies the number of days after which data is transitioned to the archive or deep archive tier in the intelligent tiering storage configuration. The archive tier (ARCHIVE_ACCESS) supports a range of 91 to 730 days. The deep archive tier (DEEP_ARCHIVE_ACCESS) supports a range of 180 to 730 days. Within the same rule, the number of days for the deep archive tier must be greater than the number of days for the archive tier.
- access
Tier string - When
rule_idis notdefault, this parameter is used to specify the archiving or deep archiving tier. The possible value are: ARCHIVE_ACCESS, DEEP_ARCHIVE_ACCESS. - days number
- When the
rule_idis not set to default, this specifies the number of days after which data is transitioned to the archive or deep archive tier in the intelligent tiering storage configuration. The archive tier (ARCHIVE_ACCESS) supports a range of 91 to 730 days. The deep archive tier (DEEP_ARCHIVE_ACCESS) supports a range of 180 to 730 days. Within the same rule, the number of days for the deep archive tier must be greater than the number of days for the archive tier.
- access_
tier str - When
rule_idis notdefault, this parameter is used to specify the archiving or deep archiving tier. The possible value are: ARCHIVE_ACCESS, DEEP_ARCHIVE_ACCESS. - days float
- When the
rule_idis not set to default, this specifies the number of days after which data is transitioned to the archive or deep archive tier in the intelligent tiering storage configuration. The archive tier (ARCHIVE_ACCESS) supports a range of 91 to 730 days. The deep archive tier (DEEP_ARCHIVE_ACCESS) supports a range of 180 to 730 days. Within the same rule, the number of days for the deep archive tier must be greater than the number of days for the archive tier.
- access
Tier String - When
rule_idis notdefault, this parameter is used to specify the archiving or deep archiving tier. The possible value are: ARCHIVE_ACCESS, DEEP_ARCHIVE_ACCESS. - days Number
- When the
rule_idis not set to default, this specifies the number of days after which data is transitioned to the archive or deep archive tier in the intelligent tiering storage configuration. The archive tier (ARCHIVE_ACCESS) supports a range of 91 to 730 days. The deep archive tier (DEEP_ARCHIVE_ACCESS) supports a range of 180 to 730 days. Within the same rule, the number of days for the deep archive tier must be greater than the number of days for the archive tier.
CosBucketLifecycleRule, CosBucketLifecycleRuleArgs
- Abort
Incomplete CosMultipart Upload Bucket Lifecycle Rule Abort Incomplete Multipart Upload - Set the maximum time a multipart upload is allowed to remain running.
- Expiration
Cos
Bucket Lifecycle Rule Expiration - Specifies a period in the object's expire (documented below).
- Filter
Prefix string - Object key prefix identifying one or more objects to which the rule applies.
- Id string
- A unique identifier for the rule. It can be up to 255 characters.
- Non
Current CosExpiration Bucket Lifecycle Rule Non Current Expiration - Specifies when non current object versions shall expire.
- Non
Current List<CosTransitions Bucket Lifecycle Rule Non Current Transition> - Specifies a period in the non current object's transitions.
- Transitions
List<Cos
Bucket Lifecycle Rule Transition> - Specifies a period in the object's transitions (documented below).
- Abort
Incomplete CosMultipart Upload Bucket Lifecycle Rule Abort Incomplete Multipart Upload - Set the maximum time a multipart upload is allowed to remain running.
- Expiration
Cos
Bucket Lifecycle Rule Expiration - Specifies a period in the object's expire (documented below).
- Filter
Prefix string - Object key prefix identifying one or more objects to which the rule applies.
- Id string
- A unique identifier for the rule. It can be up to 255 characters.
- Non
Current CosExpiration Bucket Lifecycle Rule Non Current Expiration - Specifies when non current object versions shall expire.
- Non
Current []CosTransitions Bucket Lifecycle Rule Non Current Transition - Specifies a period in the non current object's transitions.
- Transitions
[]Cos
Bucket Lifecycle Rule Transition - Specifies a period in the object's transitions (documented below).
- abort
Incomplete CosMultipart Upload Bucket Lifecycle Rule Abort Incomplete Multipart Upload - Set the maximum time a multipart upload is allowed to remain running.
- expiration
Cos
Bucket Lifecycle Rule Expiration - Specifies a period in the object's expire (documented below).
- filter
Prefix String - Object key prefix identifying one or more objects to which the rule applies.
- id String
- A unique identifier for the rule. It can be up to 255 characters.
- non
Current CosExpiration Bucket Lifecycle Rule Non Current Expiration - Specifies when non current object versions shall expire.
- non
Current List<CosTransitions Bucket Lifecycle Rule Non Current Transition> - Specifies a period in the non current object's transitions.
- transitions
List<Cos
Bucket Lifecycle Rule Transition> - Specifies a period in the object's transitions (documented below).
- abort
Incomplete CosMultipart Upload Bucket Lifecycle Rule Abort Incomplete Multipart Upload - Set the maximum time a multipart upload is allowed to remain running.
- expiration
Cos
Bucket Lifecycle Rule Expiration - Specifies a period in the object's expire (documented below).
- filter
Prefix string - Object key prefix identifying one or more objects to which the rule applies.
- id string
- A unique identifier for the rule. It can be up to 255 characters.
- non
Current CosExpiration Bucket Lifecycle Rule Non Current Expiration - Specifies when non current object versions shall expire.
- non
Current CosTransitions Bucket Lifecycle Rule Non Current Transition[] - Specifies a period in the non current object's transitions.
- transitions
Cos
Bucket Lifecycle Rule Transition[] - Specifies a period in the object's transitions (documented below).
- abort_
incomplete_ Cosmultipart_ upload Bucket Lifecycle Rule Abort Incomplete Multipart Upload - Set the maximum time a multipart upload is allowed to remain running.
- expiration
Cos
Bucket Lifecycle Rule Expiration - Specifies a period in the object's expire (documented below).
- filter_
prefix str - Object key prefix identifying one or more objects to which the rule applies.
- id str
- A unique identifier for the rule. It can be up to 255 characters.
- non_
current_ Cosexpiration Bucket Lifecycle Rule Non Current Expiration - Specifies when non current object versions shall expire.
- non_
current_ Sequence[Costransitions Bucket Lifecycle Rule Non Current Transition] - Specifies a period in the non current object's transitions.
- transitions
Sequence[Cos
Bucket Lifecycle Rule Transition] - Specifies a period in the object's transitions (documented below).
- abort
Incomplete Property MapMultipart Upload - Set the maximum time a multipart upload is allowed to remain running.
- expiration Property Map
- Specifies a period in the object's expire (documented below).
- filter
Prefix String - Object key prefix identifying one or more objects to which the rule applies.
- id String
- A unique identifier for the rule. It can be up to 255 characters.
- non
Current Property MapExpiration - Specifies when non current object versions shall expire.
- non
Current List<Property Map>Transitions - Specifies a period in the non current object's transitions.
- transitions List<Property Map>
- Specifies a period in the object's transitions (documented below).
CosBucketLifecycleRuleAbortIncompleteMultipartUpload, CosBucketLifecycleRuleAbortIncompleteMultipartUploadArgs
- Days
After doubleInitiation - Specifies the number of days after the multipart upload starts that the upload must be completed. The maximum value is 3650.
- Days
After float64Initiation - Specifies the number of days after the multipart upload starts that the upload must be completed. The maximum value is 3650.
- days
After DoubleInitiation - Specifies the number of days after the multipart upload starts that the upload must be completed. The maximum value is 3650.
- days
After numberInitiation - Specifies the number of days after the multipart upload starts that the upload must be completed. The maximum value is 3650.
- days_
after_ floatinitiation - Specifies the number of days after the multipart upload starts that the upload must be completed. The maximum value is 3650.
- days
After NumberInitiation - Specifies the number of days after the multipart upload starts that the upload must be completed. The maximum value is 3650.
CosBucketLifecycleRuleExpiration, CosBucketLifecycleRuleExpirationArgs
- Date string
- Specifies the date after which you want the corresponding action to take effect.
- Days double
- Specifies the number of days after object creation when the specific rule action takes effect.
- Delete
Marker bool - Indicates whether the delete marker of an expired object will be removed.
- Date string
- Specifies the date after which you want the corresponding action to take effect.
- Days float64
- Specifies the number of days after object creation when the specific rule action takes effect.
- Delete
Marker bool - Indicates whether the delete marker of an expired object will be removed.
- date String
- Specifies the date after which you want the corresponding action to take effect.
- days Double
- Specifies the number of days after object creation when the specific rule action takes effect.
- delete
Marker Boolean - Indicates whether the delete marker of an expired object will be removed.
- date string
- Specifies the date after which you want the corresponding action to take effect.
- days number
- Specifies the number of days after object creation when the specific rule action takes effect.
- delete
Marker boolean - Indicates whether the delete marker of an expired object will be removed.
- date str
- Specifies the date after which you want the corresponding action to take effect.
- days float
- Specifies the number of days after object creation when the specific rule action takes effect.
- delete_
marker bool - Indicates whether the delete marker of an expired object will be removed.
- date String
- Specifies the date after which you want the corresponding action to take effect.
- days Number
- Specifies the number of days after object creation when the specific rule action takes effect.
- delete
Marker Boolean - Indicates whether the delete marker of an expired object will be removed.
CosBucketLifecycleRuleNonCurrentExpiration, CosBucketLifecycleRuleNonCurrentExpirationArgs
- Non
Current doubleDays - Number of days after non current object creation when the specific rule action takes effect. The maximum value is 3650.
- Non
Current float64Days - Number of days after non current object creation when the specific rule action takes effect. The maximum value is 3650.
- non
Current DoubleDays - Number of days after non current object creation when the specific rule action takes effect. The maximum value is 3650.
- non
Current numberDays - Number of days after non current object creation when the specific rule action takes effect. The maximum value is 3650.
- non_
current_ floatdays - Number of days after non current object creation when the specific rule action takes effect. The maximum value is 3650.
- non
Current NumberDays - Number of days after non current object creation when the specific rule action takes effect. The maximum value is 3650.
CosBucketLifecycleRuleNonCurrentTransition, CosBucketLifecycleRuleNonCurrentTransitionArgs
- Storage
Class string - Specifies the storage class to which you want the non current object to transition. Available values include
STANDARD_IA,MAZ_STANDARD_IA,INTELLIGENT_TIERING,MAZ_INTELLIGENT_TIERING,ARCHIVE,DEEP_ARCHIVE. For more information, please refer to: https://cloud.tencent.com/document/product/436/33417. - Non
Current doubleDays - Number of days after non current object creation when the specific rule action takes effect.
- Storage
Class string - Specifies the storage class to which you want the non current object to transition. Available values include
STANDARD_IA,MAZ_STANDARD_IA,INTELLIGENT_TIERING,MAZ_INTELLIGENT_TIERING,ARCHIVE,DEEP_ARCHIVE. For more information, please refer to: https://cloud.tencent.com/document/product/436/33417. - Non
Current float64Days - Number of days after non current object creation when the specific rule action takes effect.
- storage
Class String - Specifies the storage class to which you want the non current object to transition. Available values include
STANDARD_IA,MAZ_STANDARD_IA,INTELLIGENT_TIERING,MAZ_INTELLIGENT_TIERING,ARCHIVE,DEEP_ARCHIVE. For more information, please refer to: https://cloud.tencent.com/document/product/436/33417. - non
Current DoubleDays - Number of days after non current object creation when the specific rule action takes effect.
- storage
Class string - Specifies the storage class to which you want the non current object to transition. Available values include
STANDARD_IA,MAZ_STANDARD_IA,INTELLIGENT_TIERING,MAZ_INTELLIGENT_TIERING,ARCHIVE,DEEP_ARCHIVE. For more information, please refer to: https://cloud.tencent.com/document/product/436/33417. - non
Current numberDays - Number of days after non current object creation when the specific rule action takes effect.
- storage_
class str - Specifies the storage class to which you want the non current object to transition. Available values include
STANDARD_IA,MAZ_STANDARD_IA,INTELLIGENT_TIERING,MAZ_INTELLIGENT_TIERING,ARCHIVE,DEEP_ARCHIVE. For more information, please refer to: https://cloud.tencent.com/document/product/436/33417. - non_
current_ floatdays - Number of days after non current object creation when the specific rule action takes effect.
- storage
Class String - Specifies the storage class to which you want the non current object to transition. Available values include
STANDARD_IA,MAZ_STANDARD_IA,INTELLIGENT_TIERING,MAZ_INTELLIGENT_TIERING,ARCHIVE,DEEP_ARCHIVE. For more information, please refer to: https://cloud.tencent.com/document/product/436/33417. - non
Current NumberDays - Number of days after non current object creation when the specific rule action takes effect.
CosBucketLifecycleRuleTransition, CosBucketLifecycleRuleTransitionArgs
- Storage
Class string - Specifies the storage class to which you want the object to transition. Available values include
STANDARD_IA,MAZ_STANDARD_IA,INTELLIGENT_TIERING,MAZ_INTELLIGENT_TIERING,ARCHIVE,DEEP_ARCHIVE. For more information, please refer to: https://cloud.tencent.com/document/product/436/33417. - Date string
- Specifies the date after which you want the corresponding action to take effect.
- Days double
- Specifies the number of days after object creation when the specific rule action takes effect.
- Storage
Class string - Specifies the storage class to which you want the object to transition. Available values include
STANDARD_IA,MAZ_STANDARD_IA,INTELLIGENT_TIERING,MAZ_INTELLIGENT_TIERING,ARCHIVE,DEEP_ARCHIVE. For more information, please refer to: https://cloud.tencent.com/document/product/436/33417. - Date string
- Specifies the date after which you want the corresponding action to take effect.
- Days float64
- Specifies the number of days after object creation when the specific rule action takes effect.
- storage
Class String - Specifies the storage class to which you want the object to transition. Available values include
STANDARD_IA,MAZ_STANDARD_IA,INTELLIGENT_TIERING,MAZ_INTELLIGENT_TIERING,ARCHIVE,DEEP_ARCHIVE. For more information, please refer to: https://cloud.tencent.com/document/product/436/33417. - date String
- Specifies the date after which you want the corresponding action to take effect.
- days Double
- Specifies the number of days after object creation when the specific rule action takes effect.
- storage
Class string - Specifies the storage class to which you want the object to transition. Available values include
STANDARD_IA,MAZ_STANDARD_IA,INTELLIGENT_TIERING,MAZ_INTELLIGENT_TIERING,ARCHIVE,DEEP_ARCHIVE. For more information, please refer to: https://cloud.tencent.com/document/product/436/33417. - date string
- Specifies the date after which you want the corresponding action to take effect.
- days number
- Specifies the number of days after object creation when the specific rule action takes effect.
- storage_
class str - Specifies the storage class to which you want the object to transition. Available values include
STANDARD_IA,MAZ_STANDARD_IA,INTELLIGENT_TIERING,MAZ_INTELLIGENT_TIERING,ARCHIVE,DEEP_ARCHIVE. For more information, please refer to: https://cloud.tencent.com/document/product/436/33417. - date str
- Specifies the date after which you want the corresponding action to take effect.
- days float
- Specifies the number of days after object creation when the specific rule action takes effect.
- storage
Class String - Specifies the storage class to which you want the object to transition. Available values include
STANDARD_IA,MAZ_STANDARD_IA,INTELLIGENT_TIERING,MAZ_INTELLIGENT_TIERING,ARCHIVE,DEEP_ARCHIVE. For more information, please refer to: https://cloud.tencent.com/document/product/436/33417. - date String
- Specifies the date after which you want the corresponding action to take effect.
- days Number
- Specifies the number of days after object creation when the specific rule action takes effect.
CosBucketObjectLockConfiguration, CosBucketObjectLockConfigurationArgs
- Enabled bool
- Enable object lock configuration.
- Rule
Cos
Bucket Object Lock Configuration Rule - Object locking configuration.
- Enabled bool
- Enable object lock configuration.
- Rule
Cos
Bucket Object Lock Configuration Rule - Object locking configuration.
- enabled Boolean
- Enable object lock configuration.
- rule
Cos
Bucket Object Lock Configuration Rule - Object locking configuration.
- enabled boolean
- Enable object lock configuration.
- rule
Cos
Bucket Object Lock Configuration Rule - Object locking configuration.
- enabled bool
- Enable object lock configuration.
- rule
Cos
Bucket Object Lock Configuration Rule - Object locking configuration.
- enabled Boolean
- Enable object lock configuration.
- rule Property Map
- Object locking configuration.
CosBucketObjectLockConfigurationRule, CosBucketObjectLockConfigurationRuleArgs
- Days double
- Object lock default duration (range: 1-36500).
- Days float64
- Object lock default duration (range: 1-36500).
- days Double
- Object lock default duration (range: 1-36500).
- days number
- Object lock default duration (range: 1-36500).
- days float
- Object lock default duration (range: 1-36500).
- days Number
- Object lock default duration (range: 1-36500).
CosBucketOriginDomainRule, CosBucketOriginDomainRuleArgs
CosBucketOriginPullRule, CosBucketOriginPullRuleArgs
- Host string
- Allows only a domain name or IP address. You can optionally append a port number to the address.
- Priority double
- Priority of origin-pull rules, do not set the same value for multiple rules.
- Back
To stringSource Mode - Back to source mode. Allow value: Proxy, Mirror, Redirect.
- Custom
Http Dictionary<string, string>Headers - Specifies the custom headers that you can add for COS to access your origin server.
- Follow
Http List<string>Headers - Specifies the pass through headers when accessing the origin server.
- Follow
Query boolString - Specifies whether to pass through COS request query string when accessing the origin server.
- Follow
Redirection bool - Specifies whether to follow 3XX redirect to another origin server to pull data from.
- Http
Redirect stringCode - Redirect code. Effective when
back_to_source_modeisRedirect. ex: 301, 302, 307. Default is 302. - Prefix string
- Triggers the origin-pull rule when the requested file name matches this prefix.
- Protocol string
- the protocol used for COS to access the specified origin server. The available value include
HTTP,HTTPSandFOLLOW. - Sync
Back boolTo Source - It has been deprecated from version 1.81.196. Please use
back_to_source_modeinstead. Iftrue, COS will not return 3XX status code when pulling data from an origin server. Current available zone: ap-beijing, ap-shanghai, ap-singapore, ap-mumbai.
- Host string
- Allows only a domain name or IP address. You can optionally append a port number to the address.
- Priority float64
- Priority of origin-pull rules, do not set the same value for multiple rules.
- Back
To stringSource Mode - Back to source mode. Allow value: Proxy, Mirror, Redirect.
- Custom
Http map[string]stringHeaders - Specifies the custom headers that you can add for COS to access your origin server.
- Follow
Http []stringHeaders - Specifies the pass through headers when accessing the origin server.
- Follow
Query boolString - Specifies whether to pass through COS request query string when accessing the origin server.
- Follow
Redirection bool - Specifies whether to follow 3XX redirect to another origin server to pull data from.
- Http
Redirect stringCode - Redirect code. Effective when
back_to_source_modeisRedirect. ex: 301, 302, 307. Default is 302. - Prefix string
- Triggers the origin-pull rule when the requested file name matches this prefix.
- Protocol string
- the protocol used for COS to access the specified origin server. The available value include
HTTP,HTTPSandFOLLOW. - Sync
Back boolTo Source - It has been deprecated from version 1.81.196. Please use
back_to_source_modeinstead. Iftrue, COS will not return 3XX status code when pulling data from an origin server. Current available zone: ap-beijing, ap-shanghai, ap-singapore, ap-mumbai.
- host String
- Allows only a domain name or IP address. You can optionally append a port number to the address.
- priority Double
- Priority of origin-pull rules, do not set the same value for multiple rules.
- back
To StringSource Mode - Back to source mode. Allow value: Proxy, Mirror, Redirect.
- custom
Http Map<String,String>Headers - Specifies the custom headers that you can add for COS to access your origin server.
- follow
Http List<String>Headers - Specifies the pass through headers when accessing the origin server.
- follow
Query BooleanString - Specifies whether to pass through COS request query string when accessing the origin server.
- follow
Redirection Boolean - Specifies whether to follow 3XX redirect to another origin server to pull data from.
- http
Redirect StringCode - Redirect code. Effective when
back_to_source_modeisRedirect. ex: 301, 302, 307. Default is 302. - prefix String
- Triggers the origin-pull rule when the requested file name matches this prefix.
- protocol String
- the protocol used for COS to access the specified origin server. The available value include
HTTP,HTTPSandFOLLOW. - sync
Back BooleanTo Source - It has been deprecated from version 1.81.196. Please use
back_to_source_modeinstead. Iftrue, COS will not return 3XX status code when pulling data from an origin server. Current available zone: ap-beijing, ap-shanghai, ap-singapore, ap-mumbai.
- host string
- Allows only a domain name or IP address. You can optionally append a port number to the address.
- priority number
- Priority of origin-pull rules, do not set the same value for multiple rules.
- back
To stringSource Mode - Back to source mode. Allow value: Proxy, Mirror, Redirect.
- custom
Http {[key: string]: string}Headers - Specifies the custom headers that you can add for COS to access your origin server.
- follow
Http string[]Headers - Specifies the pass through headers when accessing the origin server.
- follow
Query booleanString - Specifies whether to pass through COS request query string when accessing the origin server.
- follow
Redirection boolean - Specifies whether to follow 3XX redirect to another origin server to pull data from.
- http
Redirect stringCode - Redirect code. Effective when
back_to_source_modeisRedirect. ex: 301, 302, 307. Default is 302. - prefix string
- Triggers the origin-pull rule when the requested file name matches this prefix.
- protocol string
- the protocol used for COS to access the specified origin server. The available value include
HTTP,HTTPSandFOLLOW. - sync
Back booleanTo Source - It has been deprecated from version 1.81.196. Please use
back_to_source_modeinstead. Iftrue, COS will not return 3XX status code when pulling data from an origin server. Current available zone: ap-beijing, ap-shanghai, ap-singapore, ap-mumbai.
- host str
- Allows only a domain name or IP address. You can optionally append a port number to the address.
- priority float
- Priority of origin-pull rules, do not set the same value for multiple rules.
- back_
to_ strsource_ mode - Back to source mode. Allow value: Proxy, Mirror, Redirect.
- custom_
http_ Mapping[str, str]headers - Specifies the custom headers that you can add for COS to access your origin server.
- follow_
http_ Sequence[str]headers - Specifies the pass through headers when accessing the origin server.
- follow_
query_ boolstring - Specifies whether to pass through COS request query string when accessing the origin server.
- follow_
redirection bool - Specifies whether to follow 3XX redirect to another origin server to pull data from.
- http_
redirect_ strcode - Redirect code. Effective when
back_to_source_modeisRedirect. ex: 301, 302, 307. Default is 302. - prefix str
- Triggers the origin-pull rule when the requested file name matches this prefix.
- protocol str
- the protocol used for COS to access the specified origin server. The available value include
HTTP,HTTPSandFOLLOW. - sync_
back_ boolto_ source - It has been deprecated from version 1.81.196. Please use
back_to_source_modeinstead. Iftrue, COS will not return 3XX status code when pulling data from an origin server. Current available zone: ap-beijing, ap-shanghai, ap-singapore, ap-mumbai.
- host String
- Allows only a domain name or IP address. You can optionally append a port number to the address.
- priority Number
- Priority of origin-pull rules, do not set the same value for multiple rules.
- back
To StringSource Mode - Back to source mode. Allow value: Proxy, Mirror, Redirect.
- custom
Http Map<String>Headers - Specifies the custom headers that you can add for COS to access your origin server.
- follow
Http List<String>Headers - Specifies the pass through headers when accessing the origin server.
- follow
Query BooleanString - Specifies whether to pass through COS request query string when accessing the origin server.
- follow
Redirection Boolean - Specifies whether to follow 3XX redirect to another origin server to pull data from.
- http
Redirect StringCode - Redirect code. Effective when
back_to_source_modeisRedirect. ex: 301, 302, 307. Default is 302. - prefix String
- Triggers the origin-pull rule when the requested file name matches this prefix.
- protocol String
- the protocol used for COS to access the specified origin server. The available value include
HTTP,HTTPSandFOLLOW. - sync
Back BooleanTo Source - It has been deprecated from version 1.81.196. Please use
back_to_source_modeinstead. Iftrue, COS will not return 3XX status code when pulling data from an origin server. Current available zone: ap-beijing, ap-shanghai, ap-singapore, ap-mumbai.
CosBucketReplicaRule, CosBucketReplicaRuleArgs
- Destination
Bucket string - Destination bucket identifier, format:
qcs::cos:<region>::<bucketname-appid>. NOTE: destination bucket must enable versioning. - Delete
Marker CosReplication Bucket Replica Rule Delete Marker Replication - Synchronized deletion marker.
- Destination
Encryption stringKms Key Id - This field must be included when
source_selection_criteria.sse_kms_encrypted_objects.statusis set to Enabled. It is used to specify the KMS key used for KMS-encrypted objects copied to the destination bucket. - Destination
Storage stringClass - Storage class of destination, available values:
Standard,Intelligent_Tiering,Standard_IA. default is following current class of destination. - Filter
Cos
Bucket Replica Rule Filter - Filter the objects to be copied. The bucket feature will copy objects that match the prefixes and tags specified in the Filter settings.
- Id string
- Name of a specific rule.
- Prefix string
- Prefix matching policy. Policies cannot overlap; otherwise, an error will be returned. To match the root directory, leave this parameter empty.
- Priority double
- Execution priority, used to handle scenarios where the target storage buckets are the same and multiple replication rules match the same object. Note: Supports setting positive integers in the range of 1-1000. The Priority values of different rules cannot be duplicated. Storage bucket replication rules must either all have Priority set or all not have Priority set. When all rules have Priority set, overlapping prefixes are allowed for different rules when the target storage buckets are the same. When different rules match the same object, the rule with the smallest Priority value will be triggered first. When none of the rules have Priority set, overlapping prefixes are not allowed for different rules.
- Source
Selection CosCriteria Bucket Replica Rule Source Selection Criteria - This is used to specify additional conditions for objects supported by bucket replication rules. Currently, only the option to replicate KMS-encrypted objects is supported.
- Status string
- Status identifier, available values:
Enabled,Disabled.
- Destination
Bucket string - Destination bucket identifier, format:
qcs::cos:<region>::<bucketname-appid>. NOTE: destination bucket must enable versioning. - Delete
Marker CosReplication Bucket Replica Rule Delete Marker Replication - Synchronized deletion marker.
- Destination
Encryption stringKms Key Id - This field must be included when
source_selection_criteria.sse_kms_encrypted_objects.statusis set to Enabled. It is used to specify the KMS key used for KMS-encrypted objects copied to the destination bucket. - Destination
Storage stringClass - Storage class of destination, available values:
Standard,Intelligent_Tiering,Standard_IA. default is following current class of destination. - Filter
Cos
Bucket Replica Rule Filter - Filter the objects to be copied. The bucket feature will copy objects that match the prefixes and tags specified in the Filter settings.
- Id string
- Name of a specific rule.
- Prefix string
- Prefix matching policy. Policies cannot overlap; otherwise, an error will be returned. To match the root directory, leave this parameter empty.
- Priority float64
- Execution priority, used to handle scenarios where the target storage buckets are the same and multiple replication rules match the same object. Note: Supports setting positive integers in the range of 1-1000. The Priority values of different rules cannot be duplicated. Storage bucket replication rules must either all have Priority set or all not have Priority set. When all rules have Priority set, overlapping prefixes are allowed for different rules when the target storage buckets are the same. When different rules match the same object, the rule with the smallest Priority value will be triggered first. When none of the rules have Priority set, overlapping prefixes are not allowed for different rules.
- Source
Selection CosCriteria Bucket Replica Rule Source Selection Criteria - This is used to specify additional conditions for objects supported by bucket replication rules. Currently, only the option to replicate KMS-encrypted objects is supported.
- Status string
- Status identifier, available values:
Enabled,Disabled.
- destination
Bucket String - Destination bucket identifier, format:
qcs::cos:<region>::<bucketname-appid>. NOTE: destination bucket must enable versioning. - delete
Marker CosReplication Bucket Replica Rule Delete Marker Replication - Synchronized deletion marker.
- destination
Encryption StringKms Key Id - This field must be included when
source_selection_criteria.sse_kms_encrypted_objects.statusis set to Enabled. It is used to specify the KMS key used for KMS-encrypted objects copied to the destination bucket. - destination
Storage StringClass - Storage class of destination, available values:
Standard,Intelligent_Tiering,Standard_IA. default is following current class of destination. - filter
Cos
Bucket Replica Rule Filter - Filter the objects to be copied. The bucket feature will copy objects that match the prefixes and tags specified in the Filter settings.
- id String
- Name of a specific rule.
- prefix String
- Prefix matching policy. Policies cannot overlap; otherwise, an error will be returned. To match the root directory, leave this parameter empty.
- priority Double
- Execution priority, used to handle scenarios where the target storage buckets are the same and multiple replication rules match the same object. Note: Supports setting positive integers in the range of 1-1000. The Priority values of different rules cannot be duplicated. Storage bucket replication rules must either all have Priority set or all not have Priority set. When all rules have Priority set, overlapping prefixes are allowed for different rules when the target storage buckets are the same. When different rules match the same object, the rule with the smallest Priority value will be triggered first. When none of the rules have Priority set, overlapping prefixes are not allowed for different rules.
- source
Selection CosCriteria Bucket Replica Rule Source Selection Criteria - This is used to specify additional conditions for objects supported by bucket replication rules. Currently, only the option to replicate KMS-encrypted objects is supported.
- status String
- Status identifier, available values:
Enabled,Disabled.
- destination
Bucket string - Destination bucket identifier, format:
qcs::cos:<region>::<bucketname-appid>. NOTE: destination bucket must enable versioning. - delete
Marker CosReplication Bucket Replica Rule Delete Marker Replication - Synchronized deletion marker.
- destination
Encryption stringKms Key Id - This field must be included when
source_selection_criteria.sse_kms_encrypted_objects.statusis set to Enabled. It is used to specify the KMS key used for KMS-encrypted objects copied to the destination bucket. - destination
Storage stringClass - Storage class of destination, available values:
Standard,Intelligent_Tiering,Standard_IA. default is following current class of destination. - filter
Cos
Bucket Replica Rule Filter - Filter the objects to be copied. The bucket feature will copy objects that match the prefixes and tags specified in the Filter settings.
- id string
- Name of a specific rule.
- prefix string
- Prefix matching policy. Policies cannot overlap; otherwise, an error will be returned. To match the root directory, leave this parameter empty.
- priority number
- Execution priority, used to handle scenarios where the target storage buckets are the same and multiple replication rules match the same object. Note: Supports setting positive integers in the range of 1-1000. The Priority values of different rules cannot be duplicated. Storage bucket replication rules must either all have Priority set or all not have Priority set. When all rules have Priority set, overlapping prefixes are allowed for different rules when the target storage buckets are the same. When different rules match the same object, the rule with the smallest Priority value will be triggered first. When none of the rules have Priority set, overlapping prefixes are not allowed for different rules.
- source
Selection CosCriteria Bucket Replica Rule Source Selection Criteria - This is used to specify additional conditions for objects supported by bucket replication rules. Currently, only the option to replicate KMS-encrypted objects is supported.
- status string
- Status identifier, available values:
Enabled,Disabled.
- destination_
bucket str - Destination bucket identifier, format:
qcs::cos:<region>::<bucketname-appid>. NOTE: destination bucket must enable versioning. - delete_
marker_ Cosreplication Bucket Replica Rule Delete Marker Replication - Synchronized deletion marker.
- destination_
encryption_ strkms_ key_ id - This field must be included when
source_selection_criteria.sse_kms_encrypted_objects.statusis set to Enabled. It is used to specify the KMS key used for KMS-encrypted objects copied to the destination bucket. - destination_
storage_ strclass - Storage class of destination, available values:
Standard,Intelligent_Tiering,Standard_IA. default is following current class of destination. - filter
Cos
Bucket Replica Rule Filter - Filter the objects to be copied. The bucket feature will copy objects that match the prefixes and tags specified in the Filter settings.
- id str
- Name of a specific rule.
- prefix str
- Prefix matching policy. Policies cannot overlap; otherwise, an error will be returned. To match the root directory, leave this parameter empty.
- priority float
- Execution priority, used to handle scenarios where the target storage buckets are the same and multiple replication rules match the same object. Note: Supports setting positive integers in the range of 1-1000. The Priority values of different rules cannot be duplicated. Storage bucket replication rules must either all have Priority set or all not have Priority set. When all rules have Priority set, overlapping prefixes are allowed for different rules when the target storage buckets are the same. When different rules match the same object, the rule with the smallest Priority value will be triggered first. When none of the rules have Priority set, overlapping prefixes are not allowed for different rules.
- source_
selection_ Coscriteria Bucket Replica Rule Source Selection Criteria - This is used to specify additional conditions for objects supported by bucket replication rules. Currently, only the option to replicate KMS-encrypted objects is supported.
- status str
- Status identifier, available values:
Enabled,Disabled.
- destination
Bucket String - Destination bucket identifier, format:
qcs::cos:<region>::<bucketname-appid>. NOTE: destination bucket must enable versioning. - delete
Marker Property MapReplication - Synchronized deletion marker.
- destination
Encryption StringKms Key Id - This field must be included when
source_selection_criteria.sse_kms_encrypted_objects.statusis set to Enabled. It is used to specify the KMS key used for KMS-encrypted objects copied to the destination bucket. - destination
Storage StringClass - Storage class of destination, available values:
Standard,Intelligent_Tiering,Standard_IA. default is following current class of destination. - filter Property Map
- Filter the objects to be copied. The bucket feature will copy objects that match the prefixes and tags specified in the Filter settings.
- id String
- Name of a specific rule.
- prefix String
- Prefix matching policy. Policies cannot overlap; otherwise, an error will be returned. To match the root directory, leave this parameter empty.
- priority Number
- Execution priority, used to handle scenarios where the target storage buckets are the same and multiple replication rules match the same object. Note: Supports setting positive integers in the range of 1-1000. The Priority values of different rules cannot be duplicated. Storage bucket replication rules must either all have Priority set or all not have Priority set. When all rules have Priority set, overlapping prefixes are allowed for different rules when the target storage buckets are the same. When different rules match the same object, the rule with the smallest Priority value will be triggered first. When none of the rules have Priority set, overlapping prefixes are not allowed for different rules.
- source
Selection Property MapCriteria - This is used to specify additional conditions for objects supported by bucket replication rules. Currently, only the option to replicate KMS-encrypted objects is supported.
- status String
- Status identifier, available values:
Enabled,Disabled.
CosBucketReplicaRuleDeleteMarkerReplication, CosBucketReplicaRuleDeleteMarkerReplicationArgs
- Status string
- Whether to synchronously delete the tag, supports Disabled or Enabled. The default value is Enabled, meaning the tag will be deleted synchronously.
- Status string
- Whether to synchronously delete the tag, supports Disabled or Enabled. The default value is Enabled, meaning the tag will be deleted synchronously.
- status String
- Whether to synchronously delete the tag, supports Disabled or Enabled. The default value is Enabled, meaning the tag will be deleted synchronously.
- status string
- Whether to synchronously delete the tag, supports Disabled or Enabled. The default value is Enabled, meaning the tag will be deleted synchronously.
- status str
- Whether to synchronously delete the tag, supports Disabled or Enabled. The default value is Enabled, meaning the tag will be deleted synchronously.
- status String
- Whether to synchronously delete the tag, supports Disabled or Enabled. The default value is Enabled, meaning the tag will be deleted synchronously.
CosBucketReplicaRuleFilter, CosBucketReplicaRuleFilterArgs
- And
Cos
Bucket Replica Rule Filter And - When filtering objects to be copied, if both prefix and object tag conditions are required simultaneously, or if multiple object tag conditions are needed, they must be enclosed in an
Andstatement. - Prefix string
- Filter objects by prefix; you can specify at most one prefix.
- And
Cos
Bucket Replica Rule Filter And - When filtering objects to be copied, if both prefix and object tag conditions are required simultaneously, or if multiple object tag conditions are needed, they must be enclosed in an
Andstatement. - Prefix string
- Filter objects by prefix; you can specify at most one prefix.
- and
Cos
Bucket Replica Rule Filter And - When filtering objects to be copied, if both prefix and object tag conditions are required simultaneously, or if multiple object tag conditions are needed, they must be enclosed in an
Andstatement. - prefix String
- Filter objects by prefix; you can specify at most one prefix.
- and
Cos
Bucket Replica Rule Filter And - When filtering objects to be copied, if both prefix and object tag conditions are required simultaneously, or if multiple object tag conditions are needed, they must be enclosed in an
Andstatement. - prefix string
- Filter objects by prefix; you can specify at most one prefix.
- and_
Cos
Bucket Replica Rule Filter And - When filtering objects to be copied, if both prefix and object tag conditions are required simultaneously, or if multiple object tag conditions are needed, they must be enclosed in an
Andstatement. - prefix str
- Filter objects by prefix; you can specify at most one prefix.
- and Property Map
- When filtering objects to be copied, if both prefix and object tag conditions are required simultaneously, or if multiple object tag conditions are needed, they must be enclosed in an
Andstatement. - prefix String
- Filter objects by prefix; you can specify at most one prefix.
CosBucketReplicaRuleFilterAnd, CosBucketReplicaRuleFilterAndArgs
- Prefix string
- Filter objects by prefix; you can specify at most one prefix.
-
List<Cos
Bucket Replica Rule Filter And Tag> - When filtering objects to be copied, you can use object tags (multiple tags are supported) as filtering criteria, with a maximum of 10 tags allowed. After adding tags as filtering criteria, the
delete_marker_replication.statusoption must be set to false.
- Prefix string
- Filter objects by prefix; you can specify at most one prefix.
-
[]Cos
Bucket Replica Rule Filter And Tag - When filtering objects to be copied, you can use object tags (multiple tags are supported) as filtering criteria, with a maximum of 10 tags allowed. After adding tags as filtering criteria, the
delete_marker_replication.statusoption must be set to false.
- prefix String
- Filter objects by prefix; you can specify at most one prefix.
-
List<Cos
Bucket Replica Rule Filter And Tag> - When filtering objects to be copied, you can use object tags (multiple tags are supported) as filtering criteria, with a maximum of 10 tags allowed. After adding tags as filtering criteria, the
delete_marker_replication.statusoption must be set to false.
- prefix string
- Filter objects by prefix; you can specify at most one prefix.
-
Cos
Bucket Replica Rule Filter And Tag[] - When filtering objects to be copied, you can use object tags (multiple tags are supported) as filtering criteria, with a maximum of 10 tags allowed. After adding tags as filtering criteria, the
delete_marker_replication.statusoption must be set to false.
- prefix str
- Filter objects by prefix; you can specify at most one prefix.
-
Sequence[Cos
Bucket Replica Rule Filter And Tag] - When filtering objects to be copied, you can use object tags (multiple tags are supported) as filtering criteria, with a maximum of 10 tags allowed. After adding tags as filtering criteria, the
delete_marker_replication.statusoption must be set to false.
- prefix String
- Filter objects by prefix; you can specify at most one prefix.
- List<Property Map>
- When filtering objects to be copied, you can use object tags (multiple tags are supported) as filtering criteria, with a maximum of 10 tags allowed. After adding tags as filtering criteria, the
delete_marker_replication.statusoption must be set to false.
CosBucketReplicaRuleFilterAndTag, CosBucketReplicaRuleFilterAndTagArgs
CosBucketReplicaRuleSourceSelectionCriteria, CosBucketReplicaRuleSourceSelectionCriteriaArgs
- Sse
Kms CosEncrypted Objects Bucket Replica Rule Source Selection Criteria Sse Kms Encrypted Objects - Choose whether to copy the KMS-encrypted objects.
- Sse
Kms CosEncrypted Objects Bucket Replica Rule Source Selection Criteria Sse Kms Encrypted Objects - Choose whether to copy the KMS-encrypted objects.
- sse
Kms CosEncrypted Objects Bucket Replica Rule Source Selection Criteria Sse Kms Encrypted Objects - Choose whether to copy the KMS-encrypted objects.
- sse
Kms CosEncrypted Objects Bucket Replica Rule Source Selection Criteria Sse Kms Encrypted Objects - Choose whether to copy the KMS-encrypted objects.
- sse_
kms_ Cosencrypted_ objects Bucket Replica Rule Source Selection Criteria Sse Kms Encrypted Objects - Choose whether to copy the KMS-encrypted objects.
- sse
Kms Property MapEncrypted Objects - Choose whether to copy the KMS-encrypted objects.
CosBucketReplicaRuleSourceSelectionCriteriaSseKmsEncryptedObjects, CosBucketReplicaRuleSourceSelectionCriteriaSseKmsEncryptedObjectsArgs
- Status string
- Choose whether to copy KMS encrypted objects; supported values are Enabled and Disabled.
- Status string
- Choose whether to copy KMS encrypted objects; supported values are Enabled and Disabled.
- status String
- Choose whether to copy KMS encrypted objects; supported values are Enabled and Disabled.
- status string
- Choose whether to copy KMS encrypted objects; supported values are Enabled and Disabled.
- status str
- Choose whether to copy KMS encrypted objects; supported values are Enabled and Disabled.
- status String
- Choose whether to copy KMS encrypted objects; supported values are Enabled and Disabled.
CosBucketWebsite, CosBucketWebsiteArgs
- Endpoint string
Endpointof the static website.- Error
Document string - An absolute path to the document to return in case of a 4XX error.
- Index
Document string - COS returns this index document when requests are made to the root domain or any of the subfolders.
- Redirect
All stringRequests To - Redirects all request configurations. Valid values: http, https. Default is
http. - Routing
Rules CosBucket Website Routing Rules - Routing rule configuration. A RoutingRules container can contain up to 100 RoutingRule elements.
- Endpoint string
Endpointof the static website.- Error
Document string - An absolute path to the document to return in case of a 4XX error.
- Index
Document string - COS returns this index document when requests are made to the root domain or any of the subfolders.
- Redirect
All stringRequests To - Redirects all request configurations. Valid values: http, https. Default is
http. - Routing
Rules CosBucket Website Routing Rules - Routing rule configuration. A RoutingRules container can contain up to 100 RoutingRule elements.
- endpoint String
Endpointof the static website.- error
Document String - An absolute path to the document to return in case of a 4XX error.
- index
Document String - COS returns this index document when requests are made to the root domain or any of the subfolders.
- redirect
All StringRequests To - Redirects all request configurations. Valid values: http, https. Default is
http. - routing
Rules CosBucket Website Routing Rules - Routing rule configuration. A RoutingRules container can contain up to 100 RoutingRule elements.
- endpoint string
Endpointof the static website.- error
Document string - An absolute path to the document to return in case of a 4XX error.
- index
Document string - COS returns this index document when requests are made to the root domain or any of the subfolders.
- redirect
All stringRequests To - Redirects all request configurations. Valid values: http, https. Default is
http. - routing
Rules CosBucket Website Routing Rules - Routing rule configuration. A RoutingRules container can contain up to 100 RoutingRule elements.
- endpoint str
Endpointof the static website.- error_
document str - An absolute path to the document to return in case of a 4XX error.
- index_
document str - COS returns this index document when requests are made to the root domain or any of the subfolders.
- redirect_
all_ strrequests_ to - Redirects all request configurations. Valid values: http, https. Default is
http. - routing_
rules CosBucket Website Routing Rules - Routing rule configuration. A RoutingRules container can contain up to 100 RoutingRule elements.
- endpoint String
Endpointof the static website.- error
Document String - An absolute path to the document to return in case of a 4XX error.
- index
Document String - COS returns this index document when requests are made to the root domain or any of the subfolders.
- redirect
All StringRequests To - Redirects all request configurations. Valid values: http, https. Default is
http. - routing
Rules Property Map - Routing rule configuration. A RoutingRules container can contain up to 100 RoutingRule elements.
CosBucketWebsiteRoutingRules, CosBucketWebsiteRoutingRulesArgs
- Rules
List<Cos
Bucket Website Routing Rules Rule> - Routing rule list.
- Rules
[]Cos
Bucket Website Routing Rules Rule - Routing rule list.
- rules
List<Cos
Bucket Website Routing Rules Rule> - Routing rule list.
- rules
Cos
Bucket Website Routing Rules Rule[] - Routing rule list.
- rules
Sequence[Cos
Bucket Website Routing Rules Rule] - Routing rule list.
- rules List<Property Map>
- Routing rule list.
CosBucketWebsiteRoutingRulesRule, CosBucketWebsiteRoutingRulesRuleArgs
- Condition
Error stringCode - Specifies the error code as the match condition for the routing rule. Valid values: only 4xx return codes, such as 403 or 404.
- Condition
Prefix string - Specifies the object key prefix as the match condition for the routing rule.
- Redirect
Protocol string - Specifies the target protocol for the routing rule. Only HTTPS is supported.
- Redirect
Replace stringKey - Specifies the target object key to replace the original object key in the request.
- Redirect
Replace stringKey Prefix - Specifies the object key prefix to replace the original prefix in the request. You can set this parameter only if the condition is KeyPrefixEquals.
- Condition
Error stringCode - Specifies the error code as the match condition for the routing rule. Valid values: only 4xx return codes, such as 403 or 404.
- Condition
Prefix string - Specifies the object key prefix as the match condition for the routing rule.
- Redirect
Protocol string - Specifies the target protocol for the routing rule. Only HTTPS is supported.
- Redirect
Replace stringKey - Specifies the target object key to replace the original object key in the request.
- Redirect
Replace stringKey Prefix - Specifies the object key prefix to replace the original prefix in the request. You can set this parameter only if the condition is KeyPrefixEquals.
- condition
Error StringCode - Specifies the error code as the match condition for the routing rule. Valid values: only 4xx return codes, such as 403 or 404.
- condition
Prefix String - Specifies the object key prefix as the match condition for the routing rule.
- redirect
Protocol String - Specifies the target protocol for the routing rule. Only HTTPS is supported.
- redirect
Replace StringKey - Specifies the target object key to replace the original object key in the request.
- redirect
Replace StringKey Prefix - Specifies the object key prefix to replace the original prefix in the request. You can set this parameter only if the condition is KeyPrefixEquals.
- condition
Error stringCode - Specifies the error code as the match condition for the routing rule. Valid values: only 4xx return codes, such as 403 or 404.
- condition
Prefix string - Specifies the object key prefix as the match condition for the routing rule.
- redirect
Protocol string - Specifies the target protocol for the routing rule. Only HTTPS is supported.
- redirect
Replace stringKey - Specifies the target object key to replace the original object key in the request.
- redirect
Replace stringKey Prefix - Specifies the object key prefix to replace the original prefix in the request. You can set this parameter only if the condition is KeyPrefixEquals.
- condition_
error_ strcode - Specifies the error code as the match condition for the routing rule. Valid values: only 4xx return codes, such as 403 or 404.
- condition_
prefix str - Specifies the object key prefix as the match condition for the routing rule.
- redirect_
protocol str - Specifies the target protocol for the routing rule. Only HTTPS is supported.
- redirect_
replace_ strkey - Specifies the target object key to replace the original object key in the request.
- redirect_
replace_ strkey_ prefix - Specifies the object key prefix to replace the original prefix in the request. You can set this parameter only if the condition is KeyPrefixEquals.
- condition
Error StringCode - Specifies the error code as the match condition for the routing rule. Valid values: only 4xx return codes, such as 403 or 404.
- condition
Prefix String - Specifies the object key prefix as the match condition for the routing rule.
- redirect
Protocol String - Specifies the target protocol for the routing rule. Only HTTPS is supported.
- redirect
Replace StringKey - Specifies the target object key to replace the original object key in the request.
- redirect
Replace StringKey Prefix - Specifies the object key prefix to replace the original prefix in the request. You can set this parameter only if the condition is KeyPrefixEquals.
Import
COS bucket can be imported, e.g.
$ pulumi import tencentcloud:index/cosBucket:CosBucket bucket bucket-name
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
tencentcloudTerraform Provider.
published on Friday, Mar 6, 2026 by tencentcloudstack
