Skip to content

Commit 8c25793

Browse files
committed
Allow configurable launch template settings
1 parent 76992e9 commit 8c25793

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,11 +276,11 @@ resource "aws_launch_template" "default" {
276276
user_data = base64encode(var.user_data)
277277

278278
monitoring {
279-
enabled = true
279+
enabled = var.detailed_monitoring
280280
}
281281

282282
network_interfaces {
283-
associate_public_ip_address = false
283+
associate_public_ip_address = var.associate_public_ip_address
284284
delete_on_termination = true
285285
security_groups = concat(var.additional_security_group_ids, [aws_security_group.default.id])
286286
}

variables.tf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,19 @@ variable "additional_security_group_ids" {
6262
default = []
6363
}
6464

65+
variable "detailed_monitoring" {
66+
description = "Enable detailed monitoring of instance"
67+
type = bool
68+
default = true
69+
}
70+
71+
variable "associate_public_ip_address" {
72+
description = "Associate public IP address"
73+
type = bool
74+
# default should fall back to subnet setting
75+
default = null
76+
}
77+
6578
######################
6679
## SESSION LOGGING ##
6780
####################

0 commit comments

Comments
 (0)