diff --git a/docs/resources/kubernetes_project.md b/docs/resources/kubernetes_project.md index 13273f11..57c22c14 100644 --- a/docs/resources/kubernetes_project.md +++ b/docs/resources/kubernetes_project.md @@ -39,7 +39,7 @@ resource "stackit_kubernetes_project" "example" { ### Required -- `project_id` (String) the project ID that SKE will be enabled in +- `project_id` (String) the project UUID that SKE will be enabled in ### Optional diff --git a/stackit/internal/resources/kubernetes/project/schema.go b/stackit/internal/resources/kubernetes/project/schema.go index b3534fc3..e224680e 100644 --- a/stackit/internal/resources/kubernetes/project/schema.go +++ b/stackit/internal/resources/kubernetes/project/schema.go @@ -5,11 +5,13 @@ import ( "fmt" "github.com/SchwarzIT/terraform-provider-stackit/stackit/internal/common" + "github.com/SchwarzIT/terraform-provider-stackit/stackit/pkg/validate" "github.com/hashicorp/terraform-plugin-framework-timeouts/resource/timeouts" "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/resource/schema" "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" ) @@ -38,8 +40,11 @@ func (r *Resource) Schema(ctx context.Context, req resource.SchemaRequest, resp }, "project_id": schema.StringAttribute{ - Description: "the project ID that SKE will be enabled in", + Description: "the project UUID that SKE will be enabled in", Required: true, + Validators: []validator.String{ + validate.ProjectID(), + }, }, "timeouts": common.Timeouts(ctx, timeouts.Opts{