Ansible unable to fetch/use temporary credentials when using metadata (IMDSv2) in Amazon linux 2023

Yes Correct, the catch in my case was that I somehow had 2 versions of amazon.aws collection showing up
One was version 1.x another was version 6.x

and ansible was using the first in the list i.e. 1.x

Had to update ~/.ansible.cfg file with
“[defaults]
collections_path=/path/to/version6.x/ansible_collections”
and then additionally use the amazon.aws.ec2_instance module

Thankyou for the help, your answer guided me to get hold of my broken piece.