Closed linkages closed 4 years ago
@linkages I thought about it and the reason I did not replace the id in the state file from request to deployment id is because it will break the existing deployment resources managed by the provider.
I have introduced a data source for vra7_deployment resource. It accepts deployment id. The request id can be fetched from the state file after you get the deployment from the data source. Then use the request id to import and manage your deployment. Here is the documentation and example. https://github.com/terraform-providers/terraform-provider-vra7/blob/master/website/docs/d/vra7_deployment.html.markdown
Let me know if this works for you.
Thanks, Prativa
I thought the point of import
was to bring in a machine(s) that had not been created by Terraform, so it could be managed by TF. Do i read this right, that you can only import entities that have previously been created by Terraform?
@mcascone Yes, you can import the deployment even if has not been created by Terraform. To import any deployment, you need the catalog item request id. But @linkages has mentioned that they do not have the request id but only have the deployment id. In such a case, the request id can be fetched through a vra7_deployment data source. Once the data source is created, go to the state file and fetch the request id. This request id can then be used to import the deployment. Here is the documentation and example. https://github.com/terraform-providers/terraform-provider-vra7/blob/master/website/docs/d/vra7_deployment.html.markdown
Thanks, Prativa
Hi @mcascone
Closing this issue as you can import any deployment irrespective of how it is created (through the terraform provider or vRA UI or API). The request id is required to do that.
vRA 7.x version Version: 7.5.0 (Build: 10053500) Terraform version 0.12 terraform-provider-vra7 plugin version 1.0.0
Describe the bug An accident was made in vRA and everyone's deployments were removed from their business groups. This was fixed by re-registering all deployments back with the appropriate business groups but there is a side effect of losing all the requests. Because of this, anyone that used terraform in the past to deploy catalog items, can no longer use terraform to maintain them since the request ids are gone.
I was wondering if there is a way to import a vra7_deployment by using the deployment id instead of the request id.