-
Notifications
You must be signed in to change notification settings - Fork 0
/
wab.tf
55 lines (46 loc) · 1.15 KB
/
wab.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
resource "aws_instance" "wab" {
ami = "ami-0a279a1895fc6d09d"
instance_type = "t3.small"
vpc_security_group_ids = [aws_security_group.sg_access.id]
subnet_id = aws_subnet.sc_access.id
key_name = aws_key_pair.ssh.key_name
associate_public_ip_address = false
tags = {
Name = "sidawswabadm01p"
}
}
resource "aws_route53_record" "wab" {
zone_id = aws_route53_zone.private.zone_id
name = aws_instance.wab.tags.Name
type = "A"
ttl = 300
records = [aws_instance.wab.private_ip]
}
resource "aws_route53_record" "wabcname" {
zone_id = aws_route53_zone.private.zone_id
name = "wab"
type = "CNAME"
ttl = 300
records = [
aws_route53_record.wab.fqdn,
]
}
resource "aws_security_group" "sg_admin_from_wab" {
name = "ACL Acces"
vpc_id = aws_vpc.sidera_cloud.id
tags = {
Name = "Admin access"
}
lifecycle {
create_before_destroy = true
}
depends_on = [
aws_instance.wab
]
ingress {
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = ["${aws_instance.wab.private_ip}/32"]
}
}