From 7e1ae6a9a99b45f9604560c9eb0f5552ca6b09be Mon Sep 17 00:00:00 2001 From: Alex Pickering Date: Tue, 19 Nov 2024 11:35:44 -0800 Subject: [PATCH] add launch template for batch with imdsv1 disabled Signed-off-by: Alex Pickering --- cf/batch.yaml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/cf/batch.yaml b/cf/batch.yaml index e8030ecaf7..3fdcfe8490 100644 --- a/cf/batch.yaml +++ b/cf/batch.yaml @@ -15,7 +15,16 @@ Conditions: - !Ref Environment - production -Resources: + # Define the Launch Template with Metadata Options + BatchLaunchTemplate: + Type: AWS::EC2::LaunchTemplate + Properties: + LaunchTemplateName: !Sub "launch-template-${Environment}" + LaunchTemplateData: + MetadataOptions: + HttpTokens: required + HttpEndpoint: enabled + BatchComputeEnvironment: Type: AWS::Batch::ComputeEnvironment Properties: @@ -52,6 +61,9 @@ Resources: - Fn::ImportValue: !Sub "eksctl-biomage-${Environment}-cluster::SecurityGroup" Subnets: Fn::Split: [',', Fn::ImportValue: !Sub "eksctl-biomage-${Environment}-cluster::SubnetsPrivate"] + LaunchTemplate: + LaunchTemplateId: !Ref BatchLaunchTemplate + Version: !GetAtt BatchLaunchTemplate.LatestVersionNumber BatchJobQueue: Type: AWS::Batch::JobQueue