Skip to content

Commit b3458c7

Browse files
feat: add coderd_group resource (#31)
1 parent 375a205 commit b3458c7

File tree

10 files changed

+645
-80
lines changed

10 files changed

+645
-80
lines changed

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@ provider "coderd" {
2323

2424
### Optional
2525

26+
- `default_organization_id` (String) Default organization ID to use when creating resources. Defaults to the first organization the token has access to.
2627
- `token` (String) API token for communicating with the deployment. Most resource types require elevated permissions. Defaults to $CODER_SESSION_TOKEN.
2728
- `url` (String) URL to the Coder deployment. Defaults to $CODER_URL.

docs/resources/group.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "coderd_group Resource - coderd"
4+
subcategory: ""
5+
description: |-
6+
A group on the Coder deployment. If you want to have a group resource with unmanaged members, but still want to read the members in Terraform, use the data.coderd_group data source.
7+
---
8+
9+
# coderd_group (Resource)
10+
11+
A group on the Coder deployment. If you want to have a group resource with unmanaged members, but still want to read the members in Terraform, use the `data.coderd_group` data source.
12+
13+
14+
15+
<!-- schema generated by tfplugindocs -->
16+
## Schema
17+
18+
### Required
19+
20+
- `name` (String) The unique name of the group.
21+
22+
### Optional
23+
24+
- `avatar_url` (String) The URL of the group's avatar.
25+
- `display_name` (String) The display name of the group. Defaults to the group name.
26+
- `members` (Set of String) Members of the group, by ID. If null, members will not be added or removed.
27+
- `organization_id` (String) The organization ID that the group belongs to. Defaults to the provider default organization ID.
28+
- `quota_allowance` (Number) The number of quota credits to allocate to each user in the group.
29+
30+
### Read-Only
31+
32+
- `id` (String) Group ID.

integration/integration.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
"github.com/stretchr/testify/require"
2020
)
2121

22-
func StartCoder(ctx context.Context, t *testing.T, name string) *codersdk.Client {
22+
func StartCoder(ctx context.Context, t *testing.T, name string, useTrial bool) *codersdk.Client {
2323
coderImg := os.Getenv("CODER_IMAGE")
2424
if coderImg == "" {
2525
coderImg = "ghcr.io/coder/coder"
@@ -75,9 +75,9 @@ func StartCoder(ctx context.Context, t *testing.T, name string) *codersdk.Client
7575

7676
// nolint:gosec // For testing only.
7777
var (
78-
testEmail = "testing@coder.com"
78+
testEmail = "admin@coder.com"
7979
testPassword = "InsecurePassw0rd!"
80-
testUsername = "testing"
80+
testUsername = "admin"
8181
)
8282

8383
// Perform first time setup
@@ -96,6 +96,7 @@ func StartCoder(ctx context.Context, t *testing.T, name string) *codersdk.Client
9696
Email: testEmail,
9797
Username: testUsername,
9898
Password: testPassword,
99+
Trial: useTrial,
99100
})
100101
require.NoError(t, err, "create first user")
101102
resp, err := client.LoginWithPassword(ctx, codersdk.LoginWithPasswordRequest{

integration/integration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func TestIntegration(t *testing.T) {
9090
},
9191
} {
9292
t.Run(tt.name, func(t *testing.T) {
93-
client := StartCoder(ctx, t, tt.name)
93+
client := StartCoder(ctx, t, tt.name, true)
9494
wd, err := os.Getwd()
9595
require.NoError(t, err)
9696
srcDir := filepath.Join(wd, tt.name)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy