I’ve migrated all my instances to IMDSv2, but I’m not sure how to ensure that all future instances have IMDSv2 enabled by default. How can I do that?
Question posted in Amazon Web Sevices
The official Amazon Web Services documentation can be found here.
The official Amazon Web Services documentation can be found here.
2
Answers
Assuming you're using the latest version of the AWS CLI, you can run the following:
You can also achieve this via the EC2 console.
This will allow you to set the IMDS defaults at the account level for new instance launches in the region that you are in when making this change.
For some other context, when no preference is selected for the IMDS default settings the IMDS settings/values will come from either the AMI or the instance configuraiton.
I hope this helps 🙂