Skip to content

tencentcloud_cos_bucket has a bug when use on cdc and encryption_algorithm is set for cos/kms, terraform do not find that resource was already changed to use this algorithm #3197

Open
@andre1704

Description

@andre1704

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

terraform version
Terraform v1.11.1
on linux_amd64

  • provider registry.terraform.io/tencentcloudstack/tencentcloud v1.81.164

Affected Resource(s)

tencentcloud_cos_bucket

Terraform Configuration Files

terraform {
  required_version = ">= 1.11.1"
  backend "cos" {}

  required_providers {
    tencentcloud = {
      source  = "tencentcloudstack/tencentcloud"
      version = ">1.18.120"
    }
  }
}

provider "tencentcloud" {
  region     = var.source_region
  cos_domain = var.cos_cdc_domain
}





resource "tencentcloud_cos_bucket" "source_s3" {
  bucket               = var.bucket_name
  acl                  = var.acl
  encryption_algorithm = var.encryption_algorithm
  versioning_enable    = true
}



variable "encryption_algorithm" {
  type        = string
  default     = "cos/kms"
  description = "tencent cloud cos encryption algorithm."
}


variable "acl" {
  type        = string
  default     = "private"
  description = "tencent cloud cos acl setting"
}

variable "bucket_name" {
  type        = string
}

Debug Output

Panic Output

Expected Behavior

For cdc cluster on tencent we should be able to create a cos bucket and the bucket should have been encrypted according to the provided setting (cos/kms)

Actual Behavior

A bucket has been created, and even settings for encryption on tencent are set, but when we are doing after applying those changes once more terraform plan or apply then terraform plan shows that it want once again to change encryption even it was set

~ resource "tencentcloud_cos_bucket" "source_s3" {                                                                                                      
 ~ encryption_algorithm = "aws:kms" -> "cos/kms"  

it looks like foe encryption type cos/kms terraform does not properly recognize that it has been changed already.

Steps to Reproduce

You need to have access to the cdc cluster so it could be possible to reproduce, but if you have then you need to do

  1. terraform apply
  2. once again terraform apply

so you could see that terraform do not recognize that encryption has been already changed to cos/kms

Important Factoids

References

  • #0000

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions