render-oss / terraform-provider-render

Source code for the official Render Terraform provider
40 stars 4 forks source link

Auto-deploy prevents successful initial service creation with linked environments #11

Closed extronics closed 3 months ago

extronics commented 4 months ago

I'm creating webservices with linked environment groups. When i do the first terraform apply the service creation fails because the environment link is created only after the webservice is created (because it needs the service id) but the webservice creation waits for the first deployment to succeed (which obviously fails because it's missing the linked environment variables).

A subsequent terraform apply always tries to re-create the service (because it's marked as tainted after the first failure) so i'm basically stuck there.

I can mitigate this by manually terraform state rm the service and re-import it with terraform import (because it's created successfully on render). Then another terraform apply also creates the environment link which allows for successful deployments. But i guess that's not how it's supposed to work :)

I'd suggest to not wait for deployment results when creating a webservice.

jakemalachowski commented 3 months ago

Thanks for the report @extronics. v0.2.0 of the provider no longer waits for a successful deploy by default when creating services, which should prevent this issue.