-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathws_http.tf
More file actions
43 lines (34 loc) · 1.35 KB
/
ws_http.tf
File metadata and controls
43 lines (34 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
data "template_file" "ws_http_init" {
template = file(var.ws_http_install_script_tpl)
vars = {
ud_domain = var.domain_full
ud_user_domain_join_username = var.user_domain_join_username
ud_user_domain_join_pass = var.user_domain_join_pass
ud_machine_hostname = var.ws_http_hostname
ud_machine_local_admin_pass = var.ws_http_local_admin_pass
ud_machine_install_script_path = var.ps_install_script_path
ud_machine_transcript_path = var.ps_transcript_path
ud_sched_task_path = var.ps_sched_task_path
ud_sched_task_name = var.ws_http_sched_task_name
ud_sched_task_username = var.user_http_sched_task_username
ud_sched_task_pass = var.user_http_sched_task_pass
ud_sched_task_group = var.user_http_sched_task_group
ud_attacker_ip = var.network_wireguard_client_ip
}
}
resource "aws_instance" "windows_ws_http" {
ami = data.aws_ami.windows.id
instance_type = var.instance_type
subnet_id = aws_subnet.network_subnet.id
private_ip = var.ws_http_ip
security_groups = [aws_security_group.network_secgroup.id]
key_name = aws_key_pair.deployer.key_name
get_password_data = "true"
user_data = data.template_file.ws_http_init.rendered
tags = {
Name = var.ws_http_hostname
}
}
output "ws_http_password" {
value = rsadecrypt(aws_instance.windows_ws_http.password_data, file(var.ssh_key_private_path))
}