-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate docs and update toolchain version
- Loading branch information
Showing
5 changed files
with
261 additions
and
91 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
--- | ||
page_title: "Terraform Coder Provider Version 2 Upgrade Guide" | ||
--- | ||
|
||
# Terraform Coder Provider Version 2 Upgrade Guide | ||
|
||
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. | ||
This guide is intended to help with the process and focus only on the changes from version 1.X to version 2.0.0. | ||
|
||
|
||
!> 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. | ||
|
||
Upgrade topics: | ||
|
||
- [Provider Version Configuration](#provider-version-configuration) | ||
- [Provider Arguments](#provider-arguments) | ||
- [Data Source: coder_git_auth --> coder_external_auth](#data-source-coder_git_auth) | ||
- [Data Source: coder_workspace](#data-source-coder_workspace) | ||
|
||
## Provider Version Configuration | ||
|
||
-> 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. | ||
|
||
We recommended using [version constraints](https://developer.hashicorp.com/terraform/language/providers/requirements#version-constraints) when configuring Terraform providers. | ||
|
||
|
||
For example, given the previous configuration: | ||
|
||
```terraform | ||
terraform { | ||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
version = "~> 4.65" | ||
} | ||
} | ||
} | ||
provider "coder" { | ||
feature_use_managed_variables = true | ||
} | ||
``` | ||
|
||
Update to the latest 2.X version: | ||
|
||
```terraform | ||
terraform { | ||
required_providers { | ||
coder = { | ||
source = "coder/coder" | ||
version = "~> 2.0.0" | ||
} | ||
} | ||
} | ||
provider "coder" {} | ||
``` | ||
|
||
## Provider Arguments | ||
|
||
Version 2.0.0 removes the `feature_use_managed_variables` attribute from the `provider` block. | ||
|
||
|
||
## Data Source: `coder_git_auth` | ||
|
||
If you are using this data source, you must replace it with the [`coder_external_auth`](../docs/data-sources/external-auth.md) data source. The `coder_external_auth` data source is a more generic data source that can be used to create any external authentication provider. | ||
|
||
For example, given the previous configuration: | ||
|
||
```terraform | ||
data "coder_git_auth" "example" { | ||
id = "example" | ||
} | ||
``` | ||
|
||
Update to the new data source: | ||
|
||
```terraform | ||
data "coder_external_auth" "example" { | ||
id = "example" | ||
} | ||
``` | ||
|
||
## Data Source: `coder_workspace` | ||
|
||
If you are using the `owner` properties of the `coder_workspace` data source, you must remove them and use the [`coder_workspace_owner`](../docs/data-sources/workspace-owner.md) data source instead. The `coder_workspace_owner` data source provides additional properties of the workspace owner. | ||
|
||
- Remove `owner_id` attribute. Use [`data.coder_workspace_owner.me.id`](../docs/data-sources/workspace-owner.md#id) instead. | ||
- Remove `owner` attribute. Use [`data.coder_workspace_owner.me.name`](../docs/data-sources/workspace-owner.md#name) instead. | ||
- Remove `owner_name` attribute. Use [`data.coder_workspace_owner.me.full_name`](../docs/data-sources/workspace-owner.md#full_name) instead. | ||
- Remove `owner_email` attribute. Use [`data.coder_workspace_owner.me.email`](../docs/data-sources/workspace-owner.md#email) instead. | ||
- Remove `owner_groups` attribute. Use [`data.coder_workspace_owner.me.groups`](../docs/data-sources/workspace-owner.md#groups) instead. | ||
- Remove `owner_oidc_access_token` attribute. Use [`data.coder_workspace_owner.me.oidc_access_token`](../docs/data-sources/workspace-owner.md#oidc_access_token) instead. | ||
- Remove `owner_session_token` attribute. Use [`data.coder_workspace_owner.me.session_token`](../docs/data-sources/workspace-owner.md#session_token) instead. | ||
|
||
|
||
For example, given the previous configuration: | ||
|
||
```terraform | ||
data "coder_workspace" "me" {} | ||
... | ||
id = data.coder_workspace.me.id | ||
username = data.coder_workspace.me.owner | ||
user_id = data.coder_workspace.me.owner_id | ||
full_name = data.coder_workspace.me.owner_name | ||
email = data.coder_workspace.me.owner_email | ||
groups = data.coder_workspace.me.owner_groups | ||
oidc_access_token = data.coder_workspace.me.owner_oidc_access_token | ||
session_token = data.coder_workspace.me.owner_session_token | ||
... | ||
``` | ||
|
||
Update to the new data source: | ||
|
||
```terraform | ||
data "coder_workspace_owner" "me" {} | ||
... | ||
id = data.coder_workspace_owner.me.id | ||
username = data.coder_workspace_owner.me.name | ||
full_name = data.coder_workspace_owner.me.full_name | ||
email = data.coder_workspace_owner.me.email | ||
groups = data.coder_workspace_owner.me.groups | ||
oidc_access_token = data.coder_workspace_owner.me.oidc_access_token | ||
session_token = data.coder_workspace_owner.me.session_token | ||
... | ||
``` | ||
|
||
->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). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
--- | ||
page_title: "Terraform Coder Provider Version 2 Upgrade Guide" | ||
--- | ||
|
||
# Terraform Coder Provider Version 2 Upgrade Guide | ||
|
||
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. | ||
This guide is intended to help with the process and focus only on the changes from version 1.X to version 2.0.0. | ||
|
||
|
||
!> 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. | ||
|
||
Upgrade topics: | ||
|
||
- [Provider Version Configuration](#provider-version-configuration) | ||
- [Provider Arguments](#provider-arguments) | ||
- [Data Source: coder_git_auth --> coder_external_auth](#data-source-coder_git_auth) | ||
- [Data Source: coder_workspace](#data-source-coder_workspace) | ||
|
||
## Provider Version Configuration | ||
|
||
-> 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. | ||
|
||
We recommended using [version constraints](https://developer.hashicorp.com/terraform/language/providers/requirements#version-constraints) when configuring Terraform providers. | ||
|
||
|
||
For example, given the previous configuration: | ||
|
||
```terraform | ||
terraform { | ||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
version = "~> 4.65" | ||
} | ||
} | ||
} | ||
|
||
provider "coder" { | ||
feature_use_managed_variables = true | ||
} | ||
``` | ||
|
||
Update to the latest 2.X version: | ||
|
||
```terraform | ||
terraform { | ||
required_providers { | ||
coder = { | ||
source = "coder/coder" | ||
version = "~> 2.0.0" | ||
} | ||
} | ||
} | ||
|
||
provider "coder" {} | ||
``` | ||
|
||
## Provider Arguments | ||
|
||
Version 2.0.0 removes the `feature_use_managed_variables` attribute from the `provider` block. | ||
|
||
|
||
## Data Source: `coder_git_auth` | ||
|
||
If you are using this data source, you must replace it with the [`coder_external_auth`](../docs/data-sources/external-auth.md) data source. The `coder_external_auth` data source is a more generic data source that can be used to create any external authentication provider. | ||
|
||
For example, given the previous configuration: | ||
|
||
```terraform | ||
data "coder_git_auth" "example" { | ||
id = "example" | ||
} | ||
``` | ||
|
||
Update to the new data source: | ||
|
||
```terraform | ||
data "coder_external_auth" "example" { | ||
id = "example" | ||
} | ||
``` | ||
|
||
## Data Source: `coder_workspace` | ||
|
||
If you are using the `owner` properties of the `coder_workspace` data source, you must remove them and use the [`coder_workspace_owner`](../docs/data-sources/workspace-owner.md) data source instead. The `coder_workspace_owner` data source provides additional properties of the workspace owner. | ||
|
||
- Remove `owner_id` attribute. Use [`data.coder_workspace_owner.me.id`](../docs/data-sources/workspace-owner.md#id) instead. | ||
- Remove `owner` attribute. Use [`data.coder_workspace_owner.me.name`](../docs/data-sources/workspace-owner.md#name) instead. | ||
- Remove `owner_name` attribute. Use [`data.coder_workspace_owner.me.full_name`](../docs/data-sources/workspace-owner.md#full_name) instead. | ||
- Remove `owner_email` attribute. Use [`data.coder_workspace_owner.me.email`](../docs/data-sources/workspace-owner.md#email) instead. | ||
- Remove `owner_groups` attribute. Use [`data.coder_workspace_owner.me.groups`](../docs/data-sources/workspace-owner.md#groups) instead. | ||
- Remove `owner_oidc_access_token` attribute. Use [`data.coder_workspace_owner.me.oidc_access_token`](../docs/data-sources/workspace-owner.md#oidc_access_token) instead. | ||
- Remove `owner_session_token` attribute. Use [`data.coder_workspace_owner.me.session_token`](../docs/data-sources/workspace-owner.md#session_token) instead. | ||
|
||
|
||
For example, given the previous configuration: | ||
|
||
```terraform | ||
data "coder_workspace" "me" {} | ||
|
||
... | ||
id = data.coder_workspace.me.id | ||
username = data.coder_workspace.me.owner | ||
user_id = data.coder_workspace.me.owner_id | ||
full_name = data.coder_workspace.me.owner_name | ||
email = data.coder_workspace.me.owner_email | ||
groups = data.coder_workspace.me.owner_groups | ||
oidc_access_token = data.coder_workspace.me.owner_oidc_access_token | ||
session_token = data.coder_workspace.me.owner_session_token | ||
... | ||
``` | ||
|
||
Update to the new data source: | ||
|
||
```terraform | ||
data "coder_workspace_owner" "me" {} | ||
|
||
... | ||
id = data.coder_workspace_owner.me.id | ||
username = data.coder_workspace_owner.me.name | ||
full_name = data.coder_workspace_owner.me.full_name | ||
email = data.coder_workspace_owner.me.email | ||
groups = data.coder_workspace_owner.me.groups | ||
oidc_access_token = data.coder_workspace_owner.me.oidc_access_token | ||
session_token = data.coder_workspace_owner.me.session_token | ||
... | ||
``` | ||
|
||
->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). |