These are notes that I've written when I was working on building a Hashicorp Packer Builder plugin in Go.

The issue with the development of this Packer Builder plugin is that some of the Tencent documentation are outdated, and the Chinese/Mandarin documentation are more updated than the English ones.

The following lists the issues encountered when developing the plugin.

Invalid SSL certificate
Encountering the error
x509: certificate is valid for *, not
when making a call to

Missing required parameter
Wrong domain name vs

Connecting to the nearest datacenter

When connecting to the general URL:, the CVM API would connect to the nearest data center.
So, for example, if you’re using, and you’re located in Singapore, you get redirected to
And, if you’re located in Silicon Valley, you get redirected to

While this speeds up performance, it gives the issue listed in the Invalid SSL certificate above. The alternative is to connect to a regional-specific data center each time, or alter the plugin to read and connect to a specific domain specified in the configuration. See also the issue: “Information available only in Chinese” below.

No information available
When attempting to create a keypair, the following issues were encountered:

  1.     the SSL certificate issue listed above when making a call to
  2.     It requires a ProjectId parameter, and refers to getting it from the Console’s Project section, and alternatively, getting from the DescribeProject API which lists a different domain: to get it from.

When attempting to bind a keypair to a cloud machine, the following issues were encountered:

  1.     Undocumented TaskId as a return parameter
  2.     The cloud machine cannot be started until the keypair binding completed, otherwise, SSH login to the cloud machine isn’t possible. The alternative is to wait a few minutes, long enough for it to work.

Information available only in Chinese
This says that the service address suffix (or domain) supports redirecting to the nearest geographical domain.

Confusing response

When you provide too much data, the response from Tencent can be misleading.
For example, when you provide two PrivateIpAddresses instead of  one as documented here:, the error message received reads:

"Message": "The value `1` specified in the parameter `InstanceCount` is not valid."

User References:

  1.     Introduction to the Tencent Cloud:
  2.     Zones -
  3.     Image IDs:
  4.     Billing type: See and Pricing modes:
  5.     Log into Linux instances:  
  6.     Instance Types: and

Development References:

  1. Packer plugins:
  2. Custom Builders:
  3. Third party Builders
    1. Softlayer: 
    2. XenServer:
    3. Ali Cloud:
  5. Log into Linux instances:
  6. Creating SSH keypair:
  7. Parsing JSON in golang:    
  8. A getting started guide for Go newcomers:
  9. How are external Packer plugins supposed to configure the communicator?:
  10. Packer plugin for remote builds on VMware vSphere:
  11. Types -
  12. HTTP Upload:
  13. Help & Documentation: