Skip to content

Commit 773aee7

Browse files
committed
feat: add coderd_group resource
1 parent 375a205 commit 773aee7

10 files changed

+645
-80
lines changed

docs/index.md

+1
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

+32
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.
7+
---
8+
9+
# coderd_group (Resource)
10+
11+
A group on the Coder deployment.
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.
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

+4-3
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

+1-1
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)