Skip to content

Commit f8a5894

Browse files
authored
chore(e2e): Update windows worker module to support other configs (#6077)
1 parent 394c069 commit f8a5894

File tree

4 files changed

+85
-8
lines changed

4 files changed

+85
-8
lines changed

enos/modules/aws_rdp_member_server_with_worker/main.tf

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -311,11 +311,12 @@ resource "local_file" "worker_config" {
311311
enos_local_exec.add_boundary_cli,
312312
]
313313
content = templatefile("${path.module}/scripts/worker.hcl", {
314-
controller_ip = var.controller_ip
315-
aws_kms_key = data.aws_kms_key.kms_key.id
316-
aws_region = var.aws_region
317-
worker_public_ip = aws_instance.worker.public_ip
318-
test_dir = local.test_dir
314+
controller_ip = var.controller_ip
315+
aws_kms_key = data.aws_kms_key.kms_key.id
316+
aws_region = var.aws_region
317+
worker_public_ip = aws_instance.worker.public_ip
318+
test_dir = local.test_dir
319+
hcp_boundary_cluster_id = var.hcp_boundary_cluster_id
319320
})
320321
filename = "${path.root}/.terraform/tmp/worker.hcl"
321322
}

enos/modules/aws_rdp_member_server_with_worker/scripts/worker.hcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# disable memory from being swapped to disk
55
disable_mlock = true
66

7-
# Increase log level for debuggin
7+
# Increase log level for debugging
88
log_level = "debug"
99

1010
# listener denoting this is a worker proxy
@@ -20,7 +20,7 @@ worker {
2020
name = "win-worker-0"
2121
initial_upstreams = ["[${controller_ip}]:9201"]
2222
tags {
23-
type = ["worker", "egress", "windows"]
23+
type = ["worker", "rdp", "windows"]
2424
}
2525
}
2626

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Copyright (c) HashiCorp, Inc.
2+
# SPDX-License-Identifier: BUSL-1.1
3+
4+
# disable memory from being swapped to disk
5+
disable_mlock = true
6+
7+
# Increase log level for debugging
8+
log_level = "debug"
9+
10+
# listener denoting this is a worker proxy
11+
listener "tcp" {
12+
address = "0.0.0.0:9202"
13+
purpose = "proxy"
14+
}
15+
16+
hcp_boundary_cluster_id = "${hcp_boundary_cluster_id}"
17+
18+
# worker block for configuring the specifics of the
19+
# worker service
20+
worker {
21+
public_addr = "${worker_public_ip}"
22+
tags {
23+
type = ["worker", "rdp", "windows"]
24+
}
25+
26+
auth_storage_path = "${test_dir}/worker"
27+
recording_storage_path = "${test_dir}/recordings"
28+
}
29+
30+
# Events (logging) configuration. This
31+
# configures logging for ALL events to both
32+
# stderr and a file at ${test_dir}<boundary_use>.log
33+
events {
34+
audit_enabled = true
35+
sysevents_enabled = true
36+
observations_enable = true
37+
sink "stderr" {
38+
name = "all-events"
39+
description = "All events sent to stderr"
40+
event_types = ["*"]
41+
format = "cloudevents-json"
42+
}
43+
sink {
44+
name = "file-sink"
45+
description = "All events sent to a file"
46+
event_types = ["*"]
47+
format = "cloudevents-json"
48+
file {
49+
path = "${test_dir}"
50+
file_name = "worker.log"
51+
}
52+
audit_config {
53+
audit_filter_overrides {
54+
sensitive = "redact"
55+
secret = "redact"
56+
}
57+
}
58+
}
59+
}

enos/modules/aws_rdp_member_server_with_worker/variables.tf

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,21 @@ variable "domain_controller_private_key" {
109109
variable "domain_controller_sec_group_id_list" {
110110
type = list(any)
111111
description = "ID's of AWS Network Security Groups created during creation of the domain controller."
112-
}
112+
}
113+
114+
# =================================================================
115+
# Boundary Worker Configuration
116+
# =================================================================
117+
variable "worker_config_file_path" {
118+
description = "Path to config file to use (relative to module directory)"
119+
type = string
120+
default = "scripts/worker.hcl"
121+
}
122+
123+
variable "hcp_boundary_cluster_id" {
124+
description = "ID of the Boundary cluster in HCP"
125+
type = string
126+
default = ""
127+
// If using HCP int, ensure that the cluster id starts with "int-"
128+
// Example: "int-19283a-123123-..."
129+
}

0 commit comments

Comments
 (0)