civo / terraform-provider-civo

Terraform Civo provider
https://www.civo.com
Mozilla Public License 2.0
65 stars 51 forks source link

fix #234 : prevent resource creation retries if it already exists #241

Closed Praveen005 closed 1 week ago

Praveen005 commented 1 week ago

This change addresses the issue of retries in #234 , which was causing the users to wait for a longer time.

Now in a similar event of re-creation of resources with existing names, the user will get an appropriate error message immediately, prompting them to take corrective measure.

Key Changes:

Immediate Error on Duplicate Names: Updated resourceInstanceCreate() in instances/resource_instance.go and resourceNetworkCreate() in network/resource_network.go to perform pre-creation checks. These checks identify existing instances or networks with the same name(hostname/label), resulting in an immediate error message instead of retrying until timeout.

Did I check other resources for similar issues?

Yes, I did check. only Instance and Network resources are being retried upon failing a successful creation.