-
Notifications
You must be signed in to change notification settings - Fork 318
Expand file tree
/
Copy path+page.markdoc
More file actions
81 lines (62 loc) · 3.69 KB
/
+page.markdoc
File metadata and controls
81 lines (62 loc) · 3.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
---
layout: article
title: Configuration
description: Configure the Appwrite Terraform provider for Cloud or Community Edition using endpoints, API keys, and optional environment variables.
---
The Appwrite provider is published as `appwrite/appwrite` on the [Terraform Registry](https://registry.terraform.io/providers/appwrite/appwrite/latest). The registry hosts **generated reference docs** for the provider and every resource and data source: [latest docs](https://registry.terraform.io/providers/appwrite/appwrite/latest/docs). Full examples and attribute tables also live in the [provider repository](https://github.com/appwrite/terraform-provider-appwrite).
# Terraform block {% #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](https://registry.terraform.io/providers/appwrite/appwrite/latest).
```hcl
terraform {
required_providers {
appwrite = {
source = "appwrite/appwrite"
}
}
}
```
# Appwrite Cloud {% #appwrite-cloud %}
Replace `<REGION>` with your project’s region subdomain (see [Regions](/docs/products/network/regions)).
```hcl
provider "appwrite" {
endpoint = "https://<REGION>.cloud.appwrite.io/v1"
project_id = "project-id"
api_key = "api-key"
}
```
# Community Edition {% #community-edition %}
For self-hosted Appwrite, 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):
```hcl
provider "appwrite" {
endpoint = "https://appwrite-instance.com/v1"
project_id = "project-id"
api_key = "api-key"
self_signed = true
}
```
# Environment variables {% #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.
| Provider argument | Environment variable | Required | Description |
|-------------|------------------------|----------|-------------|
| `endpoint` | `APPWRITE_ENDPOINT` | yes | Appwrite API endpoint |
| `project_id` | `APPWRITE_PROJECT_ID` | yes | Project ID |
| `api_key` | `APPWRITE_API_KEY` | yes | API key with permissions for the resources you manage |
| `self_signed` | - | no | Accept self-signed TLS certificates (Community Edition) |
# API keys {% #api-keys %}
Use a key with the scopes required for the resources you manage (for example databases, storage, and messaging). Follow the principle of least privilege and rotate keys stored outside Terraform.
# Related {% #related %}
- [Databases](/docs/tooling/terraform/resources/databases) - databases, tables, columns, indexes, and rows
- [Storage](/docs/tooling/terraform/resources/storage) - buckets and file uploads
- [Functions](/docs/tooling/terraform/resources/functions) - serverless functions and environment variables
- [Sites](/docs/tooling/terraform/resources/sites) - hosted frontends and environment variables
- [Auth](/docs/tooling/terraform/resources/auth) - users and teams
- [Messaging](/docs/tooling/terraform/resources/messaging) - providers, topics, and subscribers
- [Webhooks](/docs/tooling/terraform/resources/webhooks) - event-driven HTTP callbacks
- [Backup policies](/docs/tooling/terraform/resources/backup-policies) - scheduled backups
- [Self-hosting](/docs/advanced/self-hosting) - install and run the Appwrite server (not the same as configuring project resources with this provider)