Skip to content

Commit

Permalink
add launch template for batch with imdsv1 disabled
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Pickering <[email protected]>
  • Loading branch information
alexvpickering committed Nov 19, 2024
1 parent 983ec2f commit 7e1ae6a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion cf/batch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7e1ae6a

Please sign in to comment.