Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exporting to credential file throws error #17

Closed
thomscode opened this issue Jul 26, 2023 · 2 comments
Closed

Exporting to credential file throws error #17

thomscode opened this issue Jul 26, 2023 · 2 comments

Comments

@thomscode
Copy link

I have the following ~/.aws/config file on an EC2. I know it seems redundant as it isn't assuming a role, but I need the named profile for my use case:

[profile myprofile]
credential_source = Ec2InstanceMetadata
region = us-west-2
output = json

When running aws-export-credentials --credentials-file-profile myprofile I receive the following error:

Traceback (most recent call last):
  File "/home/ubuntu/.local/bin/aws-export-credentials", line 8, in <module>
    sys.exit(main())
  File "/home/ubuntu/.local/lib/python3.10/site-packages/aws_export_credentials/aws_export_credentials.py", line 269, in main
    write_values(session, args.credentials_file_profile, values)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/aws_export_credentials/config_file_writer.py", line 54, in write_values
    session.get_config_variable('credentials_file'))
AttributeError: 'Session' object has no attribute 'get_config_variable'
@benkehoe
Copy link
Owner

It looks like I missed something when converting it from botocore to boto3. I've shipped v0.18 with a fix.

@thomscode
Copy link
Author

Confirmed, that solved it! Thanks for the quick fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants