-
Notifications
You must be signed in to change notification settings - Fork 1
/
ec2.tf
29 lines (24 loc) · 946 Bytes
/
ec2.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
# Bastion Host Amazon Linux 2 Server
resource "aws_instance" "two_tier_bastion_host" {
ami = "ami-09988af04120b3591"
instance_type = "t2.micro"
key_name = aws_key_pair.two_tier_key_pair.key_name
subnet_id = module.public_subnet_1.id
vpc_security_group_ids = [aws_security_group.bastion_host_sg.id]
tags = {
Name = "Two-Tier-Bastion-Host"
}
}
# Servers in the application tier
module "Two-Tier-App-Server-01" {
source = "./modules/ec2"
Name = "Two-Tier_App_001"
subnet_id = module.private_subnet_1.id
vpc_security_group_ids = [aws_security_group.two_tier_app_sg.id]
}
module "Two-Tier-App-Server-02" {
source = "./modules/ec2"
Name = "Two-Tier_App_002"
subnet_id = module.private_subnet_2.id
vpc_security_group_ids = [aws_security_group.two_tier_app_sg.id]
}