amazon-archives / awsmobile-cli

CLI experience for Frontend developers in the JavaScript ecosystem.
Apache License 2.0
142 stars 35 forks source link

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

Closed nwayve closed 6 years ago

nwayve commented 6 years ago

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.

nwayve commented 6 years ago

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