orange-cloudfoundry / terraform-provider-cloudfoundry

A terraform provider to manage a Cloud Foundry instance.
Apache License 2.0
31 stars 8 forks source link

Space resource should not remove externally provisionned associated security groups #23

Closed gberche-orange closed 7 years ago

gberche-orange commented 7 years ago

The following use-case is not supported by the space resource: it unbinds any extra security group associated with the space which was not specified in the cloudfoundry_space.sec_groups. It would be great if the security group unbinding could be restricted only to security group resources previously provisionned and bound by the terraform resource.

Use case: a space is provisionned with terraform-provider-cloudfoundry with an empty set of security groups. Then security groups are dynamically associated with this space by a 3rd party (such as https://github.com/orange-cloudfoundry/sec-group-broker-filter or anynines service guard) to enable consumption of service instances provisionned by application developers (outside of terraform)

During discussion @ArthurHlt mentionned a potential fix similar to https://github.com/orange-cloudfoundry/terraform-provider-cloudfoundry/commit/7a02e0b88497e2f90a29e63e4c2cefa35a38c484 (using tfstate as persistence engine for maintaining transient state during the terraform apply)

ArthurHlt commented 7 years ago

this is now fixed with the commit: https://github.com/orange-cloudfoundry/terraform-provider-cloudfoundry/commit/4d30999ff13a8b364ef58a58c554ec80f27fe249