From 637213d7187109fe1ee18b4b6425ed88ab0dfa95 Mon Sep 17 00:00:00 2001 From: Mauritz Uphoff <39736813+h3adex@users.noreply.github.com> Date: Tue, 18 Mar 2025 15:53:51 +0100 Subject: [PATCH] docs: add hint on how to create a project within sna (#722) --- docs/resources/resourcemanager_project.md | 5 +++-- .../resources/stackit_resourcemanager_project/resource.tf | 1 + .../internal/services/resourcemanager/project/resource.go | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/resources/resourcemanager_project.md b/docs/resources/resourcemanager_project.md index eb9f0555..ea0a70bc 100644 --- a/docs/resources/resourcemanager_project.md +++ b/docs/resources/resourcemanager_project.md @@ -18,6 +18,7 @@ resource "stackit_resourcemanager_project" "example" { name = "example-container" labels = { "Label 1" = "foo" + // "networkArea" = stackit_network_area.foo.network_area_id } owner_email = "john.doe@stackit.cloud" } @@ -34,10 +35,10 @@ resource "stackit_resourcemanager_project" "example" { ### Optional -- `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} +- `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=` is required. ### Read-Only - `container_id` (String) Project container ID. Globally unique, user-friendly identifier. - `id` (String) Terraform's internal resource ID. It is structured as "`container_id`". -- `project_id` (String) Project UUID identifier. This is the ID that can be used in most of the other resources to identify the project. \ No newline at end of file +- `project_id` (String) Project UUID identifier. This is the ID that can be used in most of the other resources to identify the project. diff --git a/examples/resources/stackit_resourcemanager_project/resource.tf b/examples/resources/stackit_resourcemanager_project/resource.tf index 518d4eaa..ae2a0d58 100644 --- a/examples/resources/stackit_resourcemanager_project/resource.tf +++ b/examples/resources/stackit_resourcemanager_project/resource.tf @@ -3,6 +3,7 @@ resource "stackit_resourcemanager_project" "example" { name = "example-container" labels = { "Label 1" = "foo" + // "networkArea" = stackit_network_area.foo.network_area_id } owner_email = "john.doe@stackit.cloud" } diff --git a/stackit/internal/services/resourcemanager/project/resource.go b/stackit/internal/services/resourcemanager/project/resource.go index b3a81f48..43163f62 100644 --- a/stackit/internal/services/resourcemanager/project/resource.go +++ b/stackit/internal/services/resourcemanager/project/resource.go @@ -152,7 +152,7 @@ func (r *projectResource) Schema(_ context.Context, _ resource.SchemaRequest, re "container_id": "Project container ID. Globally unique, user-friendly identifier.", "parent_container_id": "Parent resource identifier. Both container ID (user-friendly) and UUID are supported", "name": "Project name.", - "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}", + "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=` is required.", "owner_email": "Email address of the owner of the project. This value is only considered during creation. Changing it afterwards will have no effect.", "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.", "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), ", ")),