To comply with security best practices, the IMDSv1 must be disabled on your EC2 instances. If your test flags the autoscaling group, you’ll need to modify the launch template to ensure the Metadata version is set to "V2 only." Follow these steps to update your launch template via the AWS dashboard:
Navigate to AWS Console: Go to Launch Templates.
Modify the Launch Template: Select your current template to edit.
Update Metadata Version:
Under Advanced Details, locate the Metadata version setting.
Select V2 only (token required).
By making these changes, your EC2 instances will be configured to use IMDSv2, enhancing the security of your environment.