DimensionDataResearch / terraform-provider-ddcloud

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

Restore existing behaviour vlan attached_vlan_gateway_addressing #142

Closed adrianvolpe closed 4 years ago

adrianvolpe commented 4 years ago

We have an existing terraform plan built around the 7 August 2019 which I tried to create a new environment from today 6 December 2019 and the terraform apply failed to work with the error:

1 error(s) occurred:

* module.emr_environment.ddcloud_vlan.emr_vlan: 1 error(s) occurred:

* ddcloud_vlan.emr_vlan: Request to deploy VLAN 'EMR-DEV-1DCDEV' failed with status code 400 (INVALID_INPUT_DATA): ipv4GatewayAddress must be provided.

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.

After reading the documentation on this repository it is now compulsory to have the attribute attached_vlan_gateway_addressing with a value defined for a dd_cloud.vlan resource. This breaks all existing terraforms that do not include this now documented optional attribute.

Can the previous behaviour be reinstated if no option is specified.

Regards,

Adrian

samuelchong commented 4 years ago

Hi Adrian,

This features is introduced by request from some members of the group in order to used the detached vlan feature. Unfortunately, since CaaS API v2.8, we need to make an explicit choice between Detached VLANs and Attached VLANs when deploying VLAN.

Extract from CaaS API documentation: ... One of attachedVlan or detachedVlan must be provided. Each has a single child property described ... ... Any VLAN deployed through the CloudControl API prior to the release of API 2.8 is by default an Attached VLAN ...

Suggestion:

Let me know how it goes.

samuelchong commented 4 years ago

I may have a solution to make it backward compatible. I'm working on a new build now. Give me a day or two.

samuelchong commented 4 years ago

Fix available in terraform-provider-ddcloud v2.3.3. it's now backward compatible. if nothing is specified, it will default to Attached VLAN.