Skip to content

Commit

Permalink
docs: improve documentation of fields in the new resource
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Wasilewski <[email protected]>
  • Loading branch information
mwasilew2 committed Oct 6, 2023
1 parent 1b4447d commit eed0357
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions docs/resources/user_group.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ resource "spacelift_user_group" "test" {
### Required

- `access` (Block List, Min: 1) (see [below for nested schema](#nestedblock--access))
- `name` (String)
- `name` (String) Name of the user group - should be unique in one account

### Read-Only

Expand All @@ -43,5 +43,5 @@ resource "spacelift_user_group" "test" {

Required:

- `level` (String)
- `space_id` (String)
- `level` (String) Type of access to the space. Possible values are: READ, WRITE, ADMIN
- `space_id` (String) ID (slug) of the space the user group has access to
7 changes: 5 additions & 2 deletions spacelift/resource_user_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,27 @@ func resourceUserGroup() *schema.Resource {
Schema: map[string]*schema.Schema{
"name": {
Type: schema.TypeString,
Description: "Name of the user group - should be unique in one account",
Required: true,
ForceNew: true,
ValidateDiagFunc: validations.DisallowEmptyString,
},
"access": {

Type: schema.TypeList,
MinItems: 1,
Required: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"space_id": {
Type: schema.TypeString,
Description: "ID (slug) of the space the user group has access to",
Required: true,
ValidateDiagFunc: validations.DisallowEmptyString,
},
"level": {
Type: schema.TypeString,
Type: schema.TypeString,
Description: "Type of access to the space. Possible values are: " +
"READ, WRITE, ADMIN",
Required: true,
ValidateFunc: validation.StringInSlice(validAccessLevels, false),
},
Expand Down

0 comments on commit eed0357

Please sign in to comment.