From 9c7e0d6fef0a1e7621acdc6dd3fcdad914eecd88 Mon Sep 17 00:00:00 2001 From: Jacob Gillespie Date: Tue, 8 Aug 2023 08:30:42 +0100 Subject: [PATCH] Enable IMDSv2 --- main.tf | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/main.tf b/main.tf index d15bca6..d402d7c 100644 --- a/main.tf +++ b/main.tf @@ -158,6 +158,11 @@ resource "aws_launch_template" "x86" { arn = aws_iam_instance_profile.instance[0].arn } + metadata_options { + http_tokens = "required" + http_put_response_hop_limit = 1 + } + network_interfaces { device_index = 0 associate_public_ip_address = true @@ -194,6 +199,11 @@ resource "aws_launch_template" "arm" { arn = aws_iam_instance_profile.instance[0].arn } + metadata_options { + http_tokens = "required" + http_put_response_hop_limit = 1 + } + network_interfaces { device_index = 0 associate_public_ip_address = true