Skip to content

Commit 11ff7f9

Browse files
committed
Merge branch 'main' into script
2 parents 8eae93d + 233ea60 commit 11ff7f9

File tree

23 files changed

+1008
-392
lines changed

23 files changed

+1008
-392
lines changed

.github/workflows/cla.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
steps:
1212
- name: "CLA Assistant"
1313
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
14-
uses: contributor-assistant/github-action@v2.2.1
14+
uses: contributor-assistant/github-action@v2.3.0
1515
env:
1616
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1717
# the below token should have repo scope and must be manually added by you in the repository's secret

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,20 @@ jobs:
2525
run: git fetch --prune --unshallow
2626

2727
- name: Set up Go
28-
uses: actions/setup-go@v3
28+
uses: actions/setup-go@v4
2929
with:
30-
go-version: 1.17
30+
go-version: 1.20.6
3131

3232
- name: Import GPG key
3333
id: import_gpg
34-
uses: crazy-max/ghaction-import-gpg@v5.1.0
34+
uses: crazy-max/ghaction-import-gpg@v5.3.0
3535
with:
3636
# These secrets will need to be configured for the repository:
3737
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
3838
passphrase: ${{ secrets.PASSPHRASE }}
3939

4040
- name: Run GoReleaser
41-
uses: goreleaser/goreleaser-action@v3.0.0
41+
uses: goreleaser/goreleaser-action@v4.3.0
4242
with:
4343
version: latest
4444
args: release --rm-dist

.github/workflows/test.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ on:
66
pull_request:
77
paths-ignore:
88
- "README.md"
9+
910
push:
11+
branches:
12+
- "main"
1013
paths-ignore:
1114
- "README.md"
1215

@@ -17,7 +20,7 @@ jobs:
1720
timeout-minutes: 5
1821
steps:
1922
- name: Set up Go
20-
uses: actions/setup-go@v3
23+
uses: actions/setup-go@v4
2124
with:
2225
go-version: "1.20"
2326
id: go
@@ -47,9 +50,11 @@ jobs:
4750
- "1.1.*"
4851
- "1.2.*"
4952
- "1.3.*"
53+
- "1.4.*"
54+
- "1.5.*"
5055
steps:
5156
- name: Set up Go
52-
uses: actions/setup-go@v3
57+
uses: actions/setup-go@v4
5358
with:
5459
go-version: "1.20"
5560
id: go
@@ -79,7 +84,7 @@ jobs:
7984
timeout-minutes: 5
8085
steps:
8186
- name: Set up Go
82-
uses: actions/setup-go@v3
87+
uses: actions/setup-go@v4
8388
with:
8489
go-version: "1.20"
8590
id: go

docs/data-sources/parameter.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,18 @@ Use this data source to configure editable options for workspaces.
1717

1818
### Required
1919

20-
- `name` (String) The name of the parameter as it will appear in the interface. If this is changed, developers will be re-prompted for a new value.
20+
- `name` (String) The name of the parameter. If this is changed, developers will be re-prompted for a new value.
2121

2222
### Optional
2323

2424
- `default` (String) A default value for the parameter.
2525
- `description` (String) Describe what this parameter does.
26+
- `display_name` (String) The displayed name of the parameter as it will appear in the interface.
27+
- `ephemeral` (Boolean) The value of an ephemeral parameter will not be preserved between consecutive workspace builds.
2628
- `icon` (String) A URL to an icon that will display in the dashboard. View built-in icons here: https://github.com/coder/coder/tree/main/site/static/icon. Use a built-in icon with `data.coder_workspace.me.access_url + "/icon/<path>"`.
27-
- `legacy_variable` (String) Reference to the Terraform variable. Coder will use it to lookup the default value.
28-
- `legacy_variable_name` (String) Name of the legacy Terraform variable. Coder will use it to lookup the variable value.
2929
- `mutable` (Boolean) Whether this value can be changed after workspace creation. This can be destructive for values like region, so use with caution!
3030
- `option` (Block List, Max: 64) Each "option" block defines a value for a user to select from. (see [below for nested schema](#nestedblock--option))
31+
- `order` (Number) The order determines the position of a template parameter in the UI/CLI presentation. The lowest order is shown first and parameters with equal order are sorted by name (ascending order).
3132
- `type` (String) The type of this parameter. Must be one of: "number", "string", "bool", or "list(string)".
3233
- `validation` (Block List, Max: 1) Validate the input of a parameter. (see [below for nested schema](#nestedblock--validation))
3334

@@ -61,3 +62,8 @@ Optional:
6162
- `min` (Number) The minimum of a number parameter.
6263
- `monotonic` (String) Number monotonicity, either increasing or decreasing.
6364
- `regex` (String) A regex for the input parameter to match against.
65+
66+
Read-Only:
67+
68+
- `max_disabled` (Boolean) Helper field to check if max is present
69+
- `min_disabled` (Boolean) Helper field to check if min is present

docs/data-sources/workspace.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,6 @@ resource "kubernetes_pod" "dev" {
3434
- `owner_email` (String) Email address of the workspace owner.
3535
- `owner_id` (String) UUID of the workspace owner.
3636
- `owner_oidc_access_token` (String) A valid OpenID Connect access token of the workspace owner. This is only available if the workspace owner authenticated with OpenID Connect. If a valid token cannot be obtained, this value will be an empty string.
37+
- `owner_session_token` (String) Session token for authenticating with a Coder deployment. It is regenerated everytime a workspace is started.
3738
- `start_count` (Number) A computed count based on "transition" state. If "start", count will equal 1.
3839
- `transition` (String) Either "start" or "stop". Use this to start/stop resources with "count".

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,5 @@ resource "google_compute_instance" "dev" {
6262

6363
### Optional
6464

65-
- `feature_use_managed_variables` (Boolean) Feature: use managed Terraform variables. If disabled, Terraform variables will be included in legacy Parameter Schema.
65+
- `feature_use_managed_variables` (Boolean, Deprecated) Feature: use managed Terraform variables. The feature flag is not used anymore as Terraform variables are now exclusively utilized for template-wide variables.
6666
- `url` (String) The URL to access Coder.

docs/resources/agent.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ resource "coder_agent" "dev" {
2020
os = "linux"
2121
arch = "amd64"
2222
dir = "/workspace"
23+
display_apps {
24+
vscode = true
25+
vscode_insiders = false
26+
web_terminal = true
27+
ssh_helper = false
28+
}
2329
}
2430
2531
resource "kubernetes_pod" "dev" {
@@ -49,12 +55,15 @@ resource "kubernetes_pod" "dev" {
4955
- `auth` (String) The authentication type the agent will use. Must be one of: "token", "google-instance-identity", "aws-instance-identity", "azure-instance-identity".
5056
- `connection_timeout` (Number) Time in seconds until the agent is marked as timed out when a connection with the server cannot be established. A value of zero never marks the agent as timed out.
5157
- `dir` (String) The starting directory when a user creates a shell session. Defaults to $HOME.
58+
- `display_apps` (Block Set, Max: 1) The list of built-in apps to display in the agent bar. (see [below for nested schema](#nestedblock--display_apps))
5259
- `env` (Map of String) A mapping of environment variables to set inside the workspace.
53-
- `login_before_ready` (Boolean) This option defines whether or not the user can (by default) login to the workspace before it is ready. Ready means that e.g. the startup_script is done and has exited. When enabled, users may see an incomplete workspace when logging in.
60+
- `login_before_ready` (Boolean, Deprecated) This option defines whether or not the user can (by default) login to the workspace before it is ready. Ready means that e.g. the startup_script is done and has exited. When enabled, users may see an incomplete workspace when logging in.
61+
- `metadata` (Block List) Each "metadata" block defines a single item consisting of a key/value pair. This feature is in alpha and may break in future releases. (see [below for nested schema](#nestedblock--metadata))
5462
- `motd_file` (String) The path to a file within the workspace containing a message to display to users when they login via SSH. A typical value would be /etc/motd.
5563
- `shutdown_script` (String) A script to run before the agent is stopped. The script should exit when it is done to signal that the workspace can be stopped.
5664
- `shutdown_script_timeout` (Number) Time in seconds until the agent lifecycle status is marked as timed out during shutdown, this happens when the shutdown script has not completed (exited) in the given time.
5765
- `startup_script` (String) A script to run after the agent starts. The script should exit when it is done to signal that the agent is ready.
66+
- `startup_script_behavior` (String) This option sets the behavior of the `startup_script`. When set to "blocking", the startup_script must exit before the workspace is ready. When set to "non-blocking", the startup_script may run in the background and the workspace will be ready immediately. Default is "non-blocking", although "blocking" is recommended.
5867
- `startup_script_timeout` (Number) Time in seconds until the agent lifecycle status is marked as timed out during start, this happens when the startup script has not completed (exited) in the given time.
5968
- `troubleshooting_url` (String) A URL to a document with instructions for troubleshooting problems with the agent.
6069

@@ -63,3 +72,29 @@ resource "kubernetes_pod" "dev" {
6372
- `id` (String) The ID of this resource.
6473
- `init_script` (String) Run this script on startup of an instance to initialize the agent.
6574
- `token` (String, Sensitive) Set the environment variable "CODER_AGENT_TOKEN" with this token to authenticate an agent.
75+
76+
<a id="nestedblock--display_apps"></a>
77+
### Nested Schema for `display_apps`
78+
79+
Optional:
80+
81+
- `port_forwarding_helper` (Boolean) Display the port-forwarding helper button in the agent bar.
82+
- `ssh_helper` (Boolean) Display the SSH helper button in the agent bar.
83+
- `vscode` (Boolean) Display the VSCode Desktop app in the agent bar.
84+
- `vscode_insiders` (Boolean) Display the VSCode Insiders app in the agent bar.
85+
- `web_terminal` (Boolean) Display the web terminal app in the agent bar.
86+
87+
88+
<a id="nestedblock--metadata"></a>
89+
### Nested Schema for `metadata`
90+
91+
Required:
92+
93+
- `interval` (Number) The interval in seconds at which to refresh this metadata item.
94+
- `key` (String) The key of this metadata item.
95+
- `script` (String) The script that retrieves the value of this metadata item.
96+
97+
Optional:
98+
99+
- `display_name` (String) The user-facing name of this value.
100+
- `timeout` (Number) The maximum time the command is allowed to run in seconds.

docs/resources/app.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ resource "coder_app" "intellij" {
7676
- `relative_path` (Boolean, Deprecated) Specifies whether the URL will be accessed via a relative path or wildcard. Use if wildcard routing is unavailable. Defaults to true.
7777
- `share` (String) Determines the "level" which the application is shared at. Valid levels are "owner" (default), "authenticated" and "public". Level "owner" disables sharing on the app, so only the workspace owner can access it. Level "authenticated" shares the app with all authenticated users. Level "public" shares it with any user, including unauthenticated users. Permitted application sharing levels can be configured site-wide via a flag on `coder server` (Enterprise only).
7878
- `subdomain` (Boolean) Determines whether the app will be accessed via it's own subdomain or whether it will be accessed via a path on Coder. If wildcards have not been setup by the administrator then apps with "subdomain" set to true will not be accessible. Defaults to false.
79-
- `url` (String) A URL to be proxied to from inside the workspace. Either "command" or "url" may be specified, but not both.
79+
- `url` (String) A URL to be proxied to from inside the workspace. This should be of the form "http://localhost:PORT[/SUBPATH]". Either "command" or "url" may be specified, but not both.
8080

8181
### Read-Only
8282

examples/resources/coder_agent/resource.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ resource "coder_agent" "dev" {
55
os = "linux"
66
arch = "amd64"
77
dir = "/workspace"
8+
display_apps {
9+
vscode = true
10+
vscode_insiders = false
11+
web_terminal = true
12+
ssh_helper = false
13+
}
814
}
915

1016
resource "kubernetes_pod" "dev" {

examples/resources/coder_parameter/resource.tf

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
provider "coder" {
2-
feature_use_managed_variables = true
3-
}
1+
provider "coder" {}
42

53
data "coder_parameter" "example" {
64
name = "Region"
@@ -45,12 +43,14 @@ data "coder_parameter" "cores" {
4543
type = "number"
4644
icon = "/icon/cpu.svg"
4745
default = 3
46+
order = 10
4847
}
4948

5049
data "coder_parameter" "disk_size" {
5150
name = "Disk Size"
5251
type = "number"
5352
default = "5"
53+
order = 8
5454
validation {
5555
# This can apply to number.
5656
min = 0
@@ -72,12 +72,16 @@ data "coder_parameter" "cat_lives" {
7272
}
7373

7474
data "coder_parameter" "fairy_tale" {
75-
name = "Fairy Tale"
76-
type = "string"
75+
name = "Fairy Tale"
76+
type = "string"
77+
mutable = true
78+
default = "Hansel and Gretel"
79+
ephemeral = true
7780
}
7881

7982
data "coder_parameter" "users" {
80-
name = "System users"
81-
type = "list(string)"
82-
default = jsonencode(["root", "user1", "user2"])
83+
name = "system_users"
84+
display_name = "System users"
85+
type = "list(string)"
86+
default = jsonencode(["root", "user1", "user2"])
8387
}

examples/resources/coder_parameter_migration/resource.tf

Lines changed: 0 additions & 14 deletions
This file was deleted.

go.mod

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
module github.com/coder/terraform-provider-coder
22

3-
go 1.17
3+
go 1.20
44

55
require (
66
github.com/google/uuid v1.3.0
77
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
88
github.com/hashicorp/terraform-plugin-sdk/v2 v2.20.0
9-
github.com/stretchr/testify v1.8.0
9+
github.com/mitchellh/mapstructure v1.5.0
10+
github.com/stretchr/testify v1.8.4
1011
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
1112
)
1213

@@ -17,7 +18,7 @@ require (
1718
github.com/davecgh/go-spew v1.1.1 // indirect
1819
github.com/fatih/color v1.13.0 // indirect
1920
github.com/golang/protobuf v1.5.2 // indirect
20-
github.com/google/go-cmp v0.5.8 // indirect
21+
github.com/google/go-cmp v0.5.9 // indirect
2122
github.com/hashicorp/errwrap v1.1.0 // indirect
2223
github.com/hashicorp/go-checkpoint v0.5.0 // indirect
2324
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
@@ -42,7 +43,6 @@ require (
4243
github.com/mitchellh/copystructure v1.2.0 // indirect
4344
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
4445
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
45-
github.com/mitchellh/mapstructure v1.5.0 // indirect
4646
github.com/mitchellh/reflectwalk v1.0.2 // indirect
4747
github.com/oklog/run v1.0.0 // indirect
4848
github.com/pmezard/go-difflib v1.0.0 // indirect
@@ -52,12 +52,12 @@ require (
5252
github.com/vmihailenco/tagparser v0.1.1 // indirect
5353
github.com/zclconf/go-cty v1.10.0 // indirect
5454
golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167 // indirect
55-
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
56-
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6 // indirect
57-
golang.org/x/text v0.3.7 // indirect
55+
golang.org/x/net v0.7.0 // indirect
56+
golang.org/x/sys v0.5.0 // indirect
57+
golang.org/x/text v0.7.0 // indirect
5858
google.golang.org/appengine v1.6.7 // indirect
59-
google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf // indirect
60-
google.golang.org/grpc v1.48.0 // indirect
61-
google.golang.org/protobuf v1.28.0 // indirect
59+
google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect
60+
google.golang.org/grpc v1.53.0 // indirect
61+
google.golang.org/protobuf v1.28.1 // indirect
6262
gopkg.in/yaml.v3 v3.0.1 // indirect
6363
)

0 commit comments

Comments
 (0)