File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -302,6 +302,12 @@ resource "aws_launch_template" "default" {
302
302
lifecycle {
303
303
create_before_destroy = true
304
304
}
305
+
306
+ metadata_options {
307
+ http_endpoint = " enabled"
308
+ http_tokens = var. enable_imdsv2 ? " required" : " optional"
309
+ http_protocol_ipv6 = var. metadata_ipv6 ? " enabled" : " disabled"
310
+ }
305
311
}
306
312
307
313
resource "aws_autoscaling_group" "default" {
Original file line number Diff line number Diff line change @@ -75,6 +75,18 @@ variable "associate_public_ip_address" {
75
75
default = null
76
76
}
77
77
78
+ variable "enable_imdsv2" {
79
+ description = " Enable IMDSv2"
80
+ type = bool
81
+ default = true
82
+ }
83
+
84
+ variable "metadata_ipv6" {
85
+ description = " Enable IPv6 metadata endpoint"
86
+ type = bool
87
+ default = false
88
+ }
89
+
78
90
# #####################
79
91
# # SESSION LOGGING ##
80
92
# ###################
You can’t perform that action at this time.
0 commit comments