Skip to main content
Stores the state as an object in a configurable prefix in a given bucket on Tencent Cloud Object Storage (COS). This backend supports state locking. Warning! It is highly recommended that you enable Object Versioning on the COS bucket to allow for state recovery in the case of accidental deletions and human error. Read more about this backend in the Terraform docs: https://developer.hashicorp.com/terraform/language/settings/backends/cos

Initializer

using Io.Cdktn;

new CosBackendConfig {
    string Bucket,
    bool Accelerate = null,
    string Acl = null,
    CosBackendAssumeRole AssumeRole = null,
    string Domain = null,
    bool Encrypt = null,
    string Endpoint = null,
    string Key = null,
    string Prefix = null,
    string Region = null,
    string SecretId = null,
    string SecretKey = null,
    string SecurityToken = null
};

Properties

NameTypeDescription
Bucketstring(Required) The name of the COS bucket.
Acceleratebool(Optional) Whether to enable global Acceleration.
Aclstring(Optional) Object ACL to be applied to the state file, allows private and public-read.
AssumeRoleCosBackendAssumeRole(Optional) The assume_role block.
Domainstring(Optional) The root domain of the API request.
Encryptbool(Optional) Whether to enable server side encryption of the state file.
Endpointstring(Optional) The Custom Endpoint for the COS backend.
Keystring(Optional) The path for saving the state file in bucket.
Prefixstring(Optional) The directory for saving the state file in bucket.
Regionstring(Optional) The region of the COS bucket.
SecretIdstring(Optional) Secret id of Tencent Cloud.
SecretKeystring(Optional) Secret key of Tencent Cloud.
SecurityTokenstring(Optional) TencentCloud Security Token of temporary access credentials.

BucketRequired

public string Bucket { get; set; }
  • Type: string
(Required) The name of the COS bucket. You shall manually create it first.

AccelerateOptional

public bool Accelerate { get; set; }
  • Type: bool
(Optional) Whether to enable global Acceleration. Defaults to false.

AclOptional

public string Acl { get; set; }
  • Type: string
(Optional) Object ACL to be applied to the state file, allows private and public-read. Defaults to private.

AssumeRoleOptional

public CosBackendAssumeRole AssumeRole { get; set; }
(Optional) The assume_role block. If provided, terraform will attempt to assume this role using the supplied credentials.

DomainOptional

public string Domain { get; set; }
  • Type: string
(Optional) The root domain of the API request. Defaults to tencentcloudapi.com. It supports the environment variable TENCENTCLOUD_DOMAIN.

EncryptOptional

public bool Encrypt { get; set; }
  • Type: bool
(Optional) Whether to enable server side encryption of the state file. If it is true, COS will use ‘AES256’ encryption algorithm to encrypt state file.

EndpointOptional

public string Endpoint { get; set; }
  • Type: string
(Optional) The Custom Endpoint for the COS backend. It supports the environment variable TENCENTCLOUD_ENDPOINT.

KeyOptional

public string Key { get; set; }
  • Type: string
(Optional) The path for saving the state file in bucket. Defaults to terraform.tfstate.

PrefixOptional

public string Prefix { get; set; }
  • Type: string
(Optional) The directory for saving the state file in bucket. Default to “env:”.

RegionOptional

public string Region { get; set; }
  • Type: string
(Optional) The region of the COS bucket. It supports environment variables TENCENTCLOUD_REGION.

SecretIdOptional

public string SecretId { get; set; }
  • Type: string
(Optional) Secret id of Tencent Cloud. It supports environment variables TENCENTCLOUD_SECRET_ID.

SecretKeyOptional

public string SecretKey { get; set; }
  • Type: string
(Optional) Secret key of Tencent Cloud. It supports environment variables TENCENTCLOUD_SECRET_KEY.

SecurityTokenOptional

public string SecurityToken { get; set; }
  • Type: string
(Optional) TencentCloud Security Token of temporary access credentials. It supports environment variables TENCENTCLOUD_SECURITY_TOKEN.