-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain-puppet-client.tf
69 lines (58 loc) · 1.85 KB
/
main-puppet-client.tf
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
module "puppet-client" {
source = "./modules/gp-instance"
enabled = var.puppet
subnet_id = aws_subnet.a.id
sg_ids = [aws_default_security_group.sg.id, aws_security_group.puppet-client.id]
region = var.region
hostname = "puppet-client-${var.suffix_hostname}"
route53_zoneID = var.route53_zoneID
dnsupdate_rolearn = var.dnsupdate_rolearn
dnsupdate_region = var.dnsupdate_region
public_ip = true
instance_type = "t3.small"
template_path = "${path.module}/templates/puppet-client-user_data.tpl"
template_vars = {
hostname = module.puppet-client.hostname
keypubic = var.keypublic
username = var.username
master_hostname = module.puppet-server.hostname
}
ipv6 = var.ipv6
username = var.username
keypublic = var.keypublic
tags = {
Name = "${var.vpcname}-puppet-client"
environment = var.environment
deployment = var.deployment
OWNER = var.OWNER
ROLE = var.ROLE
AlwaysOn = var.AlwaysOn
}
}
# Final Output summarising VPN Credentials, IP Addresses and DNS Names
output "Puppet_Client_Hostname" {
# sensitive = true
value = var.puppet ? module.puppet-client.internal_hostname : ""
}
########################
# SECURITY GROUP #
########################
resource "aws_security_group" "puppet-client" {
vpc_id = aws_vpc.vpc.id
name = "${var.vpcname}_puppet-client"
description = "${var.vpcname} puppet client"
egress {
from_port = 8140
to_port = 8140
protocol = "tcp"
security_groups = [aws_security_group.puppet-server.id]
}
tags = {
Name = "${var.vpcname}_puppet-client"
environment = var.environment
deployment = var.deployment
OWNER = var.OWNER
ROLE = var.ROLE
AlwaysOn = var.AlwaysOn
}
}