-
Notifications
You must be signed in to change notification settings - Fork 0
/
ec2-template.tf
42 lines (32 loc) · 867 Bytes
/
ec2-template.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
resource "aws_launch_template" "webapp" {
name = "${var.environment}-${var.launch_template_name}"
block_device_mappings {
device_name = "/dev/xvda"
ebs {
volume_size = var.volume_size
volume_type = var.volume_type
encrypted = var.encrypted
}
}
image_id = var.ami
instance_type = var.instance_type
vpc_security_group_ids = [aws_security_group.webapp-instance-sg.id]
iam_instance_profile {
name = "${var.environment}-webapp-profile"
}
monitoring {
enabled = true
}
metadata_options {
http_tokens = "required"
}
tag_specifications {
resource_type = "instance"
tags = {
Name = "${var.environment}-webapp"
description = "${var.environment} webapp application"
owner = var.owner
}
}
user_data = filebase64(var.user_data)
}