Skip to content

Commit 3c796d1

Browse files
authored
Merge pull request #70 from pluralsh/marcin/prod-2930-add-plural_user-resource
feat: User resource
2 parents a82e56c + 711e732 commit 3c796d1

File tree

9 files changed

+473
-331
lines changed

9 files changed

+473
-331
lines changed

docs/resources/group_member.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ GroupMember resource
1717

1818
### Required
1919

20-
- `group_id` (String) group id for this group member.
21-
- `user_id` (String) user id for this group member.
20+
- `group_id` (String) Group ID for this group member.
21+
- `user_id` (String) User ID for this group member.
2222

2323
### Read-Only
2424

docs/resources/user.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "plural_user Resource - terraform-provider-plural"
4+
subcategory: ""
5+
description: |-
6+
user resource
7+
---
8+
9+
# plural_user (Resource)
10+
11+
user resource
12+
13+
14+
15+
<!-- schema generated by tfplugindocs -->
16+
## Schema
17+
18+
### Required
19+
20+
- `email` (String) Email address of this user.
21+
- `name` (String) Name of this user.
22+
23+
### Read-Only
24+
25+
- `id` (String) Internal identifier of this user.

example/user/main.tf

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,44 @@ provider "plural" {
1111
use_cli = true
1212
}
1313

14-
data "plural_config" "config" {}
14+
# data "plural_config" "config" {}
15+
#
16+
# data "plural_user" "user" {
17+
# email = "[email protected]"
18+
# }
1519

16-
data "plural_user" "user" {
17-
20+
resource "plural_user" "spiderman" {
21+
name = "Peter Parker"
22+
1823
}
1924

20-
data "plural_group" "group" {
21-
name = "team"
25+
# data "plural_group" "avengers" {
26+
# name = "avengers"
27+
# }
28+
29+
resource "plural_group" "avengers" {
30+
name = "avengers"
31+
description = "avengers group"
2232
}
2333

24-
resource "plural_group" "test" {
25-
name = "test"
26-
description = "test group"
34+
resource "plural_group_member" "spiderman" {
35+
user_id = plural_user.spiderman.id
36+
group_id = plural_group.avengers.id
2737
}
2838

29-
resource "plural_rbac" "rbac" {
30-
service_id = "624bff88-05e3-45f6-bc3b-44708594e28e"
31-
bindings = {
32-
read = [{
33-
user_id = data.plural_user.user.id
34-
}]
35-
write = [{
36-
user_id = data.plural_user.user.id
37-
}]
38-
}
39-
}
39+
resource "plural_group_member" "duplicate" {
40+
user_id = plural_user.spiderman.id
41+
group_id = plural_group.avengers.id
42+
}
43+
44+
# resource "plural_rbac" "rbac" {
45+
# service_id = "624bff88-05e3-45f6-bc3b-44708594e28e"
46+
# bindings = {
47+
# read = [{
48+
# user_id = data.plural_user.user.id
49+
# }]
50+
# write = [{
51+
# user_id = data.plural_user.user.id
52+
# }]
53+
# }
54+
# }

0 commit comments

Comments
 (0)