Skip to content

Commit 4163803

Browse files
committed
Remove v1-to-v2 migration guide and update docs
- Deleted the outdated v1-to-v2 migration guide and related template. - Introduced a comprehensive version 2 upgrade guide. - Upgraded Go toolchain to version 1.22.9. - Updated links and references in index to point to the new guide. - Ran `make gen` to update the generated documentation files.
1 parent a22ccaa commit 4163803

File tree

7 files changed

+197
-95
lines changed

7 files changed

+197
-95
lines changed

docs/guides/v1-to-v2-migration.md

-45
This file was deleted.

docs/guides/version-2-upgrade.md

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---
2+
page_title: "Terraform Coder Provider Version 2 Upgrade Guide"
3+
---
4+
5+
# Terraform Coder Provider Version 2 Upgrade Guide
6+
7+
Version 2.0.0 of the Coder provider for Terraform is a major release that removes and introduces some changes that you will need to consider when upgrading.
8+
This guide is intended to help with the process and focus only on the changes from version 1.X to version 2.0.0.
9+
10+
11+
!> Using Version 2.0.0 of the Coder provider requires Coder Server version [`2.13.0`](https://github.com/coder/coder/releases/tag/v2.13.0) or later.
12+
13+
Upgrade topics:
14+
15+
- [Provider Version Configuration](#provider-version-configuration)
16+
- [Provider Arguments](#provider-arguments)
17+
- [Data Source: coder_git_auth --> coder_external_auth](#data-source-coder_git_auth)
18+
- [Data Source: coder_workspace](#data-source-coder_workspace)
19+
20+
## Provider Version Configuration
21+
22+
-> Before upgrading to version 2.0.0, it is recommended to upgrade to the most recent 1.X version and ensure that your environment successfully runs [`terraform plan`](https://developer.hashicorp.com/terraform/cli/commands/plan) without unexpected changes or deprecation notices.
23+
24+
We recommended using [version constraints](https://developer.hashicorp.com/terraform/language/providers/requirements#version-constraints) when configuring Terraform providers.
25+
26+
27+
For example, given the previous configuration:
28+
29+
```terraform
30+
terraform {
31+
required_providers {
32+
coder = {
33+
source = "coder/coder"
34+
version = "~> 1.0.0"
35+
}
36+
}
37+
}
38+
39+
provider "coder" {
40+
feature_use_managed_variables = true
41+
}
42+
```
43+
44+
Update to the latest 2.X version:
45+
46+
```terraform
47+
terraform {
48+
required_providers {
49+
coder = {
50+
source = "coder/coder"
51+
version = "~> 2.0.0"
52+
}
53+
}
54+
}
55+
56+
provider "coder" {}
57+
```
58+
59+
## Provider Arguments
60+
61+
Version 2.0.0 removes the [`feature_use_managed_variables`](https://registry.terraform.io/providers/coder/coder/1.0.4/docs#feature_use_managed_variables-1) argument from the `provider` block.
62+
63+
64+
## Data Source: [`coder_git_auth`](https://registry.terraform.io/providers/coder/coder/1.0.4/docs/data-sources/git_auth)
65+
66+
If you are using this data source, you must replace it with the [`coder_external_auth`](https://registry.terraform.io/providers/coder/coder/2.0.0/docs/data-sources/external_auth) data source. The `coder_external_auth` data source is a more generic data source that can be used to create any external authentication provider which supports OAuth2.
67+
68+
For example, given the previous configuration:
69+
70+
```terraform
71+
data "coder_git_auth" "example" {
72+
id = "example"
73+
}
74+
```
75+
76+
Update to the new data source:
77+
78+
```terraform
79+
data "coder_external_auth" "example" {
80+
id = "example"
81+
}
82+
```
83+
84+
## Data Source: [`coder_workspace`](https://registry.terraform.io/providers/coder/coder/1.0.4/docs/data-sources/workspace)
85+
86+
If you are using the `owner` properties of the `coder_workspace` data source, you must remove them and use the [`coder_workspace_owner`](https://registry.terraform.io/providers/coder/coder/2.0.0/docs/data-sources/workspace_owner) data source instead. The `coder_workspace_owner` data source provides additional properties of the workspace owner.
87+
88+
- Remove `owner_id` attribute. Use [`data.coder_workspace_owner.me.id`](../data-sources/workspace_owner.md#id) instead.
89+
- Remove `owner` attribute. Use [`data.coder_workspace_owner.me.name`](../data-sources/workspace_owner.md#name) instead.
90+
- Remove `owner_name` attribute. Use [`data.coder_workspace_owner.me.full_name`](../data-sources/workspace_owner.md#full_name) instead.
91+
- Remove `owner_email` attribute. Use [`data.coder_workspace_owner.me.email`](../data-sources/workspace_owner.md#email) instead.
92+
- Remove `owner_groups` attribute. Use [`data.coder_workspace_owner.me.groups`](../data-sources/workspace_owner.md#groups) instead.
93+
- Remove `owner_oidc_access_token` attribute. Use [`data.coder_workspace_owner.me.oidc_access_token`](../data-sources/workspace_owner.md#oidc_access_token) instead.
94+
- Remove `owner_session_token` attribute. Use [`data.coder_workspace_owner.me.session_token`](../data-sources/workspace_owner.md#session_token) instead.
95+
96+
->While we do not anticipate these changes to affect existing resources, we strongly advice reviewing the plan produced by Terraform to ensure no resources are accidentally removed or altered in an undesired way. If you encounter any unexpected behavior, please report it by opening a GitHub [issue](https://github.com/coder/terraform-provider-coder/issues).

docs/index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ description: |-
88

99
# Coder Provider
1010

11-
Terraform provider for managing Coder [templates](https://coder.com/docs/templates), which are the underlying infrastructure for Coder [workspaces](https://coder.com/docs/workspaces).
11+
Terraform provider for managing Coder [templates](https://coder.com/docs/admin/templates), which are the underlying infrastructure for Coder [workspaces](https://coder.com/docs/user-guides/workspace-management).
1212

1313
-> Requires Coder v2.13.0 or later.
1414

15-
!> `coder_git_auth` and owner related fields of `coder_workspace` data source have been removed. Follow the [v0 to v1migration guide](https://registry.terraform.io/providers/codercom/coder/latest/docs/guides/v1-to-v2-migration) to update your code.
15+
!> [`coder_git_auth`](https://registry.terraform.io/providers/coder/coder/1.0.4/docs/data-sources/git_auth) and owner related fields of [`coder_workspace`](https://registry.terraform.io/providers/coder/coder/1.0.4/docs/data-sources/workspace) data source have been removed. Follow the [Version 2 Upgrade Guide](https://registry.terraform.io/providers/codercom/coder/latest/docs/guides/version-2-upgrade) to update your code.
1616

1717
## Example
1818

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module github.com/coder/terraform-provider-coder
22

33
go 1.22
44

5-
toolchain go1.22.3
5+
toolchain go1.22.9
66

77
require (
88
github.com/docker/docker v26.1.5+incompatible

templates/guides/v1-to-v2-migration.md.tmpl

-45
This file was deleted.
+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---
2+
page_title: "Terraform Coder Provider Version 2 Upgrade Guide"
3+
---
4+
5+
# Terraform Coder Provider Version 2 Upgrade Guide
6+
7+
Version 2.0.0 of the Coder provider for Terraform is a major release that removes and introduces some changes that you will need to consider when upgrading.
8+
This guide is intended to help with the process and focus only on the changes from version 1.X to version 2.0.0.
9+
10+
11+
!> Using Version 2.0.0 of the Coder provider requires Coder Server version [`2.13.0`](https://github.com/coder/coder/releases/tag/v2.13.0) or later.
12+
13+
Upgrade topics:
14+
15+
- [Provider Version Configuration](#provider-version-configuration)
16+
- [Provider Arguments](#provider-arguments)
17+
- [Data Source: coder_git_auth --> coder_external_auth](#data-source-coder_git_auth)
18+
- [Data Source: coder_workspace](#data-source-coder_workspace)
19+
20+
## Provider Version Configuration
21+
22+
-> Before upgrading to version 2.0.0, it is recommended to upgrade to the most recent 1.X version and ensure that your environment successfully runs [`terraform plan`](https://developer.hashicorp.com/terraform/cli/commands/plan) without unexpected changes or deprecation notices.
23+
24+
We recommended using [version constraints](https://developer.hashicorp.com/terraform/language/providers/requirements#version-constraints) when configuring Terraform providers.
25+
26+
27+
For example, given the previous configuration:
28+
29+
```terraform
30+
terraform {
31+
required_providers {
32+
coder = {
33+
source = "coder/coder"
34+
version = "~> 1.0.0"
35+
}
36+
}
37+
}
38+
39+
provider "coder" {
40+
feature_use_managed_variables = true
41+
}
42+
```
43+
44+
Update to the latest 2.X version:
45+
46+
```terraform
47+
terraform {
48+
required_providers {
49+
coder = {
50+
source = "coder/coder"
51+
version = "~> 2.0.0"
52+
}
53+
}
54+
}
55+
56+
provider "coder" {}
57+
```
58+
59+
## Provider Arguments
60+
61+
Version 2.0.0 removes the [`feature_use_managed_variables`](https://registry.terraform.io/providers/coder/coder/1.0.4/docs#feature_use_managed_variables-1) argument from the `provider` block.
62+
63+
64+
## Data Source: [`coder_git_auth`](https://registry.terraform.io/providers/coder/coder/1.0.4/docs/data-sources/git_auth)
65+
66+
If you are using this data source, you must replace it with the [`coder_external_auth`](https://registry.terraform.io/providers/coder/coder/2.0.0/docs/data-sources/external_auth) data source. The `coder_external_auth` data source is a more generic data source that can be used to create any external authentication provider which supports OAuth2.
67+
68+
For example, given the previous configuration:
69+
70+
```terraform
71+
data "coder_git_auth" "example" {
72+
id = "example"
73+
}
74+
```
75+
76+
Update to the new data source:
77+
78+
```terraform
79+
data "coder_external_auth" "example" {
80+
id = "example"
81+
}
82+
```
83+
84+
## Data Source: [`coder_workspace`](https://registry.terraform.io/providers/coder/coder/1.0.4/docs/data-sources/workspace)
85+
86+
If you are using the `owner` properties of the `coder_workspace` data source, you must remove them and use the [`coder_workspace_owner`](https://registry.terraform.io/providers/coder/coder/2.0.0/docs/data-sources/workspace_owner) data source instead. The `coder_workspace_owner` data source provides additional properties of the workspace owner.
87+
88+
- Remove `owner_id` attribute. Use [`data.coder_workspace_owner.me.id`](../data-sources/workspace_owner.md#id) instead.
89+
- Remove `owner` attribute. Use [`data.coder_workspace_owner.me.name`](../data-sources/workspace_owner.md#name) instead.
90+
- Remove `owner_name` attribute. Use [`data.coder_workspace_owner.me.full_name`](../data-sources/workspace_owner.md#full_name) instead.
91+
- Remove `owner_email` attribute. Use [`data.coder_workspace_owner.me.email`](../data-sources/workspace_owner.md#email) instead.
92+
- Remove `owner_groups` attribute. Use [`data.coder_workspace_owner.me.groups`](../data-sources/workspace_owner.md#groups) instead.
93+
- Remove `owner_oidc_access_token` attribute. Use [`data.coder_workspace_owner.me.oidc_access_token`](../data-sources/workspace_owner.md#oidc_access_token) instead.
94+
- Remove `owner_session_token` attribute. Use [`data.coder_workspace_owner.me.session_token`](../data-sources/workspace_owner.md#session_token) instead.
95+
96+
->While we do not anticipate these changes to affect existing resources, we strongly advice reviewing the plan produced by Terraform to ensure no resources are accidentally removed or altered in an undesired way. If you encounter any unexpected behavior, please report it by opening a GitHub [issue](https://github.com/coder/terraform-provider-coder/issues).

templates/index.md.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ description: |-
88

99
# Coder Provider
1010

11-
Terraform provider for managing Coder [templates](https://coder.com/docs/templates), which are the underlying infrastructure for Coder [workspaces](https://coder.com/docs/workspaces).
11+
Terraform provider for managing Coder [templates](https://coder.com/docs/admin/templates), which are the underlying infrastructure for Coder [workspaces](https://coder.com/docs/user-guides/workspace-management).
1212

1313
-> Requires Coder v2.13.0 or later.
1414

15-
!> `coder_git_auth` and owner related fields of `coder_workspace` data source have been removed. Follow the [v0 to v1migration guide](https://registry.terraform.io/providers/codercom/coder/latest/docs/guides/v1-to-v2-migration) to update your code.
15+
!> [`coder_git_auth`](https://registry.terraform.io/providers/coder/coder/1.0.4/docs/data-sources/git_auth) and owner related fields of [`coder_workspace`](https://registry.terraform.io/providers/coder/coder/1.0.4/docs/data-sources/workspace) data source have been removed. Follow the [Version 2 Upgrade Guide](https://registry.terraform.io/providers/codercom/coder/latest/docs/guides/version-2-upgrade) to update your code.
1616

1717
## Example
1818

0 commit comments

Comments
 (0)