Skip to content

Commit 00e2756

Browse files
committed
docs: add hint on how to create a project within sna
1 parent dadea7a commit 00e2756

4 files changed

Lines changed: 28 additions & 4 deletions

File tree

docs/data-sources/resourcemanager_project.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,16 @@ data "stackit_resourcemanager_project" "example" {
3232

3333
- `id` (String) Terraform's internal data source. ID. It is structured as "`container_id`".
3434
- `labels` (Map of String) Labels are key-value string pairs which can be attached to a resource container. A label key must match the regex [A-ZÄÜÖa-zäüöß0-9_-]{1,64}. A label value must match the regex ^$|[A-ZÄÜÖa-zäüöß0-9_-]{1,64}
35+
- `members` (Attributes List, Deprecated) The members assigned to the project. At least one subject needs to be a user, and not a client or service account. This value is only considered during creation. Changing it afterwards will have no effect.
36+
37+
!> The "members" field has been deprecated in favor of the "owner_email" field. Please use the "owner_email" field to assign the owner role to a user. (see [below for nested schema](#nestedatt--members))
3538
- `name` (String) Project name.
36-
- `parent_container_id` (String) Parent resource identifier. Both container ID (user-friendly) and UUID are supported
39+
- `parent_container_id` (String) Parent resource identifier. Both container ID (user-friendly) and UUID are supported
40+
41+
<a id="nestedatt--members"></a>
42+
### Nested Schema for `members`
43+
44+
Read-Only:
45+
46+
- `role` (String) The role of the member in the project. Legacy roles (`project.admin`, `project.auditor`, `project.member`, `project.owner`) are not supported.
47+
- `subject` (String) Unique identifier of the user, service account or client. This is usually the email address for users or service accounts, and the name in case of clients.

docs/resources/resourcemanager_project.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ resource "stackit_resourcemanager_project" "example" {
1818
name = "example-container"
1919
labels = {
2020
"Label 1" = "foo"
21+
// "networkArea" = stackit_network_area.foo.network_area_id
2122
}
2223
owner_email = "john.doe@stackit.cloud"
2324
}
@@ -34,10 +35,21 @@ resource "stackit_resourcemanager_project" "example" {
3435

3536
### Optional
3637

37-
- `labels` (Map of String) Labels are key-value string pairs which can be attached to a resource container. A label key must match the regex [A-ZÄÜÖa-zäüöß0-9_-]{1,64}. A label value must match the regex ^$|[A-ZÄÜÖa-zäüöß0-9_-]{1,64}
38+
- `labels` (Map of String) Labels are key-value string pairs which can be attached to a resource container. A label key must match the regex [A-ZÄÜÖa-zäüöß0-9_-]{1,64}. A label value must match the regex ^$|[A-ZÄÜÖa-zäüöß0-9_-]{1,64}. To add a project to a STACKIT Network Area, setting the label `networkArea=<networkAreaID>` is required.
39+
- `members` (Attributes List, Deprecated) The members assigned to the project. At least one subject needs to be a user, and not a client or service account. This value is only considered during creation. Changing it afterwards will have no effect.
40+
41+
!> The "members" field has been deprecated in favor of the "owner_email" field. Please use the "owner_email" field to assign the owner role to a user. (see [below for nested schema](#nestedatt--members))
3842

3943
### Read-Only
4044

4145
- `container_id` (String) Project container ID. Globally unique, user-friendly identifier.
4246
- `id` (String) Terraform's internal resource ID. It is structured as "`container_id`".
43-
- `project_id` (String) Project UUID identifier. This is the ID that can be used in most of the other resources to identify the project.
47+
- `project_id` (String) Project UUID identifier. This is the ID that can be used in most of the other resources to identify the project.
48+
49+
<a id="nestedatt--members"></a>
50+
### Nested Schema for `members`
51+
52+
Required:
53+
54+
- `role` (String) The role of the member in the project. Possible values include, but are not limited to: `owner`, `editor`, `reader`. Legacy roles (`project.admin`, `project.auditor`, `project.member`, `project.owner`) are not supported.
55+
- `subject` (String) Unique identifier of the user, service account or client. This is usually the email address for users or service accounts, and the name in case of clients.

examples/resources/stackit_resourcemanager_project/resource.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ resource "stackit_resourcemanager_project" "example" {
33
name = "example-container"
44
labels = {
55
"Label 1" = "foo"
6+
// "networkArea" = stackit_network_area.foo.network_area_id
67
}
78
owner_email = "john.doe@stackit.cloud"
89
}

stackit/internal/services/resourcemanager/project/resource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ func (r *projectResource) Schema(_ context.Context, _ resource.SchemaRequest, re
152152
"container_id": "Project container ID. Globally unique, user-friendly identifier.",
153153
"parent_container_id": "Parent resource identifier. Both container ID (user-friendly) and UUID are supported",
154154
"name": "Project name.",
155-
"labels": "Labels are key-value string pairs which can be attached to a resource container. A label key must match the regex [A-ZÄÜÖa-zäüöß0-9_-]{1,64}. A label value must match the regex ^$|[A-ZÄÜÖa-zäüöß0-9_-]{1,64}",
155+
"labels": "Labels are key-value string pairs which can be attached to a resource container. A label key must match the regex [A-ZÄÜÖa-zäüöß0-9_-]{1,64}. A label value must match the regex ^$|[A-ZÄÜÖa-zäüöß0-9_-]{1,64}. To add a project to a STACKIT Network Area, setting the label `networkArea=<networkAreaID>` is required.",
156156
"owner_email": "Email address of the owner of the project. This value is only considered during creation. Changing it afterwards will have no effect.",
157157
"members": "The members assigned to the project. At least one subject needs to be a user, and not a client or service account. This value is only considered during creation. Changing it afterwards will have no effect.",
158158
"members.role": fmt.Sprintf("The role of the member in the project. Possible values include, but are not limited to: `owner`, `editor`, `reader`. Legacy roles (%s) are not supported.", strings.Join(utils.QuoteValues(utils.LegacyProjectRoles), ", ")),

0 commit comments

Comments
 (0)