From 6002e5b03973d0ffed60672e1acaabb3de3b2997 Mon Sep 17 00:00:00 2001 From: Adam Connelly Date: Wed, 7 Feb 2024 06:17:29 -0500 Subject: [PATCH] docs: document root admin requirement for spacelift_space (#510) The `spacelift_space` resource requires root space admin permissions to work. This means that it can only be used by administrative stacks that live in the root space. I've added a note to the provider docs to make that more obvious. --- docs/resources/space.md | 3 +++ spacelift/resource_space.go | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/resources/space.md b/docs/resources/space.md index 40e63722..5301e7d2 100644 --- a/docs/resources/space.md +++ b/docs/resources/space.md @@ -4,12 +4,15 @@ page_title: "spacelift_space Resource - terraform-provider-spacelift" subcategory: "" description: |- spacelift_space represents a Spacelift space - a collection of resources such as stacks, modules, policies, etc. Allows for more granular access control. Can have a parent space. + Please note: the spacelift_space resource requires root Admin permissions, and can only be used by administrative stacks in the root space, or using an API key or user session that has root space access. --- # spacelift_space (Resource) `spacelift_space` represents a Spacelift **space** - a collection of resources such as stacks, modules, policies, etc. Allows for more granular access control. Can have a parent space. +**Please note:** the `spacelift_space` resource requires root Admin permissions, and can only be used by administrative stacks in the root space, or using an API key or user session that has root space access. + ## Example Usage ```terraform diff --git a/spacelift/resource_space.go b/spacelift/resource_space.go index 669d1caf..b35e1054 100644 --- a/spacelift/resource_space.go +++ b/spacelift/resource_space.go @@ -17,7 +17,9 @@ import ( func resourceSpace() *schema.Resource { return &schema.Resource{ Description: "`spacelift_space` represents a Spacelift **space** - " + - "a collection of resources such as stacks, modules, policies, etc. Allows for more granular access control. Can have a parent space.", + "a collection of resources such as stacks, modules, policies, etc. Allows for more granular access control. Can have a parent space.\n\n" + + "**Please note:** the `spacelift_space` resource requires root Admin permissions, and can only be used by administrative stacks " + + "in the root space, or using an API key or user session that has root space access.", CreateContext: resourceSpaceCreate, ReadContext: resourceSpaceRead,