Skip to content

Commit 9da29e5

Browse files
authored
Merge pull request #4 from uptick/sec-60/add-resource-instance-resource
fix: split resource_instance into separate fields and fix __user: pre…
2 parents 76752cc + c8fcbef commit 9da29e5

27 files changed

Lines changed: 204 additions & 87 deletions

File tree

docs/resources/permitio_condition_set_rule.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,12 @@ See [our documentation](https://api.permit.io/v2/redoc#tag/Condition-Set-Rules)
2727
- `id` (String) Unique id of the condition set rule
2828
- `organization_id` (String) Unique id of the organization that owns the condition set rule
2929
- `project_id` (String) Unique id of the project that owns the condition set rule
30+
31+
## Import
32+
33+
Import is supported using the following syntax:
34+
35+
```shell
36+
# Import a condition set rule using the format: user_set,permission,resource_set
37+
terraform import permitio_condition_set_rule.example admins,document:read,sensitive-docs
38+
```

docs/resources/permitio_group_resource_instance_role_assignment.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,12 @@ Assigns a role to a group on a specific resource instance within a tenant. This
2626
### Read-Only
2727

2828
- `id` (String) Unique identifier of the role assignment
29+
30+
## Import
31+
32+
Import is supported using the following syntax:
33+
34+
```shell
35+
# Import a group resource instance role assignment using the format: group:role:resource:resource_instance:tenant
36+
terraform import permitio_group_resource_instance_role_assignment.example engineering:viewer:document:doc-1:default
37+
```

docs/resources/permitio_resource_instance.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,12 @@ Manages a Permit.io resource instance. Resource instances represent specific obj
3434
- `organization_id` (String) The organization ID. This is a unique identifier for the organization.
3535
- `project_id` (String) The project ID. This is a unique identifier for the project.
3636
- `resource_id` (String) The unique resource type ID.
37+
38+
## Import
39+
40+
Import is supported using the following syntax:
41+
42+
```shell
43+
# Import a resource instance using the format: resource_key:instance_key
44+
terraform import permitio_resource_instance.example document:doc-1
45+
```

docs/resources/permitio_resource_instance_role_assignment.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ Assigns a role to a user on a specific resource instance within a tenant. This i
1717

1818
### Required
1919

20-
- `resource_instance` (String) Resource instance identifier (e.g., 'document:doc-123' or 'project:proj-456')
20+
- `resource` (String) Resource type (e.g., 'workspace', 'document')
21+
- `resource_instance` (String) Resource instance key (e.g., 'ws-123', 'doc-456')
2122
- `role` (String) Role key to assign
2223
- `tenant` (String) Tenant key for scoped assignment
2324
- `user` (String) User key to assign the role to
@@ -29,4 +30,12 @@ Assigns a role to a user on a specific resource instance within a tenant. This i
2930
- `id` (String) Unique identifier of the role assignment
3031
- `organization_id` (String)
3132
- `project_id` (String)
32-
- `updated_at` (String)
33+
34+
## Import
35+
36+
Import is supported using the following syntax:
37+
38+
```shell
39+
# Import a resource instance role assignment using the format: user:role:resource:resource_instance:tenant
40+
terraform import permitio_resource_instance_role_assignment.example john@example.com:viewer:document:doc-1:default
41+
```

docs/resources/permitio_role.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,15 @@ See [the documentation](https://api.permit.io/v2/redoc#tag/Resources/operation/c
3838
- `organization_id` (String) The organization ID. This is a unique identifier for the organization.
3939
- `project_id` (String) The project ID. This is a unique identifier for the project.
4040
- `resource_id` (String) The unique resource ID that the role belongs to.
41+
42+
## Import
43+
44+
Import is supported using the following syntax:
45+
46+
```shell
47+
# Import a top-level role using the format: role_key
48+
terraform import permitio_role.example admin
49+
50+
# Import a resource-level role using the format: resource_key:role_key
51+
terraform import permitio_role.example document:editor
52+
```

docs/resources/permitio_role_assignment.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,12 @@ Assigns a role to a user within a specific tenant.
2828
- `id` (String) Unique identifier of the role assignment
2929
- `organization_id` (String)
3030
- `project_id` (String)
31+
32+
## Import
33+
34+
Import is supported using the following syntax:
35+
36+
```shell
37+
# Import a role assignment using the format: user:role:tenant
38+
terraform import permitio_role_assignment.example john@example.com:admin:default
39+
```

docs/resources/permitio_tenant.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "permitio_tenant Resource - terraform-provider-permit-io"
4+
subcategory: ""
5+
description: |-
6+
Manages a Permit.io tenant. Tenants represent isolated groups or organizations within your application. See the documentation https://api.permit.io/v2/redoc#tag/Tenants for more information about tenants.
7+
---
8+
9+
# permitio_tenant (Resource)
10+
11+
Manages a Permit.io tenant. Tenants represent isolated groups or organizations within your application. See [the documentation](https://api.permit.io/v2/redoc#tag/Tenants) for more information about tenants.
12+
13+
14+
15+
<!-- schema generated by tfplugindocs -->
16+
## Schema
17+
18+
### Required
19+
20+
- `key` (String) The key. This is a unique identifier.
21+
- `name` (String) The name. This is a human-readable name for the object.
22+
23+
### Optional
24+
25+
- `attributes` (String) Arbitrary tenant attributes in JSON format that will be used to enforce attribute-based access control policies.
26+
- `description` (String) The description. This is a human-readable description for the object.
27+
- `updated_at` (String) The update timestamp. This is a timestamp for when the object was last updated.
28+
29+
### Read-Only
30+
31+
- `created_at` (String) The creation timestamp. This is a timestamp for when the object was created.
32+
- `environment_id` (String) The environment ID. This is a unique identifier for the environment.
33+
- `id` (String) The resource ID. This is a unique identifier for the resource.
34+
- `last_action_at` (String) Date and time when the tenant was last active (ISO_8601 format). In other words, this is the last time a permission check was done on a resource belonging to this tenant.
35+
- `organization_id` (String) The organization ID. This is a unique identifier for the organization.
36+
- `project_id` (String) The project ID. This is a unique identifier for the project.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Import a condition set rule using the format: user_set,permission,resource_set
2+
terraform import permitio_condition_set_rule.example admins,document:read,sensitive-docs
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Import a group resource instance role assignment using the format: group:role:resource:resource_instance:tenant
2+
terraform import permitio_group_resource_instance_role_assignment.example engineering:viewer:document:doc-1:default
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Import a resource instance using the format: resource_key:instance_key
2+
terraform import permitio_resource_instance.example document:doc-1

0 commit comments

Comments
 (0)