|
| 1 | +--- |
| 2 | +page_title: "Migrate from v1 to v2" |
| 3 | +--- |
| 4 | + |
| 5 | +# Migrate from v1 to v2 |
| 6 | + |
| 7 | +Version 2.0.0 of the Coder provider for Terraform is a major release that removes the following deprecated data sources and their properties: |
| 8 | + |
| 9 | +- `coder_git_auth` data source |
| 10 | +- All owner properties from the [`coder_workspace`](../docs/data-sources/workspace.md) data source |
| 11 | + |
| 12 | +## Migrating `coder_git_auth` data source |
| 13 | + |
| 14 | +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. |
| 15 | + |
| 16 | +### v1.0.0 |
| 17 | +```terraform |
| 18 | + |
| 19 | +data "coder_git_auth" "example" { |
| 20 | + id = "example" |
| 21 | +} |
| 22 | +``` |
| 23 | +### v2.0.0 |
| 24 | +```terraform |
| 25 | +data "coder_external_auth" "example" { |
| 26 | + id = "example" |
| 27 | +} |
| 28 | +``` |
| 29 | + |
| 30 | + |
| 31 | +## Migrating `coder_workspace` data source |
| 32 | + |
| 33 | +If you are using the `owner` properties of the `coder_workspace` data source, you must remove them and use the `coder_workspace_owner` data source instead. The `coder_workspace_owner` data source is a more generic data source that provide additional properties of the workspace owner. |
| 34 | + |
| 35 | +| `v1.0.0` | `v2.0.0` | |
| 36 | +|-----------|----------| |
| 37 | +| `data.coder_workspace.me.owner_id` | `data.coder_workspace_owner.me.id` | |
| 38 | +| `data.coder_workspace.me.owner` | `data.coder_workspace_owner.me.name` | |
| 39 | +| `data.coder_workspace.me.owner_name` | `data.coder_workspace_owner.me.full_name` | |
| 40 | +| `data.coder_workspace.me.owner_email` | `data.coder_workspace_owner.me.email` | |
| 41 | +| `data.coder_workspace.me.owner_groups` | `data.coder_workspace_owner.me.groups` | |
| 42 | +| `data.coder_workspace.me.owner_oidc_access_token` | `data.coder_workspace_owner.me.oidc_access_token` | |
| 43 | +| `data.coder_workspace.me.owner_session_token` | `data.coder_workspace_owner.me.session_token` | |
| 44 | + |
| 45 | +->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). |