Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: User resource #70

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,5 @@ jobs:
check-latest: true
- uses: golangci/golangci-lint-action@a4f60bb28d35aeee14e6880718e0c85ff1882e64 # v6.0.1
with:
version: v1.59
version: v1.62
args: --timeout=10m
4 changes: 2 additions & 2 deletions docs/resources/group_member.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ GroupMember resource

### Required

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

### Read-Only

Expand Down
1 change: 1 addition & 0 deletions docs/resources/oidc_provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ description: |-

### Optional

- `auth_method` (String)
- `description` (String) Description of this OIDC provider.
- `redirect_uris` (Set of String)

Expand Down
25 changes: 25 additions & 0 deletions docs/resources/user.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "plural_user Resource - terraform-provider-plural"
subcategory: ""
description: |-
user resource
---

# plural_user (Resource)

user resource



<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `email` (String) Email address of this user.
- `name` (String) Name of this user.

### Read-Only

- `id` (String) Internal identifier of this user.
53 changes: 34 additions & 19 deletions example/user/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,44 @@ provider "plural" {
use_cli = true
}

data "plural_config" "config" {}
# data "plural_config" "config" {}
#
# data "plural_user" "user" {
# email = "[email protected]"
# }

data "plural_user" "user" {
email = "[email protected]"
resource "plural_user" "spiderman" {
name = "Peter Parker"
email = "[email protected]"
}

data "plural_group" "group" {
name = "team"
# data "plural_group" "avengers" {
# name = "avengers"
# }

resource "plural_group" "avengers" {
name = "avengers"
description = "avengers group"
}

resource "plural_group" "test" {
name = "test"
description = "test group"
resource "plural_group_member" "spiderman" {
user_id = plural_user.spiderman.id
group_id = plural_group.avengers.id
}

resource "plural_rbac" "rbac" {
service_id = "624bff88-05e3-45f6-bc3b-44708594e28e"
bindings = {
read = [{
user_id = data.plural_user.user.id
}]
write = [{
user_id = data.plural_user.user.id
}]
}
}
resource "plural_group_member" "duplicate" {
user_id = plural_user.spiderman.id
group_id = plural_group.avengers.id
}

# resource "plural_rbac" "rbac" {
# service_id = "624bff88-05e3-45f6-bc3b-44708594e28e"
# bindings = {
# read = [{
# user_id = data.plural_user.user.id
# }]
# write = [{
# user_id = data.plural_user.user.id
# }]
# }
# }
Loading