I had a recent problem where I needed to disable IMDSv1 on an older application that could not be upgraded. The boto3 version was 1.8.9 and would require significant changes to support IMDSv2. Instead of upgrading, I was able to set the AWS config and credentials using puppet, using the EC2 instance profile role. This bypasses the calls boto3 makes to IMDS since the last option boto3 uses is to call IMDS to get credentials.
Leave a Reply