Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resource Importability #6

Closed
gberche-orange opened this issue Dec 11, 2017 · 1 comment
Closed

Resource Importability #6

gberche-orange opened this issue Dec 11, 2017 · 1 comment

Comments

@gberche-orange
Copy link
Collaborator

Support for terraform import would help TF-CF adoption when existing infrastructure are already created and need to be preserved, and start being managed by TF.

A workaround currently applied is to manually craft the corresponding tfstate file entries, which might be tedious and error prone.

Related tf documentation:

Importeability would be useful for all resources. We have immediately use cases for the following imports:

  • org
  • space
  • service broker, service access
  • domain
  • asg
ArthurHlt added a commit that referenced this issue Jan 15, 2018
Allow usage of command `import`, see explanation here: https://www.terraform.io/docs/import/usage.html

This permit also to do migration from orange-cloudfoundry/terraform-provider-cloudfoundry to terraform-providers/terraform-provider-cf described as follow:
* manually convert the config file from the `terraform-provider-cloudfoundry` resource to `terraform-provider-cf` resources. This can be made easier through IDE completion, see #4
* import CF resources into TF state. For each resource type:
   * Identify current resources and their ids, e.g. ``terraform state list | grep cloudfoundry_domain | xargs -n 1 terraform state show ``
   * Import the resource in TF state (manually for through upcoming [importeability support in terraform-provider-cf](#6)
   * Remove the `terraform-provider-cloudfoundry` resource from tfstate e.g. ``terraform state list | grep cloudfoundry_domain | xargs -n 1 terraform state remove ``
ArthurHlt added a commit that referenced this issue Jan 18, 2018
Allow usage of command `import`, see explanation here: https://www.terraform.io/docs/import/usage.html

This permit also to do migration from orange-cloudfoundry/terraform-provider-cloudfoundry to terraform-providers/terraform-provider-cf described as follow:
* manually convert the config file from the `terraform-provider-cloudfoundry` resource to `terraform-provider-cf` resources. This can be made easier through IDE completion, see #4
* import CF resources into TF state. For each resource type:
   * Identify current resources and their ids, e.g. ``terraform state list | grep cloudfoundry_domain | xargs -n 1 terraform state show ``
   * Import the resource in TF state (manually for through upcoming [importeability support in terraform-provider-cf](#6)
   * Remove the `terraform-provider-cloudfoundry` resource from tfstate e.g. ``terraform state list | grep cloudfoundry_domain | xargs -n 1 terraform state remove ``
@ArthurHlt
Copy link
Member

importability has been added in dev branch, will be available in next release.

loafoe pushed a commit that referenced this issue Jan 30, 2024
…9a5+incompatible (#549)

This version of cloudfoundry-cli fixes bugs occuring when using some specifics
ressources such as isolation segments.

(See [ccv3.Client : replace usages of newHTTPRequet when possible #6](cloudfoundry-community/cloudfoundry-cli#6))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants