Ansible EC2 metatadata options?

I'm trying to get Ansible EC2 to provision instances that require IMDSV2.

Through the aws ec2 run-instances I'm able to do it by adding --metadata-options "HttpEndpoint=enabled,HttpTokens=required" to my command.

I'm not seeing a matching option in the Ansible EC2 module?

I'm sure I'm missing something basic.


Solution 1:

You're not missing anything, Ansible's AWS modules often fail to support new features in a timely manner due to a combination of technical debt and lack of active developers.

In this case support for metadata options was added five days ago in this commit.

Since this is not yet included in any release you would need to install the development version of this collection in order to use this feature.