tencentcloud.CosBucket
Explore with Pulumi AI
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
.
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("privateBucket", {
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("privateBucket",
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, "privateBucket", &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("privateBucket", 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();
final var appId = info.applyValue(getUserInfoResult -> getUserInfoResult.appId());
var privateBucket = new CosBucket("privateBucket", CosBucketArgs.builder()
.bucket(String.format("private-bucket-%s", appId))
.acl("private")
.build());
}
}
resources:
privateBucket:
type: tencentcloud:CosBucket
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("privateBucket", {
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("privateBucket",
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, "privateBucket", &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("privateBucket", 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();
final var appId = info.applyValue(getUserInfoResult -> getUserInfoResult.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
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("bucketBasic", {
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("bucketBasic",
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, "bucketBasic", &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("bucketBasic", 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();
final var appId = info.applyValue(getUserInfoResult -> getUserInfoResult.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
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("multiZoneBucket", {
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("multiZoneBucket",
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, "multiZoneBucket", &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("multiZoneBucket", 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();
final var appId = info.applyValue(getUserInfoResult -> getUserInfoResult.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
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("bucketWithAcl", {
bucket: appId.then(appId => `bucketwith-acl-${appId}`),
aclBody: `<AccessControlPolicy>
\x09<Owner>
\x09\x09<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\x09\x09<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\x09</Owner>
\x09<AccessControlList>
\x09\x09<Grant>
\x09\x09\x09<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group">
\x09\x09\x09\x09<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
\x09\x09\x09</Grantee>
\x09\x09\x09<Permission>READ</Permission>
\x09\x09</Grant>
\x09\x09<Grant>
\x09\x09\x09<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
\x09\x09\x09\x09<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\x09\x09\x09\x09<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\x09\x09\x09</Grantee>
\x09\x09\x09<Permission>FULL_CONTROL</Permission>
\x09\x09</Grant>
\x09\x09<Grant>
\x09\x09\x09<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
\x09\x09\x09\x09<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\x09\x09\x09\x09<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\x09\x09\x09</Grantee>
\x09\x09\x09<Permission>WRITE_ACP</Permission>
\x09\x09</Grant>
\x09\x09<Grant>
\x09\x09\x09<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group">
\x09\x09\x09\x09<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
\x09\x09\x09</Grantee>
\x09\x09\x09<Permission>READ_ACP</Permission>
\x09\x09</Grant>
\x09\x09<Grant>
\x09\x09\x09<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group">
\x09\x09\x09\x09<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
\x09\x09\x09</Grantee>
\x09\x09\x09<Permission>WRITE_ACP</Permission>
\x09\x09</Grant>
\x09\x09<Grant>
\x09\x09\x09<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
\x09\x09\x09\x09<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\x09\x09\x09\x09<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\x09\x09\x09</Grantee>
\x09\x09\x09<Permission>READ</Permission>
\x09\x09</Grant>
\x09\x09<Grant>
\x09\x09\x09<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
\x09\x09\x09\x09<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\x09\x09\x09\x09<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\x09\x09\x09</Grantee>
\x09\x09\x09<Permission>WRITE</Permission>
\x09\x09</Grant>
\x09\x09<Grant>
\x09\x09\x09<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group">
\x09\x09\x09\x09<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
\x09\x09\x09</Grantee>
\x09\x09\x09<Permission>FULL_CONTROL</Permission>
\x09\x09</Grant>
\x09</AccessControlList>
</AccessControlPolicy>
`,
});
import pulumi
import pulumi_tencentcloud as tencentcloud
info = tencentcloud.get_user_info()
app_id = info.app_id
bucket_with_acl = tencentcloud.CosBucket("bucketWithAcl",
bucket=f"bucketwith-acl-{app_id}",
acl_body="""<AccessControlPolicy>
\x09<Owner>
\x09\x09<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\x09\x09<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\x09</Owner>
\x09<AccessControlList>
\x09\x09<Grant>
\x09\x09\x09<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group">
\x09\x09\x09\x09<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
\x09\x09\x09</Grantee>
\x09\x09\x09<Permission>READ</Permission>
\x09\x09</Grant>
\x09\x09<Grant>
\x09\x09\x09<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
\x09\x09\x09\x09<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\x09\x09\x09\x09<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\x09\x09\x09</Grantee>
\x09\x09\x09<Permission>FULL_CONTROL</Permission>
\x09\x09</Grant>
\x09\x09<Grant>
\x09\x09\x09<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
\x09\x09\x09\x09<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\x09\x09\x09\x09<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\x09\x09\x09</Grantee>
\x09\x09\x09<Permission>WRITE_ACP</Permission>
\x09\x09</Grant>
\x09\x09<Grant>
\x09\x09\x09<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group">
\x09\x09\x09\x09<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
\x09\x09\x09</Grantee>
\x09\x09\x09<Permission>READ_ACP</Permission>
\x09\x09</Grant>
\x09\x09<Grant>
\x09\x09\x09<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group">
\x09\x09\x09\x09<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
\x09\x09\x09</Grantee>
\x09\x09\x09<Permission>WRITE_ACP</Permission>
\x09\x09</Grant>
\x09\x09<Grant>
\x09\x09\x09<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
\x09\x09\x09\x09<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\x09\x09\x09\x09<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\x09\x09\x09</Grantee>
\x09\x09\x09<Permission>READ</Permission>
\x09\x09</Grant>
\x09\x09<Grant>
\x09\x09\x09<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
\x09\x09\x09\x09<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
\x09\x09\x09\x09<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
\x09\x09\x09</Grantee>
\x09\x09\x09<Permission>WRITE</Permission>
\x09\x09</Grant>
\x09\x09<Grant>
\x09\x09\x09<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group">
\x09\x09\x09\x09<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
\x09\x09\x09</Grantee>
\x09\x09\x09<Permission>FULL_CONTROL</Permission>
\x09\x09</Grant>
\x09</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, "bucketWithAcl", &tencentcloud.CosBucketArgs{
Bucket: pulumi.Sprintf("bucketwith-acl-%v", appId),
AclBody: pulumi.String(`<AccessControlPolicy>
<Owner>
<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
</Owner>
<AccessControlList>
<Grant>
<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group">
<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
</Grantee>
<Permission>READ</Permission>
</Grant>
<Grant>
<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
</Grantee>
<Permission>FULL_CONTROL</Permission>
</Grant>
<Grant>
<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
</Grantee>
<Permission>WRITE_ACP</Permission>
</Grant>
<Grant>
<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group">
<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
</Grantee>
<Permission>READ_ACP</Permission>
</Grant>
<Grant>
<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group">
<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
</Grantee>
<Permission>WRITE_ACP</Permission>
</Grant>
<Grant>
<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
</Grantee>
<Permission>READ</Permission>
</Grant>
<Grant>
<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
</Grantee>
<Permission>WRITE</Permission>
</Grant>
<Grant>
<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group">
<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
</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 info = Tencentcloud.GetUserInfo.Invoke();
var appId = info.Apply(getUserInfoResult => getUserInfoResult.AppId);
var bucketWithAcl = new Tencentcloud.CosBucket("bucketWithAcl", new()
{
Bucket = appId.Apply(appId => $"bucketwith-acl-{appId}"),
AclBody = @"<AccessControlPolicy>
<Owner>
<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
</Owner>
<AccessControlList>
<Grant>
<Grantee xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xsi:type=""Group"">
<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
</Grantee>
<Permission>READ</Permission>
</Grant>
<Grant>
<Grantee xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xsi:type=""CanonicalUser"">
<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
</Grantee>
<Permission>FULL_CONTROL</Permission>
</Grant>
<Grant>
<Grantee xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xsi:type=""CanonicalUser"">
<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
</Grantee>
<Permission>WRITE_ACP</Permission>
</Grant>
<Grant>
<Grantee xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xsi:type=""Group"">
<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
</Grantee>
<Permission>READ_ACP</Permission>
</Grant>
<Grant>
<Grantee xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xsi:type=""Group"">
<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
</Grantee>
<Permission>WRITE_ACP</Permission>
</Grant>
<Grant>
<Grantee xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xsi:type=""CanonicalUser"">
<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
</Grantee>
<Permission>READ</Permission>
</Grant>
<Grant>
<Grantee xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xsi:type=""CanonicalUser"">
<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
</Grantee>
<Permission>WRITE</Permission>
</Grant>
<Grant>
<Grantee xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xsi:type=""Group"">
<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
</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 info = TencentcloudFunctions.getUserInfo();
final var appId = info.applyValue(getUserInfoResult -> getUserInfoResult.appId());
var bucketWithAcl = new CosBucket("bucketWithAcl", CosBucketArgs.builder()
.bucket(String.format("bucketwith-acl-%s", appId))
.aclBody("""
<AccessControlPolicy>
<Owner>
<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
</Owner>
<AccessControlList>
<Grant>
<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group">
<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
</Grantee>
<Permission>READ</Permission>
</Grant>
<Grant>
<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
</Grantee>
<Permission>FULL_CONTROL</Permission>
</Grant>
<Grant>
<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
</Grantee>
<Permission>WRITE_ACP</Permission>
</Grant>
<Grant>
<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group">
<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
</Grantee>
<Permission>READ_ACP</Permission>
</Grant>
<Grant>
<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group">
<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
</Grantee>
<Permission>WRITE_ACP</Permission>
</Grant>
<Grant>
<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
</Grantee>
<Permission>READ</Permission>
</Grant>
<Grant>
<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
</Grantee>
<Permission>WRITE</Permission>
</Grant>
<Grant>
<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group">
<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
</Grantee>
<Permission>FULL_CONTROL</Permission>
</Grant>
</AccessControlList>
</AccessControlPolicy>
""")
.build());
}
}
resources:
bucketWithAcl:
type: tencentcloud:CosBucket
properties:
bucket: bucketwith-acl-${appId}
# NOTE: Specify the acl_body by the priority sequence of permission and user type with the following sequence: `CanonicalUser with READ`, `CanonicalUser with WRITE`, `CanonicalUser with FULL_CONTROL`, `CanonicalUser with WRITE_ACP`, `CanonicalUser with READ_ACP`, then specify the `Group` of permissions same as `CanonicalUser`.
aclBody: |
<AccessControlPolicy>
<Owner>
<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
</Owner>
<AccessControlList>
<Grant>
<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group">
<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
</Grantee>
<Permission>READ</Permission>
</Grant>
<Grant>
<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
</Grantee>
<Permission>FULL_CONTROL</Permission>
</Grant>
<Grant>
<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
</Grantee>
<Permission>WRITE_ACP</Permission>
</Grant>
<Grant>
<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group">
<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
</Grantee>
<Permission>READ_ACP</Permission>
</Grant>
<Grant>
<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group">
<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
</Grantee>
<Permission>WRITE_ACP</Permission>
</Grant>
<Grant>
<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
</Grantee>
<Permission>READ</Permission>
</Grant>
<Grant>
<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
<ID>qcs::cam::uin/100022975249:uin/100022975249</ID>
<DisplayName>qcs::cam::uin/100022975249:uin/100022975249</DisplayName>
</Grantee>
<Permission>WRITE</Permission>
</Grant>
<Grant>
<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group">
<URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
</Grantee>
<Permission>FULL_CONTROL</Permission>
</Grant>
</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("bucketWithAcl", {
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("bucketWithAcl",
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, "bucketWithAcl", &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("bucketWithAcl", 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();
final var appId = info.applyValue(getUserInfoResult -> getUserInfoResult.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
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("bucketWithStaticWebsite", {
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("bucketWithStaticWebsite",
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, "bucketWithStaticWebsite", &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("bucketWithStaticWebsite", 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();
final var appId = info.applyValue(getUserInfoResult -> getUserInfoResult.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
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("bucketWithCors", {
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("bucketWithCors",
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, "bucketWithCors", &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("bucketWithCors", 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();
final var appId = info.applyValue(getUserInfoResult -> getUserInfoResult.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)
.exposeHeaders("Etag")
.build())
.build());
}
}
resources:
bucketWithCors:
type: tencentcloud:CosBucket
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 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("bucketWithCors", {
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("bucketWithCors",
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, "bucketWithCors", &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("bucketWithCors", 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();
final var appId = info.applyValue(getUserInfoResult -> getUserInfoResult.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)
.exposeHeaders("Etag")
.build())
.build());
}
}
resources:
bucketWithCors:
type: tencentcloud:CosBucket
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("bucketWithLifecycle", {
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("bucketWithLifecycle",
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, "bucketWithLifecycle", &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("bucketWithLifecycle", 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();
final var appId = info.applyValue(getUserInfoResult -> getUserInfoResult.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)
.storageClass("STANDARD_IA")
.build())
.expiration(CosBucketLifecycleRuleExpirationArgs.builder()
.days(90)
.build())
.build())
.build());
}
}
resources:
bucketWithLifecycle:
type: tencentcloud:CosBucket
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("bucketWithLifecycle", {
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("bucketWithLifecycle",
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, "bucketWithLifecycle", &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("bucketWithLifecycle", 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();
final var appId = info.applyValue(getUserInfoResult -> getUserInfoResult.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)
.build())
.build())
.build());
}
}
resources:
bucketWithLifecycle:
type: tencentcloud:CosBucket
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("bucketReplicate", {
bucket: appId.then(appId => `bucket-replicate-${appId}`),
acl: "private",
versioningEnable: true,
});
const bucketWithReplication = new tencentcloud.CosBucket("bucketWithReplication", {
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: "test-rep1",
status: "Enabled",
prefix: "dist",
destinationBucket: pulumi.interpolate`qcs::cos:${region}::${bucketReplicate.bucket}`,
}],
});
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("bucketReplicate",
bucket=f"bucket-replicate-{app_id}",
acl="private",
versioning_enable=True)
bucket_with_replication = tencentcloud.CosBucket("bucketWithReplication",
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": "test-rep1",
"status": "Enabled",
"prefix": "dist",
"destination_bucket": bucket_replicate.bucket.apply(lambda bucket: f"qcs::cos:{region}::{bucket}"),
}])
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, "bucketReplicate", &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, "bucketWithReplication", &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("test-rep1"),
Status: pulumi.String("Enabled"),
Prefix: pulumi.String("dist"),
DestinationBucket: bucketReplicate.Bucket.ApplyT(func(bucket string) (string, error) {
return fmt.Sprintf("qcs::cos:%v::%v", region, bucket), nil
}).(pulumi.StringOutput),
},
},
})
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("bucketReplicate", new()
{
Bucket = appId.Apply(appId => $"bucket-replicate-{appId}"),
Acl = "private",
VersioningEnable = true,
});
var bucketWithReplication = new Tencentcloud.CosBucket("bucketWithReplication", 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 = "test-rep1",
Status = "Enabled",
Prefix = "dist",
DestinationBucket = bucketReplicate.Bucket.Apply(bucket => $"qcs::cos:{region}::{bucket}"),
},
},
});
});
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 java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var info = TencentcloudFunctions.getUserInfo();
final var appId = info.applyValue(getUserInfoResult -> getUserInfoResult.appId());
final var uin = info.applyValue(getUserInfoResult -> getUserInfoResult.uin());
final var ownerUin = info.applyValue(getUserInfoResult -> getUserInfoResult.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("test-rep1")
.status("Enabled")
.prefix("dist")
.destinationBucket(bucketReplicate.bucket().applyValue(bucket -> String.format("qcs::cos:%s::%s", region,bucket)))
.build())
.build());
}
}
resources:
bucketReplicate:
type: tencentcloud:CosBucket
properties:
bucket: bucket-replicate-${appId}
acl: private
versioningEnable: true
bucketWithReplication:
type: tencentcloud:CosBucket
properties:
bucket: bucket-with-replication-${appId}
acl: private
versioningEnable: true
replicaRole: qcs::cam::uin/${ownerUin}:uin/${uin}
replicaRules:
- id: test-rep1
status: Enabled
prefix: dist
destinationBucket: qcs::cos:${region}::${bucketReplicate.bucket}
variables:
info:
fn::invoke:
function: tencentcloud:getUserInfo
arguments: {}
appId: ${info.appId}
uin: ${info.uin}
ownerUin: ${info.ownerUin}
region: ap-guangzhou
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,
enable_intelligent_tiering: Optional[bool] = None,
acl: Optional[str] = None,
cdc_id: Optional[str] = None,
cors_rules: Optional[Sequence[CosBucketCorsRuleArgs]] = None,
cos_bucket_id: Optional[str] = None,
acceleration_enable: Optional[bool] = None,
encryption_algorithm: Optional[str] = None,
force_clean: Optional[bool] = None,
intelligent_tiering_days: Optional[float] = None,
acl_body: Optional[str] = None,
intelligent_tiering_request_frequent: Optional[float] = None,
multi_az: Optional[bool] = None,
log_enable: Optional[bool] = None,
log_prefix: Optional[str] = None,
log_target_bucket: Optional[str] = None,
lifecycle_rules: Optional[Sequence[CosBucketLifecycleRuleArgs]] = 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)
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.
- 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
,KMS
andSM4
. - Force
Clean bool - Force cleanup all objects before delete bucket.
- 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_algorithm
is 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_enable
istrue
. - 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_enable
istrue
. User must have full access on this bucket. - Multi
Az bool - Indicates whether to create a bucket of multi available zone.
- 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_enable
is true can configure this argument. - Replica
Rules List<CosBucket Replica Rule> - List of replica rule. NOTE: only
versioning_enable
is true andreplica_role
set can configure this argument. - Dictionary<string, string>
- The tags of a bucket.
- Versioning
Enable bool - Enable bucket versioning. NOTE: The
multi_az
feature 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.
- 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
,KMS
andSM4
. - Force
Clean bool - Force cleanup all objects before delete bucket.
- 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_algorithm
is 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_enable
istrue
. - 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_enable
istrue
. User must have full access on this bucket. - Multi
Az bool - Indicates whether to create a bucket of multi available zone.
- 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_enable
is true can configure this argument. - Replica
Rules []CosBucket Replica Rule Args - List of replica rule. NOTE: only
versioning_enable
is true andreplica_role
set can configure this argument. - map[string]string
- The tags of a bucket.
- Versioning
Enable bool - Enable bucket versioning. NOTE: The
multi_az
feature 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.
- 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
,KMS
andSM4
. - force
Clean Boolean - Force cleanup all objects before delete bucket.
- 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_algorithm
is 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_enable
istrue
. - 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_enable
istrue
. User must have full access on this bucket. - multi
Az Boolean - Indicates whether to create a bucket of multi available zone.
- 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_enable
is true can configure this argument. - replica
Rules List<CosBucket Replica Rule> - List of replica rule. NOTE: only
versioning_enable
is true andreplica_role
set can configure this argument. - Map<String,String>
- The tags of a bucket.
- versioning
Enable Boolean - Enable bucket versioning. NOTE: The
multi_az
feature 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.
- 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
,KMS
andSM4
. - force
Clean boolean - Force cleanup all objects before delete bucket.
- 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_algorithm
is 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_enable
istrue
. - 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_enable
istrue
. User must have full access on this bucket. - multi
Az boolean - Indicates whether to create a bucket of multi available zone.
- 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_enable
is true can configure this argument. - replica
Rules CosBucket Replica Rule[] - List of replica rule. NOTE: only
versioning_enable
is true andreplica_role
set can configure this argument. - {[key: string]: string}
- The tags of a bucket.
- versioning
Enable boolean - Enable bucket versioning. NOTE: The
multi_az
feature 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.
- 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
,KMS
andSM4
. - force_
clean bool - Force cleanup all objects before delete bucket.
- 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_algorithm
is 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_enable
istrue
. - 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_enable
istrue
. User must have full access on this bucket. - multi_
az bool - Indicates whether to create a bucket of multi available zone.
- 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_enable
is true can configure this argument. - replica_
rules Sequence[CosBucket Replica Rule Args] - List of replica rule. NOTE: only
versioning_enable
is true andreplica_role
set can configure this argument. - Mapping[str, str]
- The tags of a bucket.
- versioning_
enable bool - Enable bucket versioning. NOTE: The
multi_az
feature 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.
- 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
,KMS
andSM4
. - force
Clean Boolean - Force cleanup all objects before delete bucket.
- 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_algorithm
is 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_enable
istrue
. - 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_enable
istrue
. User must have full access on this bucket. - multi
Az Boolean - Indicates whether to create a bucket of multi available zone.
- 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_enable
is true can configure this argument. - replica
Rules List<Property Map> - List of replica rule. NOTE: only
versioning_enable
is true andreplica_role
set can configure this argument. - Map<String>
- The tags of a bucket.
- versioning
Enable Boolean - Enable bucket versioning. NOTE: The
multi_az
feature 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,
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_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,
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) -> CosBucket
func 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.
- 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
,KMS
andSM4
. - Force
Clean bool - Force cleanup all objects before delete bucket.
- 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_algorithm
is 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_enable
istrue
. - 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_enable
istrue
. User must have full access on this bucket. - Multi
Az bool - Indicates whether to create a bucket of multi available zone.
- 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_enable
is true can configure this argument. - Replica
Rules List<CosBucket Replica Rule> - List of replica rule. NOTE: only
versioning_enable
is true andreplica_role
set can configure this argument. - Dictionary<string, string>
- The tags of a bucket.
- Versioning
Enable bool - Enable bucket versioning. NOTE: The
multi_az
feature 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.
- 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
,KMS
andSM4
. - Force
Clean bool - Force cleanup all objects before delete bucket.
- 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_algorithm
is 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_enable
istrue
. - 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_enable
istrue
. User must have full access on this bucket. - Multi
Az bool - Indicates whether to create a bucket of multi available zone.
- 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_enable
is true can configure this argument. - Replica
Rules []CosBucket Replica Rule Args - List of replica rule. NOTE: only
versioning_enable
is true andreplica_role
set can configure this argument. - map[string]string
- The tags of a bucket.
- Versioning
Enable bool - Enable bucket versioning. NOTE: The
multi_az
feature 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.
- 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
,KMS
andSM4
. - force
Clean Boolean - Force cleanup all objects before delete bucket.
- 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_algorithm
is 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_enable
istrue
. - 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_enable
istrue
. User must have full access on this bucket. - multi
Az Boolean - Indicates whether to create a bucket of multi available zone.
- 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_enable
is true can configure this argument. - replica
Rules List<CosBucket Replica Rule> - List of replica rule. NOTE: only
versioning_enable
is true andreplica_role
set can configure this argument. - Map<String,String>
- The tags of a bucket.
- versioning
Enable Boolean - Enable bucket versioning. NOTE: The
multi_az
feature 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.
- 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
,KMS
andSM4
. - force
Clean boolean - Force cleanup all objects before delete bucket.
- 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_algorithm
is 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_enable
istrue
. - 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_enable
istrue
. User must have full access on this bucket. - multi
Az boolean - Indicates whether to create a bucket of multi available zone.
- 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_enable
is true can configure this argument. - replica
Rules CosBucket Replica Rule[] - List of replica rule. NOTE: only
versioning_enable
is true andreplica_role
set can configure this argument. - {[key: string]: string}
- The tags of a bucket.
- versioning
Enable boolean - Enable bucket versioning. NOTE: The
multi_az
feature 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.
- 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
,KMS
andSM4
. - force_
clean bool - Force cleanup all objects before delete bucket.
- 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_algorithm
is 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_enable
istrue
. - 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_enable
istrue
. User must have full access on this bucket. - multi_
az bool - Indicates whether to create a bucket of multi available zone.
- 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_enable
is true can configure this argument. - replica_
rules Sequence[CosBucket Replica Rule Args] - List of replica rule. NOTE: only
versioning_enable
is true andreplica_role
set can configure this argument. - Mapping[str, str]
- The tags of a bucket.
- versioning_
enable bool - Enable bucket versioning. NOTE: The
multi_az
feature 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.
- 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
,KMS
andSM4
. - force
Clean Boolean - Force cleanup all objects before delete bucket.
- 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_algorithm
is 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_enable
istrue
. - 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_enable
istrue
. User must have full access on this bucket. - multi
Az Boolean - Indicates whether to create a bucket of multi available zone.
- 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_enable
is true can configure this argument. - replica
Rules List<Property Map> - List of replica rule. NOTE: only
versioning_enable
is true andreplica_role
set can configure this argument. - Map<String>
- The tags of a bucket.
- versioning
Enable Boolean - Enable bucket versioning. NOTE: The
multi_az
feature 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
,DELETE
orHEAD
. - 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
,DELETE
orHEAD
. - 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
,DELETE
orHEAD
. - 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
,DELETE
orHEAD
. - 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
,DELETE
orHEAD
. - 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
,DELETE
orHEAD
. - 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.
CosBucketLifecycleRule, CosBucketLifecycleRuleArgs
- Filter
Prefix string - Object key prefix identifying one or more objects to which the rule applies.
- 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).
- 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).
- Filter
Prefix string - Object key prefix identifying one or more objects to which the rule applies.
- 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).
- 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).
- filter
Prefix String - Object key prefix identifying one or more objects to which the rule applies.
- 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).
- 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).
- filter
Prefix string - Object key prefix identifying one or more objects to which the rule applies.
- 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).
- 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).
- filter_
prefix str - Object key prefix identifying one or more objects to which the rule applies.
- 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).
- 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).
- filter
Prefix String - Object key prefix identifying one or more objects to which the rule applies.
- 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).
- 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.
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.
- 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.
- 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
,HTTPS
andFOLLOW
. - Sync
Back boolTo Source - If
true
, 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.
- 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.
- 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
,HTTPS
andFOLLOW
. - Sync
Back boolTo Source - If
true
, 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.
- 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.
- 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
,HTTPS
andFOLLOW
. - sync
Back BooleanTo Source - If
true
, 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.
- 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.
- 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
,HTTPS
andFOLLOW
. - sync
Back booleanTo Source - If
true
, 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.
- 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.
- 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
,HTTPS
andFOLLOW
. - sync_
back_ boolto_ source - If
true
, 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.
- 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.
- 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
,HTTPS
andFOLLOW
. - sync
Back BooleanTo Source - If
true
, 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. - Status string
- Status identifier, available values:
Enabled
,Disabled
. - Destination
Storage stringClass - Storage class of destination, available values:
STANDARD
,INTELLIGENT_TIERING
,STANDARD_IA
. default is following current class of destination. - 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.
- Destination
Bucket string - Destination bucket identifier, format:
qcs::cos:<region>::<bucketname-appid>
. NOTE: destination bucket must enable versioning. - Status string
- Status identifier, available values:
Enabled
,Disabled
. - Destination
Storage stringClass - Storage class of destination, available values:
STANDARD
,INTELLIGENT_TIERING
,STANDARD_IA
. default is following current class of destination. - 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.
- destination
Bucket String - Destination bucket identifier, format:
qcs::cos:<region>::<bucketname-appid>
. NOTE: destination bucket must enable versioning. - status String
- Status identifier, available values:
Enabled
,Disabled
. - destination
Storage StringClass - Storage class of destination, available values:
STANDARD
,INTELLIGENT_TIERING
,STANDARD_IA
. default is following current class of destination. - 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.
- destination
Bucket string - Destination bucket identifier, format:
qcs::cos:<region>::<bucketname-appid>
. NOTE: destination bucket must enable versioning. - status string
- Status identifier, available values:
Enabled
,Disabled
. - destination
Storage stringClass - Storage class of destination, available values:
STANDARD
,INTELLIGENT_TIERING
,STANDARD_IA
. default is following current class of destination. - 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.
- destination_
bucket str - Destination bucket identifier, format:
qcs::cos:<region>::<bucketname-appid>
. NOTE: destination bucket must enable versioning. - status str
- Status identifier, available values:
Enabled
,Disabled
. - destination_
storage_ strclass - Storage class of destination, available values:
STANDARD
,INTELLIGENT_TIERING
,STANDARD_IA
. default is following current class of destination. - 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.
- destination
Bucket String - Destination bucket identifier, format:
qcs::cos:<region>::<bucketname-appid>
. NOTE: destination bucket must enable versioning. - status String
- Status identifier, available values:
Enabled
,Disabled
. - destination
Storage StringClass - Storage class of destination, available values:
STANDARD
,INTELLIGENT_TIERING
,STANDARD_IA
. default is following current class of destination. - 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.
CosBucketWebsite, CosBucketWebsiteArgs
- Endpoint string
Endpoint
of 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
Endpoint
of 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
Endpoint
of 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
Endpoint
of 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
Endpoint
of 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
Endpoint
of 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
tencentcloud
Terraform Provider.