Skip to content

Commit dade9fa

Browse files
Benjamin Ritterl0wl3vel
authored andcommitted
feat: add folder role assignment resource
Signed-off-by: Benjamin Ritter <benjamin.ritter@stackit.cloud>
1 parent 81e8d48 commit dade9fa

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "stackit_authorization_folder_role_assignment Resource - stackit"
4+
subcategory: ""
5+
description: |-
6+
folder Role Assignment resource schema.
7+
~> This resource is part of the iam experiment and is likely going to undergo significant changes or be removed in the future. Use it at your own discretion.
8+
---
9+
10+
# stackit_authorization_folder_role_assignment (Resource)
11+
12+
folder Role Assignment resource schema.
13+
14+
~> This resource is part of the iam experiment and is likely going to undergo significant changes or be removed in the future. Use it at your own discretion.
15+
16+
## Example Usage
17+
18+
```terraform
19+
resource "stackit_authorization_folder_role_assignment" "example" {
20+
resource_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
21+
role = "owner"
22+
subject = "john.doe@stackit.cloud"
23+
}
24+
25+
# Only use the import statement, if you want to import an existing folder role assignment
26+
import {
27+
to = stackit_authorization_folder_role_assignment.import-example
28+
id = "${var.folder_id},${var.folder_role_assignment_role},${var.folder_role_assignment_subject}"
29+
}
30+
```
31+
32+
<!-- schema generated by tfplugindocs -->
33+
## Schema
34+
35+
### Required
36+
37+
- `resource_id` (String) folder Resource to assign the role to.
38+
- `role` (String) Role to be assigned
39+
- `subject` (String) Identifier of user, service account or client. Usually email address or name in case of clients
40+
41+
### Read-Only
42+
43+
- `id` (String) Terraform's internal resource identifier. It is structured as "[resource_id],[role],[subject]".
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
resource "stackit_authorization_folder_role_assignment" "example" {
2+
resource_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
3+
role = "owner"
4+
subject = "john.doe@stackit.cloud"
5+
}
6+
7+
# Only use the import statement, if you want to import an existing folder role assignment
8+
import {
9+
to = stackit_authorization_folder_role_assignment.import-example
10+
id = "${var.folder_id},${var.folder_role_assignment_role},${var.folder_role_assignment_subject}"
11+
}

stackit/internal/services/authorization/roleassignments/resource.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import (
3030
var roleTargets = []string{
3131
"project",
3232
"organization",
33+
"folder",
3334
}
3435

3536
// Ensure the implementation satisfies the expected interfaces.

0 commit comments

Comments
 (0)