-
Notifications
You must be signed in to change notification settings - Fork 0
/
ec2-vm.tf
33 lines (29 loc) · 906 Bytes
/
ec2-vm.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
resource "aws_instance" "ec2" {
ami = var.ami
instance_type = var.itype
subnet_id = var.subnet #FFXsubnet2
associate_public_ip_address = var.publicip
user_data = templatefile(
"${path.module}/templates/cloud-init.yaml.tpl",
{
"package_update" = var.package_update
"package_upgrade" = var.package_upgrade
"init_username" = var.init_username
"init_sudo" = var.init_sudo
"init_pubkey" = var.init_pubkey
"init_groups" = var.init_groups
"packages" = var.packages
}
)
vpc_security_group_ids = [
aws_security_group.ec2-sg.id
]
root_block_device {
delete_on_termination = true
iops = 150
volume_size = 50
volume_type = "gp3"
}
tags = var.instance_tags
depends_on = [aws_security_group.ec2-sg]
}