Docs
Skip to content

Tooling

Configuration_

Configure the Appwrite Terraform provider for Cloud or Community Edition using endpoints, API keys, and optional environment variables.

3 min read

Raw

The Appwrite provider is published as appwrite/appwrite on the Terraform Registry. The registry hosts generated reference docs for the provider and every resource and data source: latest docs. Full examples and attribute tables also live in the provider repository.

Terraform block

Declare the provider source in a terraform block. You can add a version constraint when you want to pin a release; see published versions on the registry provider page.

Terraform
terraform {
required_providers {
appwrite = {
source = "appwrite/appwrite"
}
}
}

Appwrite Cloud

Replace <REGION> with your project’s region subdomain (see Regions).

Terraform
provider "appwrite" {
endpoint = "https://<REGION>.cloud.appwrite.io/v1"
project_id = "project-id"
api_key = "api-key"
}

Community Edition

For self-hosted Appwrite instances, set your instance URL and enable self_signed when you use a certificate that is not trusted by default (common in local or internal deployments):

Terraform
provider "appwrite" {
endpoint = "https://appwrite-instance.com/v1"
project_id = "project-id"
api_key = "api-key"
self_signed = true
}

Environment variables

You can supply credentials via environment variables instead of hard-coding them in .tf files (recommended for CI and local development):

Bash
export APPWRITE_ENDPOINT="https://<REGION>.cloud.appwrite.io/v1"
export APPWRITE_PROJECT_ID="project-id"
export APPWRITE_API_KEY="api-key"

When an environment variable is set, the matching provider argument does not need to appear in the configuration. Values set directly in the provider block take precedence over the environment.

Provider argumentEnvironment variableRequiredDescription
endpointAPPWRITE_ENDPOINTyesAppwrite API endpoint
project_idAPPWRITE_PROJECT_IDnoDefault project ID for resources (omit if you set project_id on each resource)
api_keyAPPWRITE_API_KEYyesAPI key with permissions for the resources you manage
self_signed-noAccept self-signed TLS certificates (Community Edition)
http_timeout_seconds-noHow long to wait for a single API response. Defaults to 120

Request timeouts

http_timeout_seconds sets how long the provider waits for a single API response before giving up. It defaults to 120 seconds.

Terraform
provider "appwrite" {
endpoint = "https://<REGION>.cloud.appwrite.io/v1"
project_id = "project-id"
api_key = "api-key"
http_timeout_seconds = 180
}

Some requests do their work inline rather than in the background. Updating a connection pooler restarts the sidecar, for example. A short timeout can then make Terraform report a failure for work the server already applied. This setting is separate from the waits the provider performs itself. Provisioning a dedicated database or building an index polls until the resource settles, and this timeout does not bound that.

Project scoping

You can set project_id on the provider as the default for all resources, or set project_id on individual resources when one Terraform configuration manages multiple Appwrite projects.

API keys

Use a key with the scopes required for the resources you manage (for example TablesDB, Storage, Messaging, Functions, Sites, Auth, webhooks, and backups). Follow the principle of least privilege and rotate keys stored outside Terraform.

Sensitive state

Dedicated databases export connection_string and connection_password as sensitive read-only attributes, and branches export their own credentials. Terraform writes these to state, so use a remote backend with encryption and access control, and mark any output that carries them sensitive = true.

Was this page helpful?

Share what worked or what we should fix. Once approved, our agents automatically apply suggested updates to the docs.