-
Notifications
You must be signed in to change notification settings - Fork 0
/
launch-template.tf
56 lines (47 loc) · 1.83 KB
/
launch-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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
######################################################################
# Copyright (c) 2021 Claudio André <claudioandre.br at gmail.com>
#
# This program comes with ABSOLUTELY NO WARRANTY; express or implied.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, as expressed in version 2, seen at
# http://www.gnu.org/licenses/gpl-2.0.html
######################################################################
resource "aws_launch_template" "web-server" {
name = "template-Directory-app"
description = "A web server for the employee directory application."
image_id = data.aws_ami.amazon-linux-2.id
instance_type = var.instance["instance_type"]
key_name = aws_key_pair.deploy.key_name
vpc_security_group_ids = [aws_security_group.webserver-sg.id]
user_data = filebase64("start-up.sh")
credit_specification {
cpu_credits = "standard"
}
iam_instance_profile {
name = aws_iam_instance_profile.profile.name
}
# Security group rule must be created before this IP address could
# actually be used, otherwise the services will be unreachable.
depends_on = [aws_security_group.webserver-sg]
tags = {
Name = "lt-employee-directory-app"
Environment = var.domain
"Application Role" = var.role
Owner = var.owner
Customer = var.customer
Confidentiality = var.confidentiality
}
tag_specifications {
resource_type = "instance"
tags = {
Name = "i-employee-directory-app"
Environment = var.domain
"Application Role" = var.role
Owner = var.owner
Customer = var.customer
Confidentiality = var.confidentiality
}
}
}