We are trying to run a custom preview-environment setup, we have been following the examples from github (here) but we have been having problems running terraform apply. It seems like the provider or the API is not taking into account that resources might have multiple states, I’m not sure what the state on the Terraform provider means exactly but it is definitely causing problems to us, any of the applications/database that we add with the state = "RUNNING" fail with the following error:
│ with qovery_database.preview_environment_redis_database,
│ on qovery.tf line 51, in resource "qovery_database" "preview_environment_redis_database":
│ 51: resource "qovery_database" "preview_environment_redis_database" {
│
│ Could not deploy database '479b76a7-437b-44e8-a009-d0938f9cb175',
│ unexpected error: 400 Bad Request - Specified action is not possible in
│ this state: Start Cannot start deployment while environment is in
│ WAITING_RUNNING state
If we make the resources with state = "STOPPED" we dont run into these issues. As we need these apps in the environment to be automatically RUNNING and even keep an order of dependencies like deploy db → deploy core-app. Is there anything we can do here, or do we need to run Terraform with state = "STOPPED" and then add a custom script on the github-action that triggers the Deploy action of each