{"action":"created","comment":{"url":"https://api.github.com/repos/aws-amplify/amplify-cli/pulls/comments/245134777","pull_request_review_id":189184920,"id":245134777,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0NTEzNDc3Nw==","diff_hunk":"@@ -54,76 +55,107 @@ function setProfile(awsConfig, profileName) {\n   fs.writeFileSync(configFilePath, ini.stringify(config));\n }\n \n-function getProfile(profileName) {\n+async function getProfiledAwsConfig(profileName, isRoleSourceProfile) {\n   let awsConfig;\n-  if (fs.existsSync(credentialsFilePath) && fs.existsSync(configFilePath)) {\n-    let accessKeyId;\n-    let secretAccessKey;\n-    let region;\n+  const profileConfig = getProfileConfig(profileName);\n+  if (profileConfig) {\n+    if (!isRoleSourceProfile && profileConfig.role_arn && profileConfig.source_profile) {\n+      const roleCredentials =\n+        await getRoleCredentials(profileConfig);\n+      delete profileConfig.role_arn;\n+      delete profileConfig.source_profile;\n+      awsConfig = {\n+        ...profileConfig,\n+        ...roleCredentials,\n+      };\n+    } else {","path":"packages/amplify-provider-awscloudformation/lib/system-config-manager.js","position":27,"original_position":27,"commit_id":"f671e2c8ae075be56146dd1566986f71fea1c4ee","original_commit_id":"f671e2c8ae075be56146dd1566986f71fea1c4ee","user":{"login":"kaustavghosh06","id":7247658,"node_id":"MDQ6VXNlcjcyNDc2NTg=","avatar_url":"https://avatars0.githubusercontent.com/u/7247658?v=4","gravatar_id":"","url":"https://api.github.com/users/kaustavghosh06","html_url":"https://github.com/kaustavghosh06","followers_url":"https://api.github.com/users/kaustavghosh06/followers","following_url":"https://api.github.com/users/kaustavghosh06/following{/other_user}","gists_url":"https://api.github.com/users/kaustavghosh06/gists{/gist_id}","starred_url":"https://api.github.com/users/kaustavghosh06/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaustavghosh06/subscriptions","organizations_url":"https://api.github.com/users/kaustavghosh06/orgs","repos_url":"https://api.github.com/users/kaustavghosh06/repos","events_url":"https://api.github.com/users/kaustavghosh06/events{/privacy}","received_events_url":"https://api.github.com/users/kaustavghosh06/received_events","type":"User","site_admin":false},"body":"Not sure as to in which case this branch would get hit?","created_at":"2019-01-03T21:12:51Z","updated_at":"2019-01-03T21:12:51Z","html_url":"https://github.com/aws-amplify/amplify-cli/pull/645#discussion_r245134777","pull_request_url":"https://api.github.com/repos/aws-amplify/amplify-cli/pulls/645","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/aws-amplify/amplify-cli/pulls/comments/245134777"},"html":{"href":"https://github.com/aws-amplify/amplify-cli/pull/645#discussion_r245134777"},"pull_request":{"href":"https://api.github.com/repos/aws-amplify/amplify-cli/pulls/645"}}},"pull_request":{"url":"https://api.github.com/repos/aws-amplify/amplify-cli/pulls/645","id":241614290,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQxNjE0Mjkw","html_url":"https://github.com/aws-amplify/amplify-cli/pull/645","diff_url":"https://github.com/aws-amplify/amplify-cli/pull/645.diff","patch_url":"https://github.com/aws-amplify/amplify-cli/pull/645.patch","issue_url":"https://api.github.com/repos/aws-amplify/amplify-cli/issues/645","number":645,"state":"open","locked":false,"title":"feat(amplify-provider-awscloudformation): assume role","user":{"login":"UnleashedMind","id":6025263,"node_id":"MDQ6VXNlcjYwMjUyNjM=","avatar_url":"https://avatars2.githubusercontent.com/u/6025263?v=4","gravatar_id":"","url":"https://api.github.com/users/UnleashedMind","html_url":"https://github.com/UnleashedMind","followers_url":"https://api.github.com/users/UnleashedMind/followers","following_url":"https://api.github.com/users/UnleashedMind/following{/other_user}","gists_url":"https://api.github.com/users/UnleashedMind/gists{/gist_id}","starred_url":"https://api.github.com/users/UnleashedMind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UnleashedMind/subscriptions","organizations_url":"https://api.github.com/users/UnleashedMind/orgs","repos_url":"https://api.github.com/users/UnleashedMind/repos","events_url":"https://api.github.com/users/UnleashedMind/events{/privacy}","received_events_url":"https://api.github.com/users/UnleashedMind/received_events","type":"User","site_admin":false},"body":"*Issue #, if available:*\r\n#613 \r\n*Description of changes:*\r\nallows cli to assume IAM role to access aws resources, as described in [this doc](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-role.html#cli-configure-role-mfa)\r\n\r\nNote that this implementation does not include using MFA\r\n\r\nBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.","created_at":"2019-01-01T02:48:46Z","updated_at":"2019-01-03T21:12:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a7d5d476b561e38771503b4cc766219570b5d068","assignee":{"login":"UnleashedMind","id":6025263,"node_id":"MDQ6VXNlcjYwMjUyNjM=","avatar_url":"https://avatars2.githubusercontent.com/u/6025263?v=4","gravatar_id":"","url":"https://api.github.com/users/UnleashedMind","html_url":"https://github.com/UnleashedMind","followers_url":"https://api.github.com/users/UnleashedMind/followers","following_url":"https://api.github.com/users/UnleashedMind/following{/other_user}","gists_url":"https://api.github.com/users/UnleashedMind/gists{/gist_id}","starred_url":"https://api.github.com/users/UnleashedMind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UnleashedMind/subscriptions","organizations_url":"https://api.github.com/users/UnleashedMind/orgs","repos_url":"https://api.github.com/users/UnleashedMind/repos","events_url":"https://api.github.com/users/UnleashedMind/events{/privacy}","received_events_url":"https://api.github.com/users/UnleashedMind/received_events","type":"User","site_admin":false},"assignees":[{"login":"UnleashedMind","id":6025263,"node_id":"MDQ6VXNlcjYwMjUyNjM=","avatar_url":"https://avatars2.githubusercontent.com/u/6025263?v=4","gravatar_id":"","url":"https://api.github.com/users/UnleashedMind","html_url":"https://github.com/UnleashedMind","followers_url":"https://api.github.com/users/UnleashedMind/followers","following_url":"https://api.github.com/users/UnleashedMind/following{/other_user}","gists_url":"https://api.github.com/users/UnleashedMind/gists{/gist_id}","starred_url":"https://api.github.com/users/UnleashedMind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UnleashedMind/subscriptions","organizations_url":"https://api.github.com/users/UnleashedMind/orgs","repos_url":"https://api.github.com/users/UnleashedMind/repos","events_url":"https://api.github.com/users/UnleashedMind/events{/privacy}","received_events_url":"https://api.github.com/users/UnleashedMind/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1053678748,"node_id":"MDU6TGFiZWwxMDUzNjc4NzQ4","url":"https://api.github.com/repos/aws-amplify/amplify-cli/labels/review","name":"review","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/aws-amplify/amplify-cli/pulls/645/commits","review_comments_url":"https://api.github.com/repos/aws-amplify/amplify-cli/pulls/645/comments","review_comment_url":"https://api.github.com/repos/aws-amplify/amplify-cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aws-amplify/amplify-cli/issues/645/comments","statuses_url":"https://api.github.com/repos/aws-amplify/amplify-cli/statuses/f671e2c8ae075be56146dd1566986f71fea1c4ee","head":{"label":"UnleashedMind:master-dev","ref":"master-dev","sha":"f671e2c8ae075be56146dd1566986f71fea1c4ee","user":{"login":"UnleashedMind","id":6025263,"node_id":"MDQ6VXNlcjYwMjUyNjM=","avatar_url":"https://avatars2.githubusercontent.com/u/6025263?v=4","gravatar_id":"","url":"https://api.github.com/users/UnleashedMind","html_url":"https://github.com/UnleashedMind","followers_url":"https://api.github.com/users/UnleashedMind/followers","following_url":"https://api.github.com/users/UnleashedMind/following{/other_user}","gists_url":"https://api.github.com/users/UnleashedMind/gists{/gist_id}","starred_url":"https://api.github.com/users/UnleashedMind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UnleashedMind/subscriptions","organizations_url":"https://api.github.com/users/UnleashedMind/orgs","repos_url":"https://api.github.com/users/UnleashedMind/repos","events_url":"https://api.github.com/users/UnleashedMind/events{/privacy}","received_events_url":"https://api.github.com/users/UnleashedMind/received_events","type":"User","site_admin":false},"repo":{"id":145895966,"node_id":"MDEwOlJlcG9zaXRvcnkxNDU4OTU5NjY=","name":"amplify-cli","full_name":"UnleashedMind/amplify-cli","private":false,"owner":{"login":"UnleashedMind","id":6025263,"node_id":"MDQ6VXNlcjYwMjUyNjM=","avatar_url":"https://avatars2.githubusercontent.com/u/6025263?v=4","gravatar_id":"","url":"https://api.github.com/users/UnleashedMind","html_url":"https://github.com/UnleashedMind","followers_url":"https://api.github.com/users/UnleashedMind/followers","following_url":"https://api.github.com/users/UnleashedMind/following{/other_user}","gists_url":"https://api.github.com/users/UnleashedMind/gists{/gist_id}","starred_url":"https://api.github.com/users/UnleashedMind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UnleashedMind/subscriptions","organizations_url":"https://api.github.com/users/UnleashedMind/orgs","repos_url":"https://api.github.com/users/UnleashedMind/repos","events_url":"https://api.github.com/users/UnleashedMind/events{/privacy}","received_events_url":"https://api.github.com/users/UnleashedMind/received_events","type":"User","site_admin":false},"html_url":"https://github.com/UnleashedMind/amplify-cli","description":"A CLI toolchain for simplifying serverless web and mobile development.","fork":true,"url":"https://api.github.com/repos/UnleashedMind/amplify-cli","forks_url":"https://api.github.com/repos/UnleashedMind/amplify-cli/forks","keys_url":"https://api.github.com/repos/UnleashedMind/amplify-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UnleashedMind/amplify-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UnleashedMind/amplify-cli/teams","hooks_url":"https://api.github.com/repos/UnleashedMind/amplify-cli/hooks","issue_events_url":"https://api.github.com/repos/UnleashedMind/amplify-cli/issues/events{/number}","events_url":"https://api.github.com/repos/UnleashedMind/amplify-cli/events","assignees_url":"https://api.github.com/repos/UnleashedMind/amplify-cli/assignees{/user}","branches_url":"https://api.github.com/repos/UnleashedMind/amplify-cli/branches{/branch}","tags_url":"https://api.github.com/repos/UnleashedMind/amplify-cli/tags","blobs_url":"https://api.github.com/repos/UnleashedMind/amplify-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UnleashedMind/amplify-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UnleashedMind/amplify-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/UnleashedMind/amplify-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UnleashedMind/amplify-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/UnleashedMind/amplify-cli/languages","stargazers_url":"https://api.github.com/repos/UnleashedMind/amplify-cli/stargazers","contributors_url":"https://api.github.com/repos/UnleashedMind/amplify-cli/contributors","subscribers_url":"https://api.github.com/repos/UnleashedMind/amplify-cli/subscribers","subscription_url":"https://api.github.com/repos/UnleashedMind/amplify-cli/subscription","commits_url":"https://api.github.com/repos/UnleashedMind/amplify-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/UnleashedMind/amplify-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/UnleashedMind/amplify-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/UnleashedMind/amplify-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/UnleashedMind/amplify-cli/contents/{+path}","compare_url":"https://api.github.com/repos/UnleashedMind/amplify-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UnleashedMind/amplify-cli/merges","archive_url":"https://api.github.com/repos/UnleashedMind/amplify-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UnleashedMind/amplify-cli/downloads","issues_url":"https://api.github.com/repos/UnleashedMind/amplify-cli/issues{/number}","pulls_url":"https://api.github.com/repos/UnleashedMind/amplify-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/UnleashedMind/amplify-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/UnleashedMind/amplify-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UnleashedMind/amplify-cli/labels{/name}","releases_url":"https://api.github.com/repos/UnleashedMind/amplify-cli/releases{/id}","deployments_url":"https://api.github.com/repos/UnleashedMind/amplify-cli/deployments","created_at":"2018-08-23T19:05:56Z","updated_at":"2018-12-20T01:33:37Z","pushed_at":"2019-01-02T22:10:57Z","git_url":"git://github.com/UnleashedMind/amplify-cli.git","ssh_url":"git@github.com:UnleashedMind/amplify-cli.git","clone_url":"https://github.com/UnleashedMind/amplify-cli.git","svn_url":"https://github.com/UnleashedMind/amplify-cli","homepage":null,"size":29081,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"aws-amplify:master","ref":"master","sha":"e9df3865f9b2cc51963bf88239f36667352d73a7","user":{"login":"aws-amplify","id":41077760,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDc3NzYw","avatar_url":"https://avatars0.githubusercontent.com/u/41077760?v=4","gravatar_id":"","url":"https://api.github.com/users/aws-amplify","html_url":"https://github.com/aws-amplify","followers_url":"https://api.github.com/users/aws-amplify/followers","following_url":"https://api.github.com/users/aws-amplify/following{/other_user}","gists_url":"https://api.github.com/users/aws-amplify/gists{/gist_id}","starred_url":"https://api.github.com/users/aws-amplify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aws-amplify/subscriptions","organizations_url":"https://api.github.com/users/aws-amplify/orgs","repos_url":"https://api.github.com/users/aws-amplify/repos","events_url":"https://api.github.com/users/aws-amplify/events{/privacy}","received_events_url":"https://api.github.com/users/aws-amplify/received_events","type":"Organization","site_admin":false},"repo":{"id":145880460,"node_id":"MDEwOlJlcG9zaXRvcnkxNDU4ODA0NjA=","name":"amplify-cli","full_name":"aws-amplify/amplify-cli","private":false,"owner":{"login":"aws-amplify","id":41077760,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDc3NzYw","avatar_url":"https://avatars0.githubusercontent.com/u/41077760?v=4","gravatar_id":"","url":"https://api.github.com/users/aws-amplify","html_url":"https://github.com/aws-amplify","followers_url":"https://api.github.com/users/aws-amplify/followers","following_url":"https://api.github.com/users/aws-amplify/following{/other_user}","gists_url":"https://api.github.com/users/aws-amplify/gists{/gist_id}","starred_url":"https://api.github.com/users/aws-amplify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aws-amplify/subscriptions","organizations_url":"https://api.github.com/users/aws-amplify/orgs","repos_url":"https://api.github.com/users/aws-amplify/repos","events_url":"https://api.github.com/users/aws-amplify/events{/privacy}","received_events_url":"https://api.github.com/users/aws-amplify/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/aws-amplify/amplify-cli","description":"A CLI toolchain for simplifying serverless web and mobile development.","fork":false,"url":"https://api.github.com/repos/aws-amplify/amplify-cli","forks_url":"https://api.github.com/repos/aws-amplify/amplify-cli/forks","keys_url":"https://api.github.com/repos/aws-amplify/amplify-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aws-amplify/amplify-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aws-amplify/amplify-cli/teams","hooks_url":"https://api.github.com/repos/aws-amplify/amplify-cli/hooks","issue_events_url":"https://api.github.com/repos/aws-amplify/amplify-cli/issues/events{/number}","events_url":"https://api.github.com/repos/aws-amplify/amplify-cli/events","assignees_url":"https://api.github.com/repos/aws-amplify/amplify-cli/assignees{/user}","branches_url":"https://api.github.com/repos/aws-amplify/amplify-cli/branches{/branch}","tags_url":"https://api.github.com/repos/aws-amplify/amplify-cli/tags","blobs_url":"https://api.github.com/repos/aws-amplify/amplify-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aws-amplify/amplify-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aws-amplify/amplify-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/aws-amplify/amplify-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aws-amplify/amplify-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/aws-amplify/amplify-cli/languages","stargazers_url":"https://api.github.com/repos/aws-amplify/amplify-cli/stargazers","contributors_url":"https://api.github.com/repos/aws-amplify/amplify-cli/contributors","subscribers_url":"https://api.github.com/repos/aws-amplify/amplify-cli/subscribers","subscription_url":"https://api.github.com/repos/aws-amplify/amplify-cli/subscription","commits_url":"https://api.github.com/repos/aws-amplify/amplify-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/aws-amplify/amplify-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/aws-amplify/amplify-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/aws-amplify/amplify-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/aws-amplify/amplify-cli/contents/{+path}","compare_url":"https://api.github.com/repos/aws-amplify/amplify-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aws-amplify/amplify-cli/merges","archive_url":"https://api.github.com/repos/aws-amplify/amplify-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aws-amplify/amplify-cli/downloads","issues_url":"https://api.github.com/repos/aws-amplify/amplify-cli/issues{/number}","pulls_url":"https://api.github.com/repos/aws-amplify/amplify-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/aws-amplify/amplify-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/aws-amplify/amplify-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aws-amplify/amplify-cli/labels{/name}","releases_url":"https://api.github.com/repos/aws-amplify/amplify-cli/releases{/id}","deployments_url":"https://api.github.com/repos/aws-amplify/amplify-cli/deployments","created_at":"2018-08-23T16:33:10Z","updated_at":"2019-01-03T19:32:12Z","pushed_at":"2019-01-03T19:32:09Z","git_url":"git://github.com/aws-amplify/amplify-cli.git","ssh_url":"git@github.com:aws-amplify/amplify-cli.git","clone_url":"https://github.com/aws-amplify/amplify-cli.git","svn_url":"https://github.com/aws-amplify/amplify-cli","homepage":null,"size":29250,"stargazers_count":567,"watchers_count":567,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":84,"mirror_url":null,"archived":false,"open_issues_count":163,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":84,"open_issues":163,"watchers":567,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aws-amplify/amplify-cli/pulls/645"},"html":{"href":"https://github.com/aws-amplify/amplify-cli/pull/645"},"issue":{"href":"https://api.github.com/repos/aws-amplify/amplify-cli/issues/645"},"comments":{"href":"https://api.github.com/repos/aws-amplify/amplify-cli/issues/645/comments"},"review_comments":{"href":"https://api.github.com/repos/aws-amplify/amplify-cli/pulls/645/comments"},"review_comment":{"href":"https://api.github.com/repos/aws-amplify/amplify-cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aws-amplify/amplify-cli/pulls/645/commits"},"statuses":{"href":"https://api.github.com/repos/aws-amplify/amplify-cli/statuses/f671e2c8ae075be56146dd1566986f71fea1c4ee"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"kaustavghosh06"}}