Hi, I am trying out the new terraform provider for appwrite that was introduced a few weeks back. As a first step I wanted to import our existing databases into a terraform state. When I try to import columns of type "string" terraform detects a change and plans a recreation of the column.
I had an example here but the message got too long and I wasn't allowed to post. This is the example https://pastebin.com/XXjCFNVW
So the api tells me the column type is string but terraform interprets type = "string" as a change requiring recreation. For now I am testing in a dev environment but later when I import in prod recreating the column is not an option. Am I misunderstanding something here? I have tried all "similar" types (varchar, text, longtext, mediumtext) just to see if it would have an effect but all lead to the same outcome.
Example from the pastebin above:
curl -XGET -H 'X-Appwrite-Project: my-project-id' -H 'X-Appwrite-Key: my-appwrite-key' 'https://my-appwrite-host.org/v1/tablesdb/my_db/tables/my_table/columns/user_id'
returns
{
"key": "user_id",
"type": "string",
"status": "available",
"error": "",
"required": true,
"array": false,
"$createdAt": "2025-10-29T14:19:10.427+00:00",
"$updatedAt": "2025-10-29T14:19:10.457+00:00",
"size": 128,
"default": null,
"encrypt": false
}
But trying to import this into terraform state like
resource "appwrite_tablesdb_column" "my_db_my_table_user_id" {
database_id = appwrite_tablesdb.my_db.id
table_id = appwrite_tablesdb_table.my_db_my_table.id
type = "string"
key = "user_id"
array = false
default = null
encrypt = false
required = true
size = 128
}
import {
to = appwrite_tablesdb_column.my_db_my_table_user_id
id = "my_db/my_table/user_id"
}
Returns the following change in the terraform plan
# appwrite_tablesdb_column.my_db_my_table_user_id must be replaced
# (imported from "my_db/my_table/user_id")
# Warning: this will destroy the imported resource
-/+ resource "appwrite_tablesdb_column" "my_db_my_table_user_id" {
array = false
~ created_at = "2025-10-29T14:19:10.427+00:00" -> (known after apply)
database_id = "my_db"
encrypt = false
key = "user_id"
~ project_id = "my-project-id" -> (known after apply)
required = true
size = 128
table_id = "my_table"
+ type = "string" # forces replacement
~ updated_at = "2025-10-29T14:19:10.457+00:00" -> (known after apply)
}
Recommended threads
- TOO_MANY_REDIRECTS after temporarily ena...
I am losing my mind over this, I enabled this setting because I was having issues with sites not making links with https. I enabled it, ran into issues, so I di...
- listRows result parsing issue
I'm using Appwrite Dart SDK "24.2.0". When I perform a listRows call in dart, I have this reponse in JSON: in " Future<models.RowList> listRows()" { "total" :...
- Index for combination of columns
How am i suppposed to apply index so that combination of two columns alwasy remain unique in appwrite table though console