Skip to content

For tencentcloud_clb_listener_rule domain can't be regular expression or wildcards even though such config can be added on Tencen console manually #3288

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
andre1704 opened this issue Apr 9, 2025 · 0 comments

Comments

@andre1704
Copy link

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 -v
Terraform v1.11.1
on linux_amd64

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

Affected Resource(s)

  • tencentcloud_clb_listener_rule

Terraform Configuration Files

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key: https://keybase.io/hashicorp

resource "tencentcloud_clb_instance" "public" {
  clb_name                     = "test-123"
  network_type                 = "OPEN"
  vpc_id                       = var.cloud_vpc_id
  snat_pro                     = true
  load_balancer_pass_to_target = true
  snat_ips {
    subnet_id = var.cloud_subnet_id
  }

}

resource "tencentcloud_clb_listener" "https" {
  clb_id               = tencentcloud_clb_instance.public.id
  listener_name        = join("-", ["https", var.pub_subdomain])
  protocol             = "HTTPS"
  port                 = 443
  certificate_id       = var.ssl_id
  certificate_ssl_mode = "UNIDIRECTIONAL"
}

resource "tencentcloud_clb_listener_rule" "https_rule" {
  listener_id          = tencentcloud_clb_listener.https.listener_id
  clb_id               = tencentcloud_clb_instance.public.id
  domain               = join(".", ["*", var.pub_domain])
  url                  = "/"
  certificate_ssl_mode = "UNIDIRECTIONAL"
  certificate_id       = var.ssl_id
  target_type          = "NODE"
  health_check_type    = "TCP"
}

Debug Output

Panic Output

Expected Behavior

CLB rules are added to the created CLB

Actual Behavior

I am getting an error that the wildcard can't be used

"Error: [TencentCloudSDKError] Code=InvalidParameterValue, Message=HttpCheckDomain:*.example.io can't be regular expression or wildcards."

If I add such a CLB rule manually on the Tencent console with a wildcard, it works, but when I try to do it from the terraform code, it does not work.

Steps to Reproduce

  1. terraform apply
    with config:
resource "tencentcloud_clb_listener_rule" "https_rule" {
  listener_id          = tencentcloud_clb_listener.https.listener_id
  clb_id               = tencentcloud_clb_instance.public.id
  domain               = join(".", ["*", var.pub_domain])

You will get an error
Code=InvalidParameterValue, Message=HttpCheckDomain:*.example.io can't be regular expression or wildcards.

Here is a workaround to the bug:
2. terraform apply with different config

resource "tencentcloud_clb_listener_rule" "https_rule" {
  listener_id          = tencentcloud_clb_listener.https.listener_id
  clb_id               = tencentcloud_clb_instance.public.id
  domain               = var.pub_domain

After this listener_rule will be applied once again do terraform apply with different settings

resource "tencentcloud_clb_listener_rule" "https_rule" {
  listener_id          = tencentcloud_clb_listener.https.listener_id
  clb_id               = tencentcloud_clb_instance.public.id
  domain               = join(".", ["*", var.pub_domain])

Important Factoids

References

  • #0000
@andre1704 andre1704 changed the title For tencentcloud_clb_listener_rule domain can't be regular expression or wildcards even thou such config can be added on Tencen console manually For tencentcloud_clb_listener_rule domain can't be regular expression or wildcards even though such config can be added on Tencen console manually Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant