-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata-source.tf
More file actions
46 lines (42 loc) · 1.19 KB
/
data-source.tf
File metadata and controls
46 lines (42 loc) · 1.19 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
# Look up an identity schema by its API-assigned ID
data "ory_identity_schema" "customer" {
id = "abc123def456..."
}
output "schema_content" {
value = data.ory_identity_schema.customer.schema
}
# Or reference the ID from a resource
resource "ory_identity_schema" "employee" {
schema_id = "employee"
schema = jsonencode({
"$id" = "https://example.com/employee.schema.json"
"$schema" = "http://json-schema.org/draft-07/schema#"
title = "Employee"
type = "object"
properties = {
traits = {
type = "object"
properties = {
email = {
type = "string"
format = "email"
"ory.sh/kratos" = {
credentials = { password = { identifier = true } }
verification = { via = "email" }
recovery = { via = "email" }
}
}
}
required = ["email"]
}
}
})
}
data "ory_identity_schema" "employee" {
id = ory_identity_schema.employee.id
}
# Look up a schema during project bootstrap (no project_slug/project_api_key needed)
data "ory_identity_schema" "bootstrap" {
id = "preset://username"
project_id = "your-project-uuid"
}