Protect what matters – even after you're gone. Make a plan for your digital legacy today.
Forum Discussion
ynesterenko
2 years agoNew Contributor
Issue passing AWS CLI credentials to Boto3 Client
I've set up 1Password CLI with AWS plugin. It works as expected with direct command for AWS CLI, meaning aws sts get-caller-identity gets User ID, Account, and Arn as expected. Yet when I try to run a simple Boto3 script for some reason client is not able to recognize credentials.
Environment variables are set with following (actual names are placed correctly and tested in other commands).
AWS_ACCESS_KEY_ID=$(op read "op://vault-name/aws-credentials/Access Key ID")
AWS_SECRET_ACCESS_KEY=$(op read "op://vault-name/aws-credentials/Secret Access Key")
AWS_DEFAULT_REGION=$(op read "op://vault-name/aws-credentials/Default region")
script for boto3 as an example:
import boto3
iam_client = boto3.client('iam')
response = iam_client.list_users()
print(response)
Is there anything else I am missing here?
error: NoCredentialsError: Unable to locate credentials
1Password Version: 8.10.48
Extension Version: Not Provided
OS Version: macOS Sequoia 15.0.1
Browser: CLI
No RepliesBe the first to reply