TritonDataCenter / terraform-provider-triton

Terraform Joyent Triton provider
https://www.terraform.io/docs/providers/triton/
Mozilla Public License 2.0
15 stars 24 forks source link

Support handling failed instances on create #10

Closed jwreagor closed 7 years ago

jwreagor commented 7 years ago

This patch fixes the issue in #1 by handling the "failed" state during instance create and was especially evident during failed provisioning on private cloud. This patch prevents Terraform from writing a failed instance to its state file and returns the following error to the user.

Error applying plan:

1 error(s) occurred:

* triton_machine.test: 1 error(s) occurred:

* triton_machine.test: instance creation failed: failed

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.
jen20 commented 7 years ago

The only thing I would potentially change here is the commit message to include the resource name as a prefix (now the providers are split out) and to fit a meaningful description in 72 characters for the git shortlog.

jwreagor commented 7 years ago

@jen20 Updated the commit message, definitely more descriptive.