diff --git a/pkg/resources/database/resource_user_mysql.go b/pkg/resources/database/resource_user_mysql.go index 8d578415..88334753 100644 --- a/pkg/resources/database/resource_user_mysql.go +++ b/pkg/resources/database/resource_user_mysql.go @@ -233,7 +233,7 @@ func (data *MysqlUserResourceModel) UpdateResource(ctx context.Context, client * } func (data *MysqlUserResourceModel) WaitForService(ctx context.Context, client *exoscale.Client, diagnostics *diag.Diagnostics) { - _, err := waitForDBAASServiceReadyForUsers(ctx, client.GetDBAASServiceMysql, data.Service.ValueString(), func(t *exoscale.DBAASServiceMysql) bool { return len(t.Users) > 0 }) + _, err := waitForDBAASServiceReadyForUsers(ctx, client.GetDBAASServiceMysql, data.Service.ValueString(), func(t *exoscale.DBAASServiceMysql) bool { return t.State == exoscale.EnumServiceStateRunning }) if err != nil { diagnostics.AddError("Client Error", fmt.Sprintf("Unable to read Database service MySQL %s", err.Error())) }