Terraform prints generic error message instead of the actual message from SoftLayer.
In my example underscore char is forbidden to be used in host name. In such case SoftLayer API returns response (code 500) with following payload:
<?xml version="1.0" encoding="iso-8859-1"?>
<methodResponse>
<fault>
<value>
<struct>
<member>
<name>faultCode</name>
<value>
<string>SoftLayer_Exception_Public</string>
</value>
</member>
<member>
<name>faultString</name>
<value>
<string>The hostname and domain must be alphanumeric strings that may be separated by periods '.'. The only other allowable special character is the dash '-' However the special characters '.' and '-' may not be consecutive. Each alphanumeric string separated by a period is considered a label. Labels must begin and end with an alphanumeric character and must be between 1-63 characters in length. The last label, the TLD (top level domain) must be between 2-24 alphabetic characters. The TLD label and hostname cannot be solely comprised of digits. The domain portion must consist of least one label followed by a period '.' then ending with the TLD label. Combining the hostname, followed by a period '.', followed by the domain gives the FQDN (fully qualified domain name), which may not exceed 253 characters in total length.</string>
</value>
</member>
</struct>
</value>
</fault>
</methodResponse>
If use terraform with the same input data then it prints generic error 500 message.
resource "softlayer_virtual_guest" "server1" {
name = "server1_name"
block_device_template_group_gid = "${var.block_device_template_group_gid}"
domain = "${var.domain}"
region = "${var.region}"
hourly_billing = "${var.hourly_billing}"
private_network_only = "${var.private_network_only}"
public_network_speed = "${var.public_network_speed}"
cpu = "${var.cpu}"
ram = "${var.ram}"
local_disk = "${var.local_disk}"
}
Terraform should print actual error message instead of showing generic Error 500:
The hostname and domain must be alphanumeric strings that may be separated by periods '.'. The only other allowable special character is the dash '-' However the special characters '.' and '-' may not be consecutive. Each alphanumeric string separated by a period is considered a label. Labels must begin and end with an alphanumeric character and must be between 1-63 characters in length. The last label, the TLD (top level domain) must be between 2-24 alphabetic characters. The TLD label and hostname cannot be solely comprised of digits. The domain portion must consist of least one label followed by a period '.' then ending with the TLD label. Combining the hostname, followed by a period '.', followed by the domain gives the FQDN (fully qualified domain name), which may not exceed 253 characters in total length.
Error applying plan:
1 error(s) occurred:
* softlayer_virtual_guest.server1: Error creating virtual guest: softlayer-go: could not SoftLayer_Virtual_Guest#createObject, HTTP error code: '500'