amazon-archives/awsmobile-cli

profile [foo] is not found in aws-cli credentials file

Closed this issue · 1 comments

aws-cli version: 1.15.59
awsmobile-cli version: 1.1.4

aws --profile foo s3 ls
Lists my S3 buckets using the foo profile defined in my ~/.aws/credentials file.

> awsmobile configure --profile foo
configure aws
Setting awsmobile-cli to use named profile: foo

profile foo is not found in aws-cli credentials file
aws-cli credentials file queried:
C:\Users\me\.aws\credentials

My ~/.aws/credentials file:

[default]
aws_access_key_id = AzureDiamond
aws_secret_access_key = hunter2

[foo]
region = us-east-2
role_arn = arn:aws:iam::123456789012:role/rolly-mc-role-face
source_profile = default

My credentials file has the profile defined. I can reference it using the aws-cli, but the awsmobile-cli is not able to find it using the same credentials file the aws-cli uses.

Found what I was doing wrong, and I feel a bit silly about it. Was trying to run this command under my "foo" profile in my ~/.aws/credentials file. The solution I found under this Github issue.

In short, just needed to run the command awsmobile configure aws --profile foo