I am looking to make improvements in the Google Provider, specifically the resource google_project (https://github.com/terraform-providers/terraform-provider-google/blob/master/google/resource_google_project.go).
Currently, the google_project resource creates a project and also does some additional functions such as link a billing account and deleting the default network.
The problem occurs when the project itself is created properly, but a later call such as linking billing account fails. The resource becomes ‘tainted’ and forces a delete and recreate on the next run. Since projects have a 30 day recovery period, the re-create fails and thus the user ends up in a limbo.
I am looking to add partial state support here. Essentially what I would like is to partially commit the project to state. If there is a failure with the billing account link then we return an error. On retry, I would like to skip past the project creation and retry billing account link. Once billing account succeeds we add the billing account field to the state, and continue on.
Can partial state help here and do you have any examples for reference (on resource creation, not update).