Community Note
Terraform Version
Terraform v1.15.6
+ provider registry.terraform.io/tencentcloudstack/tencentcloud v1.83.13
Affected Resource(s)
tencentcloud_vpc_private_nat_gateway
Terraform Configuration Files
terraform {
required_version = ">= 1.5.0"
required_providers {
tencentcloud = {
source = "tencentcloudstack/tencentcloud"
version = ">= 1.81.0"
}
}
}
provider "tencentcloud" {
region = "ap-singapore"
}
resource "tencentcloud_vpc_private_nat_gateway" "test" {
nat_gateway_name = "tf-s4-vpc-and-ccn"
vpc_id = "vpc-6r53my5v"
ccn_id = "ccn-emy8y03t"
}
Debug Output
[Insert Link to your Gist Here]
Panic Output
N/A
Expected Behavior
When ccn_id is supplied alongside the required vpc_id, the provider should allow explicit creation of a CCN-type Private NAT Gateway. The CcnId parameter should be propagated to the Tencent Cloud API, and the resulting network type should reflect the CCN architecture.
Alternatively, if an explicit switch is required by the backend API, a network_type selector should be exposed in the Terraform schema.
Actual Behavior
The provider creates a Direct Connect type (DCG) gateway instead of a CCN type. The resulting state object does not persist the CcnId (returns as ""), and the NatType defaults to DCG.
Steps to Reproduce
-
Initialize Terraform: terraform init
-
Apply the configuration containing both vpc_id and ccn_id: terraform apply
-
Verify the created resource attributes using the Tencent Cloud CLI:
tccli vpc DescribePrivateNatGateways --region ap-singapore --Limit 50 | Select-String "tf-s4-vpc-and-ccn|NatGatewayId|NatType|VpcType|CcnId"
- Observe the output showing the gateway defaulted to a Direct Connect type:
"NatGatewayId": "intranat-4kgcjv0g",
"NatGatewayName": "tf-s4-vpc-and-ccn",
"NatType": "DCG",
"VpcType": false,
"CcnId": ""
Important Factoids
Tencent Cloud supports three types of Private NAT Gateways: Direct Connect, VPC, and CCN.
-
When applying vpc_id and explicitly passing vpc_type = true, the provider successfully creates a VPC Type gateway.
-
When applying only ccn_id (omitting vpc_id), the API rightfully rejects the request with a MissingParameter: VpcId error, because a host VPC is physically required.
-
When applying both vpc_id and ccn_id, the provider fails to infer the CCN type and quietly defaults to a Direct Connect (DCG) gateway, ignoring the provided ccn_id payload. There is currently no observable override flag (like vpc_type = true) to force a CCN type.
References
Tencent Cloud Private NAT Gateway - Terraform Issue.pdf
Community Note
Terraform Version
Affected Resource(s)
tencentcloud_vpc_private_nat_gatewayTerraform Configuration Files
Debug Output
[Insert Link to your Gist Here]
Panic Output
N/A
Expected Behavior
When
ccn_idis supplied alongside the requiredvpc_id, the provider should allow explicit creation of a CCN-type Private NAT Gateway. TheCcnIdparameter should be propagated to the Tencent Cloud API, and the resulting network type should reflect the CCN architecture.Alternatively, if an explicit switch is required by the backend API, a
network_typeselector should be exposed in the Terraform schema.Actual Behavior
The provider creates a Direct Connect type (
DCG) gateway instead of a CCN type. The resulting state object does not persist theCcnId(returns as""), and theNatTypedefaults toDCG.Steps to Reproduce
Initialize Terraform:
terraform initApply the configuration containing both
vpc_idandccn_id:terraform applyVerify the created resource attributes using the Tencent Cloud CLI:
Important Factoids
Tencent Cloud supports three types of Private NAT Gateways: Direct Connect, VPC, and CCN.
When applying
vpc_idand explicitly passingvpc_type = true, the provider successfully creates a VPC Type gateway.When applying only
ccn_id(omittingvpc_id), the API rightfully rejects the request with aMissingParameter: VpcIderror, because a host VPC is physically required.When applying both
vpc_idandccn_id, the provider fails to infer the CCN type and quietly defaults to a Direct Connect (DCG) gateway, ignoring the providedccn_idpayload. There is currently no observable override flag (likevpc_type = true) to force a CCN type.References
Tencent Cloud Private NAT Gateway - Terraform Issue.pdf