❯ ansible-inventory -i ~/.ansible/inventory/testing.aws_ec2.yaml --graph
Enter MFA code for arn:aws:iam::88888888:mfa/u:
Enter MFA code for arn:aws:iam::88888888:mfa/u:
Enter MFA code for arn:aws:iam::88888888:mfa/u:
Enter MFA code for arn:aws:iam::88888888:mfa/u:
Expected Results
I expect that when I enter my OTP at the Enter MFA code prompt the plugin should continue and generate an inventory. Instead it repeatedly re-prompts for the OTP until giving up. I am 100% confident I am entering the correct code. All other tooling I use with boto3 works with my .aws/config.
Actual Results
[WARNING]: * Failed to parse /Users/u/.ansible/inventory/testing.aws_ec2.yaml with
ansible_collections.amazon.aws.plugins.inventory.aws_ec2 plugin: Failed to describe instances: An error occurred
(AccessDenied) when calling the AssumeRole operation: MultiFactorAuthentication failed with invalid MFA one time
pass code.
Summary
aws_ec2
fails to generate an inventory when using AWS credentials that require MFA.Issue Type
Bug Report
Component Name
ansible_collections.amazon.aws.plugins.inventory.aws_ec2
Ansible Version
Collection Versions
AWS SDK versions
Configuration
OS / Environment
Steps to Reproduce
❯ cat ~/.ansible/inventory/testing.aws_ec2.yaml
Expected Results
I expect that when I enter my OTP at the
Enter MFA code
prompt the plugin should continue and generate an inventory. Instead it repeatedly re-prompts for the OTP until giving up. I am 100% confident I am entering the correct code. All other tooling I use with boto3 works with my.aws/config
.Actual Results
Code of Conduct