Fix AWS launch template to retain support for IMDVv1

* AWS has recently started defaulting launch templates to IMDSv2
being "required". aws_launch_template is supposed to default to
"optional" but it doesn't.
* Requiring IMDSv2 sessions breaks a number of applications which
don't use AWS SDKs and were never meant to be complex applications
(e.g. shell scripts and the like)
This commit is contained in:
Dalton Hubble 2024-02-04 10:38:50 -08:00
parent 4d4c5413de
commit 808eafd178
2 changed files with 10 additions and 0 deletions

View File

@ -78,6 +78,11 @@ resource "aws_launch_template" "worker" {
# network
vpc_security_group_ids = var.security_groups
# metadata
metadata_options {
http_tokens = "optional"
}
# spot
dynamic "instance_market_options" {
for_each = var.spot_price > 0 ? [1] : []

View File

@ -78,6 +78,11 @@ resource "aws_launch_template" "worker" {
# network
vpc_security_group_ids = var.security_groups
# metadata
metadata_options {
http_tokens = "optional"
}
# spot
dynamic "instance_market_options" {
for_each = var.spot_price > 0 ? [1] : []