diff --git a/docs/resources/app.md b/docs/resources/app.md index 8f7c71cd..3b564862 100644 --- a/docs/resources/app.md +++ b/docs/resources/app.md @@ -26,11 +26,11 @@ EOF } resource "coder_app" "code-server" { - agent_id = coder_agent.dev.id - name = "VS Code" - icon = data.coder_workspace.me.access_url + "/icons/vscode.svg" - url = "http://localhost:13337" - relative_path = true + agent_id = coder_agent.dev.id + name = "VS Code" + icon = data.coder_workspace.me.access_url + "/icons/vscode.svg" + url = "http://localhost:13337" + subdomain = false healthcheck { url = "http://localhost:13337/healthz" interval = 5 @@ -66,7 +66,8 @@ resource "coder_app" "intellij" { - `healthcheck` (Block Set, Max: 1) HTTP health checking to determine the application readiness. (see [below for nested schema](#nestedblock--healthcheck)) - `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/icons. Use a built-in icon with `data.coder_workspace.me.access_url + "/icons/<path>"`. - `name` (String) A display name to identify the app. -- `relative_path` (Boolean) Specifies whether the URL will be accessed via a relative path or wildcard. Use if wildcard routing is unavailable. +- `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. +- `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. - `url` (String) A URL to be proxied to from inside the workspace. Either "command" or "url" may be specified, but not both. ### Read-Only diff --git a/examples/resources/coder_app/resource.tf b/examples/resources/coder_app/resource.tf index dfbde849..715f5814 100644 --- a/examples/resources/coder_app/resource.tf +++ b/examples/resources/coder_app/resource.tf @@ -11,11 +11,11 @@ EOF } resource "coder_app" "code-server" { - agent_id = coder_agent.dev.id - name = "VS Code" - icon = data.coder_workspace.me.access_url + "/icons/vscode.svg" - url = "http://localhost:13337" - relative_path = true + agent_id = coder_agent.dev.id + name = "VS Code" + icon = data.coder_workspace.me.access_url + "/icons/vscode.svg" + url = "http://localhost:13337" + subdomain = false healthcheck { url = "http://localhost:13337/healthz" interval = 5 diff --git a/provider/app.go b/provider/app.go index 51e60803..2e0485bb 100644 --- a/provider/app.go +++ b/provider/app.go @@ -60,12 +60,21 @@ func appResource() *schema.Resource { Optional: true, }, "relative_path": { - Type: schema.TypeBool, + Type: schema.TypeBool, + Deprecated: "`relative_path` on apps is deprecated, use `subdomain` instead.", Description: "Specifies whether the URL will be accessed via a relative " + - "path or wildcard. Use if wildcard routing is unavailable.", - ForceNew: true, - Optional: true, - ConflictsWith: []string{"command"}, + "path or wildcard. Use if wildcard routing is unavailable. Defaults to true.", + ForceNew: true, + Optional: true, + }, + "subdomain": { + Type: schema.TypeBool, + Description: "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.", + ForceNew: true, + Optional: true, }, "url": { Type: schema.TypeString, diff --git a/provider/app_test.go b/provider/app_test.go index 6513dcc4..f28ccaf6 100644 --- a/provider/app_test.go +++ b/provider/app_test.go @@ -29,7 +29,7 @@ func TestApp(t *testing.T) { agent_id = coder_agent.dev.id name = "code-server" icon = "builtin:vim" - relative_path = true + subdomain = false url = "http://localhost:13337" healthcheck { url = "http://localhost:13337/healthz" @@ -47,7 +47,7 @@ func TestApp(t *testing.T) { "agent_id", "name", "icon", - "relative_path", + "subdomain", "url", "healthcheck.0.url", "healthcheck.0.interval",