Skip to content

tencentcloud_teo_origin_acl sends invalid "L4EnableMode": "specific" when l4_proxy_ids is omitted/empty #4162

Description

@scottwallacesh

When configuring a tencentcloud_teo_origin_acl resource without defining Layer 4 proxy protection (i.e., l4_proxy_ids is omitted, set to null, or set to []), the provider incorrectly injects "L4EnableMode": "specific" into the EnableOriginACL API request payload.

Because L4ProxyIds is empty, the EdgeOne API strictly rejects the payload, as "L4EnableMode": "specific" requires at least one valid L4 proxy ID to be passed.

The provider should either omit L4EnableMode entirely from the JSON request or pass a valid mode (like "all") when no L4 proxies are defined.

Terraform CLI and Provider Versions

  • Terraform v1.15.5
  • tencentcloud-sdk-go: v1.82.97
  • terraform-provider-tencentcloud: v1.82.97

Affected Resource(s)

  • tencentcloud_teo_origin_acl

Terraform Configuration Files

resource "tencentcloud_teo_origin_acl" "origin_protection" {
  zone_id = "zone-xxxxxxxxx"

  origin_acl_family = "gaz"
  l7_hosts          = ["example.com.cn"]
  
  # Leaving l4_proxy_ids empty, null, or entirely commented out triggers the bug
  l4_proxy_ids      = [] 
}

Debug Output

2026-05-27T12:46:05.421+0100 [INFO]  provider.terraform-provider-tencentcloud_v1.82.97: 2026/05/27 12:46:05 ######[DEBUG]tencentcloud-sdk-go: [EnableOriginACL], request: {"ZoneId":"zone-xxxxxxxxx","L7EnableMode":"specific","L7Hosts":["example.com.cn"],"L4EnableMode":"specific","OriginACLFamily":"gaz"}, (host teo.tencentcloudapi.com, region:[ap-beijing]); response:{"Response":{"Error":{"Code":"InvalidParameterValue","Message":"When L4EnableMode is set to all, the L4ProxyIds field must be empty.When L4EnableMode is set to special, the L4ProxyIds field must contain specific Layer 4 proxy instance IDs.​​Please verify​​ that L4ProxyIds is accurately filled based on the selected mode."},"RequestId":"[UUID]"}},cost 1.78210158s: timestamp="2026-05-27T12:46:05.421+0100"

Expected Behavior

A successful API call configuring only the Layer 7 hosts. The provider should recognize that l4_proxy_ids is empty and either omit "L4EnableMode" from the request entirely, or set it to "all" so that the EdgeOne API validation passes.

Actual Behavior

The API rejects the request with a 400 InvalidParameterValue error because the provider defaulted to "L4EnableMode": "specific" without providing the required L4 proxy IDs.

i.e.

{
    "ZoneId": "zone-xxxxxxxxx",
    "L7EnableMode": "specific",
    "L7Hosts": [
        "example.com.cn"
    ],
    "L4EnableMode": "specific",
    "OriginACLFamily": "gaz"
}

Steps to Reproduce

  1. Create a tencentcloud_teo_origin_acl resource.
  2. Define l7_hosts.
  3. Omit l4_proxy_ids or explicitly set it to [].
  4. Run terraform apply.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions