Question: **Background:-**I have a gateway account( with no permissions) in which users are created and in order to access aws resources we use roles having admin access.

**config file**

```
[profile gateway]
region = ap-southeast-1
output = json

[profile DA]

region = ap-south-1
output = json
role_arn = arn:aws:iam::xxxxxxxxxxxxx:role/jatin
mfa_serial = arn:aws:iam::xxxxxxxxxx:mfa/atin
source_profile = gateway

```

credentials file

```
[gateway]
aws_access_key_id=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
aws_secret_access_key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

```

Now I am trying to deploy my lambda using serverless deploy --aws-profile "DA", it says `AWS profile "DA" doesn't seem to be configured`

however, if I run `aws s3 ls --profile "DA"` its works perfectly, so i guess there is no problem with the configuration of profiles and credentials

Answer: 
This is a known issue with Serverless, Serverless only checks `~/.aws/credentials` for the profile and not `~/.aws/config`.

There are multiple Serverless forum posts about this, [e.g. this one](https://forum.serverless.com/t/sample-serverless-yml-for-multiple-aws-accounts-needed/1528/12).

Change your `~/.aws/credentials` file to this and it should work:

```
[gateway]
aws_access_key_id=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
aws_secret_access_key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

[DA]
aws_access_key_id=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
aws_secret_access_key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
role_arn = arn:aws:iam::xxxxxxxxxxxxx:role/jatin
mfa_serial = arn:aws:iam::xxxxxxxxxx:mfa/atin
source_profile = gateway

```
A better solution is to specify `AWS_SDK_LOAD_CONFIG=1` without messing with your credentials:
`AWS_SDK_LOAD_CONFIG=1 sls deploy`