-
Notifications
You must be signed in to change notification settings - Fork 0
/
unused_code.tf
55 lines (47 loc) · 1.74 KB
/
unused_code.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
/*
# Attaching the WebServer01 with our Target Group
resource "aws_lb_target_group_attachment" "external-lb-attach01" {
target_group_arn = aws_lb_target_group.external_elb.arn
target_id = aws_instance.webserver1.id
port = 80
depends_on = [
aws_instance.webserver1,
]
}
# Attaching the WebServer02 with our Target Group
resource "aws_lb_target_group_attachment" "external-lb-attach02" {
target_group_arn = aws_lb_target_group.external_elb.arn
target_id = aws_instance.webserver2.id
port = 80
depends_on = [
aws_instance.webserver2,
]
}
*/
/* ## CREATING THE WEB SERVER INSTANCES
# Web Server 01
resource "aws_instance" "webserver1" {
ami = "ami-0cff7528ff583bf9a"
instance_type = "t2.micro"
availability_zone = "us-east-1a" # Mentioning since we want to achieve uptime even if a whole AZ goes down
vpc_security_group_ids = [aws_security_group.webserver-sg.id]
subnet_id = aws_subnet.web-subnet-01.id
user_data = file("/home/rafay/Downloads/terraform-practice/StartingWithLoadBalancers/install-apache.sh")
tags = {
Name = "Web-Server-1a"
}
}
# Web Server 02
resource "aws_instance" "webserver2" {
ami = "ami-0cff7528ff583bf9a"
instance_type = "t2.micro"
availability_zone = "us-east-1b" # Mentioning since we want to achieve uptime even if a whole AZ goes down
vpc_security_group_ids = [aws_security_group.webserver-sg.id]
subnet_id = aws_subnet.web-subnet-02.id
user_data = file("/home/rafay/Downloads/terraform-practice/StartingWithLoadBalancers/install-apache.sh")
tags = {
Name = "Web-Server-1b"
}
}
## Web Server Instances Block Completed
*/