Skip to content

Commit 388ab2b

Browse files
author
Markus Schwer
committed
feat(authorization): add custom role resources and data sources for folder and organization
1 parent 20dcaac commit 388ab2b

File tree

12 files changed

+643
-161
lines changed

12 files changed

+643
-161
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "stackit_authorization_folder_custom_role Data Source - stackit"
4+
subcategory: ""
5+
description: |-
6+
Custom Role resource schema.
7+
---
8+
9+
# stackit_authorization_folder_custom_role (Data Source)
10+
11+
Custom Role resource schema.
12+
13+
14+
15+
<!-- schema generated by tfplugindocs -->
16+
## Schema
17+
18+
### Required
19+
20+
- `resource_id` (String) Resource to add the custom role to.
21+
- `role_id` (String) The ID of the role.
22+
23+
### Read-Only
24+
25+
- `description` (String) A human readable description of the role.
26+
- `id` (String) Terraform's internal resource identifier. It is structured as "[resource_id],[role_id]".
27+
- `name` (String) Name of the role
28+
- `permissions` (List of String) Permissions for the role
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "stackit_authorization_organization_custom_role Data Source - stackit"
4+
subcategory: ""
5+
description: |-
6+
Custom Role resource schema.
7+
---
8+
9+
# stackit_authorization_organization_custom_role (Data Source)
10+
11+
Custom Role resource schema.
12+
13+
14+
15+
<!-- schema generated by tfplugindocs -->
16+
## Schema
17+
18+
### Required
19+
20+
- `resource_id` (String) Resource to add the custom role to.
21+
- `role_id` (String) The ID of the role.
22+
23+
### Read-Only
24+
25+
- `description` (String) A human readable description of the role.
26+
- `id` (String) Terraform's internal resource identifier. It is structured as "[resource_id],[role_id]".
27+
- `name` (String) Name of the role
28+
- `permissions` (List of String) Permissions for the role
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "stackit_authorization_folder_custom_role Resource - stackit"
4+
subcategory: ""
5+
description: |-
6+
Custom Role resource schema.
7+
---
8+
9+
# stackit_authorization_folder_custom_role (Resource)
10+
11+
Custom Role resource schema.
12+
13+
## Example Usage
14+
15+
```terraform
16+
resource "stackit_resourcemanager_folder" "example" {
17+
name = "example_folder"
18+
owner_email = "foo.bar@stackit.cloud"
19+
parent_container_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
20+
}
21+
22+
resource "stackit_authorization_folder_custom_role" "example" {
23+
resource_id = stackit_resourcemanager_folder.example.folder_id
24+
name = "my.custom.role"
25+
description = "Some description"
26+
permissions = [
27+
"iam.subject.get"
28+
]
29+
}
30+
31+
# Only use the import statement, if you want to import an existing custom role
32+
import {
33+
to = stackit_authorization_folder_custom_role.import-example
34+
id = "${var.folder_id},${var.custom_role_id}"
35+
}
36+
```
37+
38+
<!-- schema generated by tfplugindocs -->
39+
## Schema
40+
41+
### Required
42+
43+
- `description` (String) A human readable description of the role.
44+
- `name` (String) Name of the role
45+
- `permissions` (List of String) Permissions for the role
46+
- `resource_id` (String) Resource to add the custom role to.
47+
48+
### Read-Only
49+
50+
- `id` (String) Terraform's internal resource identifier. It is structured as "[resource_id],[role_id]".
51+
- `role_id` (String) The ID of the role.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "stackit_authorization_organization_custom_role Resource - stackit"
4+
subcategory: ""
5+
description: |-
6+
Custom Role resource schema.
7+
---
8+
9+
# stackit_authorization_organization_custom_role (Resource)
10+
11+
Custom Role resource schema.
12+
13+
## Example Usage
14+
15+
```terraform
16+
resource "stackit_authorization_organization_custom_role" "example" {
17+
resource_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
18+
name = "my.custom.role"
19+
description = "Some description"
20+
permissions = [
21+
"iam.subject.get"
22+
]
23+
}
24+
25+
# Only use the import statement, if you want to import an existing custom role
26+
import {
27+
to = stackit_authorization_organization_custom_role.import-example
28+
id = "${var.organization_id},${var.custom_role_id}"
29+
}
30+
```
31+
32+
<!-- schema generated by tfplugindocs -->
33+
## Schema
34+
35+
### Required
36+
37+
- `description` (String) A human readable description of the role.
38+
- `name` (String) Name of the role
39+
- `permissions` (List of String) Permissions for the role
40+
- `resource_id` (String) Resource to add the custom role to.
41+
42+
### Read-Only
43+
44+
- `id` (String) Terraform's internal resource identifier. It is structured as "[resource_id],[role_id]".
45+
- `role_id` (String) The ID of the role.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
resource "stackit_resourcemanager_folder" "example" {
2+
name = "example_folder"
3+
owner_email = "foo.bar@stackit.cloud"
4+
parent_container_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
5+
}
6+
7+
resource "stackit_authorization_folder_custom_role" "example" {
8+
resource_id = stackit_resourcemanager_folder.example.folder_id
9+
name = "my.custom.role"
10+
description = "Some description"
11+
permissions = [
12+
"iam.subject.get"
13+
]
14+
}
15+
16+
# Only use the import statement, if you want to import an existing custom role
17+
import {
18+
to = stackit_authorization_folder_custom_role.import-example
19+
id = "${var.folder_id},${var.custom_role_id}"
20+
}
21+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
resource "stackit_authorization_organization_custom_role" "example" {
2+
resource_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
3+
name = "my.custom.role"
4+
description = "Some description"
5+
permissions = [
6+
"iam.subject.get"
7+
]
8+
}
9+
10+
# Only use the import statement, if you want to import an existing custom role
11+
import {
12+
to = stackit_authorization_organization_custom_role.import-example
13+
id = "${var.organization_id},${var.custom_role_id}"
14+
}
15+

0 commit comments

Comments
 (0)