-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathms_cd.tf
More file actions
38 lines (30 loc) · 1.15 KB
/
ms_cd.tf
File metadata and controls
38 lines (30 loc) · 1.15 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
data "template_file" "ms_cd_init" {
template = file(var.ms_cd_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.ms_cd_hostname
ud_machine_local_admin_pass = var.ms_cd_local_admin_pass
ud_machine_install_script_path = var.ps_install_script_path
ud_machine_transcript_path = var.ps_transcript_path
ud_user_shared_local_admin_username = var.user_shared_local_admin_username
ud_user_shared_local_admin_pass = var.user_shared_local_admin_pass
}
}
resource "aws_instance" "windows_ms_cd" {
ami = data.aws_ami.windows.id
instance_type = var.instance_type
subnet_id = aws_subnet.network_subnet.id
private_ip = var.ms_cd_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.ms_cd_init.rendered
tags = {
Name = var.ms_cd_hostname
}
}
output "ms_cd_password" {
value = rsadecrypt(aws_instance.windows_ms_cd.password_data, file(var.ssh_key_private_path))
}