DimensionDataResearch / terraform-provider-ddcloud

Terraform provider for Dimension Data cloud compute.
MIT License
16 stars 13 forks source link

Creating ip_address_list using complex example fails #72

Closed mgoldsmi closed 7 years ago

mgoldsmi commented 7 years ago

When creating an ip_address_list using the complex example in the documentation (https://github.com/DimensionDataResearch/dd-cloud-compute-terraform/blob/development/v1.2/docs/resource_types/address_list.md) fails with status code 400 (INVALID_INPUT_DATA) error.

ddcloud_address_list.test_list: Creating... address.#: "" => "3" address.0.begin: "" => "192.168.1.1" address.1.begin: "" => "10.0.1.15" address.1.end: "" => "10.0.1.20" address.2.network: "" => "10.15.7.0" address.2.prefix_size: "" => "24" ip_version: "" => "IPv4" name: "" => "TestAddresses" networkdomain: "" => "ebbd338f-a965-4106-8fa6-8e0ecbdcc1a3" Error applying plan:

1 error(s) occurred:

Looking at the log files, I see that the request generated does not include any information from the address maps:

2016/12/06 17:50:30 [DEBUG] plugin: terraform-provider-ddcloud: 2016/12/06 17:50:30 Invoking 'POST' request to 'https://api-au.dimensiondata.com/caas/2.2/63255a5a-622b-42a4-850e-56a4c3e7e00e/network/createIpAddressList'... 2016/12/06 17:50:30 [DEBUG] plugin: terraform-provider-ddcloud: 2016/12/06 17:50:30 Request body: '{"name":"TestAddresses","description":"","ipVersion":"IPv4","networkDomainId":"ebbd338f-a965-4106-8fa6-8e0ecbdcc1a3","ipAddress":null," childIpAddressListId":null}'

Version information

$ terraform --version Terraform v0.7.13

$ terraform-provider-ddcloud --version terraform-provider-ddcloud v1.2.0-alpha1 (33515c8e674a81765f2c4cabff55d23f11365ebc)

$ uname -a Linux cxs-de-mgmt01.cxlab.local 3.10.0-327.36.3.el7.x86_64 #1 SMP Thu Oct 20 04:56:07 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux

tintoy commented 7 years ago

Thanks for the detailed report! Sorry for the inconvenience - I'll look into this ASAP.

tintoy commented 7 years ago

Hi @mgoldsmi - I've found and fixed the problem (thanks for reporting it). I'll get a new build out shortly that includes this fix.

tintoy commented 7 years ago

Ok, should be fixed in v1.2.0-alpha3.

I've also updated our acceptance-test suite to ensure that won't happen again.

mgoldsmi commented 7 years ago

Thanks for the quick turn around. Can now create dd_address_list with network address and mask. However the #v1.2.0-alpha3 build appears to have reverted the new ddcloud_server.image (#66) change.

$ terraform plan There are warnings and/or errors related to your configuration. Please fix these before continuing.

Errors:

$ terraform --version Terraform v0.7.13

$ terraform-provider-ddcloud --version terraform-provider-ddcloud v1.2.0-alpha3 (7a1232cb1a389036c8bc9ffe76244cd3d048124c)

tintoy commented 7 years ago

Actually that's correct - it is a single value, let me check the docs to see if they are up to date...

tintoy commented 7 years ago

Sorry, I think you may have been caught out by an early change we made where the image was of the form image { name = "xxx" type="yyy" } but after user feedback we simplified it to just image = "xxx" (and optionally image_type="yyy").

If you want a working example, take a look here.

tintoy commented 7 years ago

(again, sorry for the confusion / inconvenience - we're pretty sure we have the final schema locked down now so there shouldn't be any further breaking changes)

mgoldsmi commented 7 years ago

All good. Correction is working for me.