Skip to content

Commit

Permalink
update windows-rdp to take share variable
Browse files Browse the repository at this point in the history
  • Loading branch information
bcpeinhardt committed Jul 23, 2024
1 parent 7e0eacf commit d2a34e2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions windows-rdp/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
} from "../test";

type TestVariables = Readonly<{
share: string;
agent_id: string;
resource_id: string;
admin_username?: string;
Expand Down Expand Up @@ -42,10 +43,12 @@ describe("Web RDP", async () => {
testRequiredVariables<TestVariables>(import.meta.dir, {
agent_id: "foo",
resource_id: "bar",
share: "owner"
});

it("Has the PowerShell script install Devolutions Gateway", async () => {
const state = await runTerraformApply<TestVariables>(import.meta.dir, {
share: "owner",
agent_id: "foo",
resource_id: "bar",
});
Expand Down Expand Up @@ -93,6 +96,7 @@ describe("Web RDP", async () => {
{
agent_id: "foo",
resource_id: "bar",
share: "owner"
},
);

Expand All @@ -111,6 +115,7 @@ describe("Web RDP", async () => {
const customizedState = await runTerraformApply<TestVariables>(
import.meta.dir,
{
share: "owner",
agent_id: "foo",
resource_id: "bar",
admin_username: customAdminUsername,
Expand Down
6 changes: 6 additions & 0 deletions windows-rdp/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ terraform {
}
}

variable "share" {
type = string
description = "The share level of the Coder app. Either 'owner' | 'authenticated' | 'public' "
}

variable "agent_id" {
type = string
description = "The ID of a Coder agent."
Expand Down Expand Up @@ -53,6 +58,7 @@ resource "coder_script" "windows-rdp" {

resource "coder_app" "windows-rdp" {
agent_id = var.agent_id
share = var.share
slug = "web-rdp"
display_name = "Web RDP"
url = "http://localhost:7171"
Expand Down

0 comments on commit d2a34e2

Please sign in to comment.