Skip to content

Commit 6394ea0

Browse files
committed
docs generation
1 parent e75b053 commit 6394ea0

File tree

10 files changed

+278
-15
lines changed

10 files changed

+278
-15
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "{{.Name}} {{.Type}} - {{.RenderedProviderName}}"
4+
subcategory: ""
5+
description: |-
6+
{{ .Description | trimspace }}
7+
---
8+
9+
# {{.Name}} ({{.Type}})
10+
11+
{{ .Description | trimspace }}
12+
13+
{{ if .HasExamples -}}
14+
## Example Usage
15+
16+
{{- range .ExampleFiles }}
17+
18+
{{ tffile . }}
19+
{{- end }}
20+
{{- end }}
21+
22+
{{ .SchemaMarkdown | trimspace }}
23+
{{- if or .HasImport .HasImportIDConfig .HasImportIdentityConfig }}
24+
25+
## Import
26+
27+
Import is supported using the following syntax:
28+
{{- end }}
29+
{{- if .HasImportIdentityConfig }}
30+
31+
In Terraform v1.12.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `identity` + "`" + ` attribute, for example:
32+
33+
{{tffile .ImportIdentityConfigFile }}
34+
35+
{{ .IdentitySchemaMarkdown | trimspace }}
36+
{{- end }}
37+
{{- if .HasImportIDConfig }}
38+
39+
In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example:
40+
41+
{{tffile .ImportIDConfigFile }}
42+
{{- end }}
43+
{{- if .HasImport }}
44+
45+
The [` + "`" + `terraform import` + "`" + ` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:
46+
47+
{{codefile "shell" .ImportFile }}
48+
{{- end }}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "{{.Name}} {{.Type}} - {{.RenderedProviderName}}"
4+
subcategory: ""
5+
description: |-
6+
{{ .Description | trimspace }}
7+
---
8+
9+
# {{.Name}} ({{.Type}})
10+
11+
{{ .Description | trimspace }}
12+
13+
## Example Usage
14+
15+
```terraform
16+
resource "{{.Name}}" "role_binding" {
17+
resource_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
18+
role = "owner"
19+
subject = "john.doe@example.com"
20+
}
21+
```
22+
23+
## Import
24+
25+
```terraform
26+
# Only use the import statement, if you want to import an existing folder role assignment
27+
import {
28+
to = {{.Name}}.import-example
29+
id = "${var.region},${var.resource_id},${var.role},${var.subject}"
30+
}
31+
```
32+
33+
{{ .SchemaMarkdown | trimspace }}
34+
35+

docs/resources/secretsmanager_instance_role_binding.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
page_title: "stackit_secretsmanager_instance_role_binding Resource - stackit"
44
subcategory: ""
55
description: |-
6-
TODO
6+
IAM role binding resource schema.
77
---
88

99
# stackit_secretsmanager_instance_role_binding (Resource)
1010

11-
TODO
11+
IAM role binding resource schema.
1212

1313
## Example Usage
1414

@@ -36,3 +36,13 @@ resource "stackit_secretsmanager_instance_role_binding" "role_binding" {
3636
### Read-Only
3737

3838
- `id` (String) Terraform's internal resource identifier. It is structured as "`region`,`resource_id`,`role`,`subject`".
39+
40+
## Import
41+
42+
```terraform
43+
# Only use the import statement, if you want to import an existing folder role assignment
44+
import {
45+
to = stackit_secretsmanager_instance_role_binding.import-example
46+
id = "${var.region},${var.resource_id},${var.role},${var.subject}"
47+
}
48+
```

docs/resources/secretsmanager_secret_group_role_binding.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
page_title: "stackit_secretsmanager_secret_group_role_binding Resource - stackit"
44
subcategory: ""
55
description: |-
6-
TODO
6+
IAM role binding resource schema.
77
---
88

99
# stackit_secretsmanager_secret_group_role_binding (Resource)
1010

11-
TODO
11+
IAM role binding resource schema.
1212

1313
## Example Usage
1414

@@ -36,3 +36,13 @@ resource "stackit_secretsmanager_secret_group_role_binding" "role_binding" {
3636
### Read-Only
3737

3838
- `id` (String) Terraform's internal resource identifier. It is structured as "`region`,`resource_id`,`role`,`subject`".
39+
40+
## Import
41+
42+
```terraform
43+
# Only use the import statement, if you want to import an existing folder role assignment
44+
import {
45+
to = stackit_secretsmanager_secret_group_role_binding.import-example
46+
id = "${var.region},${var.resource_id},${var.role},${var.subject}"
47+
}
48+
```

examples/resources/stackit_secretsmanager_instance_role_binding/resource.tf

Lines changed: 0 additions & 5 deletions
This file was deleted.

examples/resources/stackit_secretsmanager_secret_group_role_binding/resource.tf

Lines changed: 0 additions & 5 deletions
This file was deleted.

stackit/internal/services/iam/rolebindings/generic/resource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func (r *RoleBindingResource[C]) Configure(ctx context.Context, req resource.Con
8484
// Schema defines the schema for the resource.
8585
func (r *RoleBindingResource[C]) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
8686
resp.Schema = schema.Schema{
87-
Description: "TODO",
87+
Description: "IAM role binding resource schema.",
8888
Attributes: map[string]schema.Attribute{
8989
"id": schema.StringAttribute{
9090
Description: "Terraform's internal resource identifier. It is structured as \"`region`,`resource_id`,`role`,`subject`\".",
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "{{.Name}} {{.Type}} - {{.RenderedProviderName}}"
4+
subcategory: ""
5+
description: |-
6+
{{ .Description | trimspace }}
7+
---
8+
9+
# {{.Name}} ({{.Type}})
10+
11+
{{ .Description | trimspace }}
12+
13+
{{ if .HasExamples -}}
14+
## Example Usage
15+
16+
{{- range .ExampleFiles }}
17+
18+
{{ tffile . }}
19+
{{- end }}
20+
{{- end }}
21+
22+
{{ .SchemaMarkdown | trimspace }}
23+
{{- if or .HasImport .HasImportIDConfig .HasImportIdentityConfig }}
24+
25+
## Import
26+
27+
Import is supported using the following syntax:
28+
{{- end }}
29+
{{- if .HasImportIdentityConfig }}
30+
31+
In Terraform v1.12.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `identity` + "`" + ` attribute, for example:
32+
33+
{{tffile .ImportIdentityConfigFile }}
34+
35+
{{ .IdentitySchemaMarkdown | trimspace }}
36+
{{- end }}
37+
{{- if .HasImportIDConfig }}
38+
39+
In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example:
40+
41+
{{tffile .ImportIDConfigFile }}
42+
{{- end }}
43+
{{- if .HasImport }}
44+
45+
The [` + "`" + `terraform import` + "`" + ` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:
46+
47+
{{codefile "shell" .ImportFile }}
48+
{{- end }}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "{{.Name}} {{.Type}} - {{.RenderedProviderName}}"
4+
subcategory: ""
5+
description: |-
6+
{{ .Description | trimspace }}
7+
---
8+
9+
# {{.Name}} ({{.Type}})
10+
11+
{{ .Description | trimspace }}
12+
13+
## Example Usage
14+
15+
```terraform
16+
resource "{{.Name}}" "role_binding" {
17+
resource_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
18+
role = "owner"
19+
subject = "john.doe@example.com"
20+
}
21+
```
22+
23+
## Import
24+
25+
```terraform
26+
# Only use the import statement, if you want to import an existing folder role assignment
27+
import {
28+
to = {{.Name}}.import-example
29+
id = "${var.region},${var.resource_id},${var.role},${var.subject}"
30+
}
31+
```
32+
33+
{{ .SchemaMarkdown | trimspace }}
34+
35+

templates/resources.md.tmpl

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "{{.Name}} {{.Type}} - {{.RenderedProviderName}}"
4+
subcategory: ""
5+
description: |-
6+
{{ .Description | plainmarkdown | trimspace | prefixlines " " }}
7+
---
8+
{{/* Check whether this is a iam role binding resource. The check looks cursed because there's no hasSuffix function available here */}}
9+
{{- $isRoleBinding := false -}}
10+
11+
{{- $parts := split .Name "_role_binding" -}}
12+
{{- $lastItem := "" -}}
13+
14+
{{- range $parts -}}
15+
{{- $lastItem = . -}}
16+
{{- end -}}
17+
18+
{{- if and (gt (len $parts) 1) (eq $lastItem "") -}}
19+
{{- $isRoleBinding = true -}}
20+
{{- end -}}
21+
{{/* End of check */}}
22+
# {{.Name}} ({{.Type}})
23+
24+
{{ .Description | trimspace }}
25+
{{ if $isRoleBinding }}
26+
## Example Usage
27+
28+
```terraform
29+
resource "{{.Name}}" "role_binding" {
30+
resource_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
31+
role = "owner"
32+
subject = "john.doe@example.com"
33+
}
34+
```
35+
{{- else }}
36+
{{ if .HasExamples -}}
37+
## Example Usage
38+
39+
{{- range .ExampleFiles }}
40+
41+
{{ tffile . }}
42+
{{- end }}
43+
{{- end }}
44+
{{- end }}
45+
46+
{{ .SchemaMarkdown | trimspace }}
47+
48+
{{- if $isRoleBinding }}
49+
50+
## Import
51+
52+
```terraform
53+
# Only use the import statement, if you want to import an existing folder role assignment
54+
import {
55+
to = {{.Name}}.import-example
56+
id = "${var.region},${var.resource_id},${var.role},${var.subject}"
57+
}
58+
```
59+
60+
{{- else }}
61+
{{- if or .HasImport .HasImportIDConfig .HasImportIdentityConfig }}
62+
63+
## Import
64+
65+
Import is supported using the following syntax:
66+
{{- end }}
67+
{{- if .HasImportIdentityConfig }}
68+
69+
In Terraform v1.12.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `identity` + "`" + ` attribute, for example:
70+
71+
{{tffile .ImportIdentityConfigFile }}
72+
73+
{{ .IdentitySchemaMarkdown | trimspace }}
74+
{{- end }}
75+
{{- if .HasImportIDConfig }}
76+
77+
In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example:
78+
79+
{{tffile .ImportIDConfigFile }}
80+
{{- end }}
81+
{{- if .HasImport }}
82+
83+
The [` + "`" + `terraform import` + "`" + ` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:
84+
85+
{{codefile "shell" .ImportFile }}
86+
{{- end }}
87+
{{- end }}

0 commit comments

Comments
 (0)