You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Shoutout to [Jason Hernandez](https://github.com/jasonhernandez) and the [Materialize](https://materialize.com/) team for creating the initial version of this provider! Also see [NOTICE.md](./NOTICE.md)
@@ -39,7 +39,7 @@ A Terraform provider for managing [Ory Network](https://www.ory.sh/) resources u
Copy file name to clipboardExpand all lines: docs/data-sources/project.md
+8-1Lines changed: 8 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,4 @@
1
1
---
2
-
# generated by https://github.com/hashicorp/terraform-plugin-docs
3
2
page_title: "ory_project Data Source - ory"
4
3
subcategory: ""
5
4
description: |-
@@ -10,6 +9,8 @@ description: |-
10
9
11
10
Fetches information about an Ory project.
12
11
12
+
This data source retrieves basic metadata about a project. It can look up the project configured in the provider, or a specific project by ID.
13
+
13
14
## Example Usage
14
15
15
16
```terraform
@@ -34,6 +35,12 @@ data "ory_project" "other" {
34
35
}
35
36
```
36
37
38
+
## ID Fallback Behavior
39
+
40
+
If `id` is not specified, the data source uses the `project_id` from the provider configuration. If neither is available, the read will fail with an error.
41
+
42
+
~> **Note:** This data source only returns basic project metadata (name, slug, state, workspace). It does not include the project's `environment`, `home_region`, or detailed configuration. Use `ory_project_config` to manage project settings.
Copy file name to clipboardExpand all lines: docs/resources/email_template.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,8 @@ description: |-
9
9
10
10
Manages an Ory Network email template.
11
11
12
+
Email templates use [Go template syntax](https://pkg.go.dev/text/template) for variable substitution. HTML bodies use `html/template` (auto-escaping) and plaintext bodies use `text/template`. [Sprig template functions](http://masterminds.github.io/sprig/) are available, except date, random, OS, and network functions.
13
+
12
14
## Template Types
13
15
14
16
| Template Type | UI Name | Description |
@@ -28,6 +30,31 @@ Manages an Ory Network email template.
28
30
29
31
**Note:** The "_invalid" templates are sent when a code has expired or is incorrect. The non-code variants (recovery_valid, verification_valid) are for legacy link-based flows.
30
32
33
+
## Template Variables
34
+
35
+
Each template type has access to different variables:
# generated by https://github.com/hashicorp/terraform-plugin-docs
3
2
page_title: "ory_identity Resource - ory"
4
3
subcategory: ""
5
4
description: |-
6
5
Manages an Ory Network identity (user).
7
-
Identities represent users in your application. Each identity has traits
8
-
(profile data) defined by an identity schema.
9
-
Required Provider Configuration
10
-
This resource requires the following provider configuration:
11
-
12
-
provider "ory" {
13
-
project_api_key = var.ory_project_api_key # or ORY_PROJECT_API_KEY env var
14
-
project_slug = var.ory_project_slug # or ORY_PROJECT_SLUG env var
15
-
}
16
-
17
-
Or via environment variables:
18
-
19
-
export ORY_PROJECT_API_KEY="ory_pat_..."
20
-
export ORY_PROJECT_SLUG="your-project-slug"
21
-
22
-
Schema ID
23
-
The schema_id attribute specifies which identity schema defines the structure of the identity's traits:
24
-
Use the default schema: Most projects have a default schema (often named default)Reference a Terraform-managed schema: ory_identity_schema.customer.idUse a preset (must be enabled first): preset://email or preset://username
25
-
~> Note: Preset schemas must be enabled in your Ory project before use. If you get a 500 error with a preset, it may not be enabled. Check your project's identity schema settings or use a custom schema.
26
-
Example Usage
27
-
28
-
# Identity using the default schema
29
-
resource "ory_identity" "user" {
30
-
schema_id = "default"
31
-
32
-
traits = jsonencode({
33
-
email = "user@example.com"
34
-
})
35
-
}
36
-
37
-
# Identity with password
38
-
resource "ory_identity" "user_with_password" {
39
-
schema_id = "default"
40
-
41
-
traits = jsonencode({
42
-
email = "user@example.com"
43
-
})
44
-
45
-
password = var.user_password # Use a variable, never hardcode
46
-
47
-
metadata_public = jsonencode({
48
-
role = "user"
49
-
})
50
-
}
51
-
52
-
# Identity using a custom Terraform-managed schema
53
-
resource "ory_identity" "customer" {
54
-
schema_id = ory_identity_schema.customer.id
55
-
56
-
traits = jsonencode({
57
-
email = "customer@example.com"
58
-
})
59
-
}
60
-
61
-
Import
62
-
Identities can be imported using their ID:
63
-
64
-
terraform import ory_identity.user <identity-id>
65
-
66
-
Note: If the identity is deleted outside of Terraform (e.g., via UI or API),
67
-
the next terraform plan will detect this and remove it from state.
68
6
---
69
7
70
8
# ory_identity (Resource)
71
9
72
10
Manages an Ory Network identity (user).
73
11
74
-
Identities represent users in your application. Each identity has traits
75
-
(profile data) defined by an identity schema.
12
+
Identities represent users in your application. Each identity has traits (profile data) defined by an identity schema.
The `schema_id` attribute specifies which identity schema defines the structure of the identity's traits:
34
+
The `schema_id` attribute specifies which identity schema defines the structure of the identity's traits.
98
35
99
-
-**Use the default schema**: Most projects have a default schema (often named `default`)
100
-
-**Reference a Terraform-managed schema**: `ory_identity_schema.customer.id`
101
-
-**Use a preset** (must be enabled first): `preset://email` or `preset://username`
36
+
~> **Important:** The value of `schema_id` must match a schema that exists in your project. Using a schema ID that doesn't exist (including `"default"` on projects that don't have a schema named "default") will result in an HTTP 500 error.
102
37
103
-
~> **Note:** Preset schemas must be enabled in your Ory project before use. If you get a 500 error with a preset, it may not be enabled. Check your project's identity schema settings or use a custom schema.
38
+
**How to find your project's schema IDs:**
104
39
105
-
## Example Usage
106
-
107
-
```hcl
108
-
# Identity using the default schema
109
-
resource "ory_identity" "user" {
110
-
schema_id = "default"
111
-
112
-
traits = jsonencode({
113
-
email = "user@example.com"
114
-
})
115
-
}
116
-
117
-
# Identity with password
118
-
resource "ory_identity" "user_with_password" {
119
-
schema_id = "default"
120
-
121
-
traits = jsonencode({
122
-
email = "user@example.com"
123
-
})
124
-
125
-
password = var.user_password # Use a variable, never hardcode
126
-
127
-
metadata_public = jsonencode({
128
-
role = "user"
129
-
})
130
-
}
131
-
132
-
# Identity using a custom Terraform-managed schema
133
-
resource "ory_identity" "customer" {
134
-
schema_id = ory_identity_schema.customer.id
135
-
136
-
traits = jsonencode({
137
-
email = "customer@example.com"
138
-
})
139
-
}
140
-
```
40
+
1.**Ory Console:** Go to your project > Identity Schema to see configured schemas
41
+
2.**API:**`GET /projects/<project-id>` and check `services.identity.config.identity.schemas`
42
+
3.**Terraform:** Use `ory_identity_schema` resources and reference their IDs
141
43
142
-
## Import
44
+
**Common schema ID values:**
143
45
144
-
Identities can be imported using their ID:
145
-
146
-
```shell
147
-
terraform import ory_identity.user <identity-id>
148
-
```
149
-
150
-
**Note**: If the identity is deleted outside of Terraform (e.g., via UI or API),
151
-
the next `terraform plan` will detect this and remove it from state.
46
+
| Schema ID | Description |
47
+
|-----------|-------------|
48
+
|`preset://email`| Built-in email schema (most common default for new projects) |
49
+
|`preset://username`| Built-in username schema |
50
+
|`default`| Only valid if your project has a schema explicitly named "default" |
51
+
| Custom IDs | e.g., `customer_v1` - if created via `ory_identity_schema` or Console |
152
52
153
53
## Example Usage
154
54
@@ -196,6 +96,21 @@ variable "user_password" {
196
96
}
197
97
```
198
98
99
+
## Important Behaviors
100
+
101
+
-**Password is write-only:** The `password` attribute is not returned on read and cannot be imported. It is only used during creation and updates.
102
+
-**External deletion detection:** If an identity is deleted outside of Terraform (via UI or API), the next `terraform plan` will detect the 404 and remove it from state automatically.
103
+
-**Traits must match schema:** The JSON structure of `traits` must match the identity schema definition. Mismatched traits will cause API errors.
104
+
-**Metadata visibility:**`metadata_public` is visible to the identity owner. `metadata_admin` is only visible via the admin API and is marked sensitive in Terraform.
105
+
106
+
## Import
107
+
108
+
```shell
109
+
terraform import ory_identity.user <identity-id>
110
+
```
111
+
112
+
~> **Note:** Imported identities will not have `password` in state since it is write-only.
0 commit comments