{"action":"created","issue":{"url":"https://api.github.com/repos/serverless/serverless/issues/3833","repository_url":"https://api.github.com/repos/serverless/serverless","labels_url":"https://api.github.com/repos/serverless/serverless/issues/3833/labels{/name}","comments_url":"https://api.github.com/repos/serverless/serverless/issues/3833/comments","events_url":"https://api.github.com/repos/serverless/serverless/issues/3833/events","html_url":"https://github.com/serverless/serverless/issues/3833","id":237972891,"node_id":"MDU6SXNzdWUyMzc5NzI4OTE=","number":3833,"title":"Serverless using AWS profiles only half working","user":{"login":"enriquemanuel","id":1172970,"node_id":"MDQ6VXNlcjExNzI5NzA=","avatar_url":"https://avatars2.githubusercontent.com/u/1172970?v=4","gravatar_id":"","url":"https://api.github.com/users/enriquemanuel","html_url":"https://github.com/enriquemanuel","followers_url":"https://api.github.com/users/enriquemanuel/followers","following_url":"https://api.github.com/users/enriquemanuel/following{/other_user}","gists_url":"https://api.github.com/users/enriquemanuel/gists{/gist_id}","starred_url":"https://api.github.com/users/enriquemanuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enriquemanuel/subscriptions","organizations_url":"https://api.github.com/users/enriquemanuel/orgs","repos_url":"https://api.github.com/users/enriquemanuel/repos","events_url":"https://api.github.com/users/enriquemanuel/events{/privacy}","received_events_url":"https://api.github.com/users/enriquemanuel/received_events","type":"User","site_admin":false},"labels":[{"id":511594798,"node_id":"MDU6TGFiZWw1MTE1OTQ3OTg=","url":"https://api.github.com/repos/serverless/serverless/labels/help%20wanted","name":"help wanted","color":"0e8a16","default":true},{"id":484055955,"node_id":"MDU6TGFiZWw0ODQwNTU5NTU=","url":"https://api.github.com/repos/serverless/serverless/labels/kind/feature","name":"kind/feature","color":"AAB3AB","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":36,"created_at":"2017-06-22T21:01:54Z","updated_at":"2018-08-07T21:05:21Z","closed_at":null,"author_association":"NONE","body":"<!--\r\n1. If you have a question and not a bug/feature request please ask it at http://forum.serverless.com\r\n2. Please check if an issue already exists so there are no duplicates\r\n3. Check out and follow our Guidelines: https://github.com/serverless/serverless/blob/master/CONTRIBUTING.md\r\n4. Fill out the whole template so we have a good overview on the issue\r\n5. Do not remove any section of the template. If something is not applicable leave it empty but leave it in the Issue\r\n6. Please follow the template, otherwise we'll have to ask you to update it\r\n-->\r\n\r\n# This is a Bug Report\r\n\r\n## Description\r\nWhen using the `serverless deploy --aws-profile` or using the `EXPORT AWS_PROFILE=<profile>; serverless deploy` or the `AWS_PROFILE=<profile> serverless deploy` it only reads from the credentials file, but that should also be reading from the config file like the default `aws cli` tools does.\r\n\r\nFor example I have the following two files\r\n```\r\n~/.aws/config\r\n[default]\r\naws_access_key_id = <>\r\naws_secret_access_key = <>\r\n\r\n~/.aws/credentials\r\n[profile default]\r\noutput = json\r\nregion = us-east-1\r\n\r\n[profile dev]\r\nrole_arn = <cross_account_role>\r\nsource_profile = <another_profile>\r\nmfa_serial = <mfa_serial>\r\nregion = us-east-1\r\noutput = json\r\n```\r\n\r\nIf I run `serverless deploy --profile dev` it will fail with \r\n```\r\nServerlessError: AWS provider credentials not found. You can find more info on how to set up provider credentials in our docs here: https://git.io/vXsdd\r\n```\r\n\r\nThen I tried `AWS_PROFILE=dev serverless deploy` and it failed with the above error\r\n\r\nAnd finally I ran `export AWS_PROFILE=\"dev\" && export AWS_REGION=us-east-1` and then ran the `serverless deploy` and the same error occur.\r\n\r\nSo reading more in depth the above small link and talking to people on Gitter I moved that dev profile to `~/.aws/config`, creating new keys since the previous used a cross account mfa role.\r\n\r\nIts my experience using Troposphere and tools that rely on AWS Profiles, they should be looking into all of them and if they have an mfa, request the code about it.\r\n\r\n\r\n## Additional Data\r\n\r\n* ***Serverless Framework Version you're using***: 1.15.3\r\n* ***Operating System***: Mac OS 10.12.5\r\n* ***Stack Trace***: Shown above\r\n\r\n## Workaround\r\n\r\nCreate an additional profile and store it inside the ~/.aws/config to use and then you can refer to it using --profile <profile>"},"comment":{"url":"https://api.github.com/repos/serverless/serverless/issues/comments/411202267","html_url":"https://github.com/serverless/serverless/issues/3833#issuecomment-411202267","issue_url":"https://api.github.com/repos/serverless/serverless/issues/3833","id":411202267,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMTIwMjI2Nw==","user":{"login":"SaMnCo","id":2324599,"node_id":"MDQ6VXNlcjIzMjQ1OTk=","avatar_url":"https://avatars3.githubusercontent.com/u/2324599?v=4","gravatar_id":"","url":"https://api.github.com/users/SaMnCo","html_url":"https://github.com/SaMnCo","followers_url":"https://api.github.com/users/SaMnCo/followers","following_url":"https://api.github.com/users/SaMnCo/following{/other_user}","gists_url":"https://api.github.com/users/SaMnCo/gists{/gist_id}","starred_url":"https://api.github.com/users/SaMnCo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SaMnCo/subscriptions","organizations_url":"https://api.github.com/users/SaMnCo/orgs","repos_url":"https://api.github.com/users/SaMnCo/repos","events_url":"https://api.github.com/users/SaMnCo/events{/privacy}","received_events_url":"https://api.github.com/users/SaMnCo/received_events","type":"User","site_admin":false},"created_at":"2018-08-07T21:05:21Z","updated_at":"2018-08-07T21:05:21Z","author_association":"NONE","body":"That is good knowledge for myself and team as well, thanks for sharing.\nI'll add an unset for that one in our makefiles.\n\nI am glad you were able to sort it out, have fun with serverless now :)\n\nOn Aug 7, 2018 22:27, \"Andrés Mijares\" <notifications@github.com> wrote:\n\n@SaMnCo <https://github.com/SaMnCo> dude! thank u a lot for you\nexplanation, I was able to debug it all down, my problem was that I was\nexporting the AWS_PROFILE variable and somehow it was creating problems,\nthank u a lot.\n\n—\nYou are receiving this because you were mentioned.\nReply to this email directly, view it on GitHub\n<https://github.com/serverless/serverless/issues/3833#issuecomment-411190679>,\nor mute the thread\n<https://github.com/notifications/unsubscribe-auth/ACN4d_fGTud6pUIuaJhF0OHPVX5RV7wZks5uOfgqgaJpZM4OC159>\n.\n"}}
{"actor":{"display_login":"SaMnCo"}}