{"action":"created","comment":{"url":"https://api.github.com/repos/WPO-Foundation/webpagetest/pulls/comments/84292654","pull_request_review_id":5078780,"id":84292654,"diff_hunk":"@@ -385,68 +406,65 @@ function EC2_DeleteOrphanedVolumes() {\n \r\n function EC2_GetRunningInstances() {\r\n   $now = time();\r\n+  $regions = array();\r\n   $instances = array();\r\n-  $key = GetSetting('ec2_key');\r\n-  $secret = GetSetting('ec2_secret');\r\n-  if ($key && $secret) {\r\n-    $locations = EC2_GetAMILocations();\r\n-    try {\r\n-      $ec2 = \\Aws\\Ec2\\Ec2Client::factory(array('key' => $key, 'secret' => $secret, 'region' => 'us-east-1'));\r\n-      $regions = array();\r\n-      $response = $ec2->describeRegions();\r\n-      if (isset($response['Regions'])) {\r\n-        foreach ($response['Regions'] as $region)\r\n-          $regions[] = $region['RegionName'];\r\n-      }\r\n-    } catch (\\Aws\\Ec2\\Exception\\Ec2Exception $e) {\r\n-      $error = $e->getMessage();\r\n-      EC2LogError(\"Listing running EC2 instances: $error\");\r\n+\r\n+  $locations = EC2_GetAMILocations();\r\n+  $ec2 = EC2_GetSdkClient();\r","path":"www/ec2/ec2.inc.php","position":null,"original_position":244,"commit_id":"a71218b5c127b4220c8847690fdff8b9bb0d5654","original_commit_id":"292f095e2606587a77a47b2765d579db3b22c3ac","user":{"login":"carlnordenfelt","id":5034401,"avatar_url":"https://avatars.githubusercontent.com/u/5034401?v=3","gravatar_id":"","url":"https://api.github.com/users/carlnordenfelt","html_url":"https://github.com/carlnordenfelt","followers_url":"https://api.github.com/users/carlnordenfelt/followers","following_url":"https://api.github.com/users/carlnordenfelt/following{/other_user}","gists_url":"https://api.github.com/users/carlnordenfelt/gists{/gist_id}","starred_url":"https://api.github.com/users/carlnordenfelt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carlnordenfelt/subscriptions","organizations_url":"https://api.github.com/users/carlnordenfelt/orgs","repos_url":"https://api.github.com/users/carlnordenfelt/repos","events_url":"https://api.github.com/users/carlnordenfelt/events{/privacy}","received_events_url":"https://api.github.com/users/carlnordenfelt/received_events","type":"User","site_admin":false},"body":"Moved and init function will rethrow.","created_at":"2016-10-20T14:19:07Z","updated_at":"2016-10-20T14:19:08Z","html_url":"https://github.com/WPO-Foundation/webpagetest/pull/749#discussion_r84292654","pull_request_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/pulls/749","_links":{"self":{"href":"https://api.github.com/repos/WPO-Foundation/webpagetest/pulls/comments/84292654"},"html":{"href":"https://github.com/WPO-Foundation/webpagetest/pull/749#discussion_r84292654"},"pull_request":{"href":"https://api.github.com/repos/WPO-Foundation/webpagetest/pulls/749"}}},"pull_request":{"url":"https://api.github.com/repos/WPO-Foundation/webpagetest/pulls/749","id":90007511,"html_url":"https://github.com/WPO-Foundation/webpagetest/pull/749","diff_url":"https://github.com/WPO-Foundation/webpagetest/pull/749.diff","patch_url":"https://github.com/WPO-Foundation/webpagetest/pull/749.patch","issue_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/issues/749","number":749,"state":"open","locked":false,"title":"Use EC2 Instance Profile if credentials are not provided","user":{"login":"carlnordenfelt","id":5034401,"avatar_url":"https://avatars.githubusercontent.com/u/5034401?v=3","gravatar_id":"","url":"https://api.github.com/users/carlnordenfelt","html_url":"https://github.com/carlnordenfelt","followers_url":"https://api.github.com/users/carlnordenfelt/followers","following_url":"https://api.github.com/users/carlnordenfelt/following{/other_user}","gists_url":"https://api.github.com/users/carlnordenfelt/gists{/gist_id}","starred_url":"https://api.github.com/users/carlnordenfelt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carlnordenfelt/subscriptions","organizations_url":"https://api.github.com/users/carlnordenfelt/orgs","repos_url":"https://api.github.com/users/carlnordenfelt/repos","events_url":"https://api.github.com/users/carlnordenfelt/events{/privacy}","received_events_url":"https://api.github.com/users/carlnordenfelt/received_events","type":"User","site_admin":false},"body":"Refactored EC2 and S3 implementations to use AWS environment credentials (i.e. EC2 Instance Profile) if key/secret are not provided.\r\n\r\nNote that this PR has not been tested at all. Consider this PR to currently be a placeholder for discussion :)\r\n\r\nI recommend adding ?w=1 to the url as there was apparently some whitespace changes done by my IDE that I didn't notice before pushing. I.e: https://github.com/WPO-Foundation/webpagetest/pull/749?w=1","created_at":"2016-10-19T13:19:26Z","updated_at":"2016-10-20T14:19:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fc947364428b9e32cff64567e40c4135bb939848","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/pulls/749/commits","review_comments_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/pulls/749/comments","review_comment_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/issues/749/comments","statuses_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/statuses/a71218b5c127b4220c8847690fdff8b9bb0d5654","head":{"label":"carlnordenfelt:master","ref":"master","sha":"a71218b5c127b4220c8847690fdff8b9bb0d5654","user":{"login":"carlnordenfelt","id":5034401,"avatar_url":"https://avatars.githubusercontent.com/u/5034401?v=3","gravatar_id":"","url":"https://api.github.com/users/carlnordenfelt","html_url":"https://github.com/carlnordenfelt","followers_url":"https://api.github.com/users/carlnordenfelt/followers","following_url":"https://api.github.com/users/carlnordenfelt/following{/other_user}","gists_url":"https://api.github.com/users/carlnordenfelt/gists{/gist_id}","starred_url":"https://api.github.com/users/carlnordenfelt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carlnordenfelt/subscriptions","organizations_url":"https://api.github.com/users/carlnordenfelt/orgs","repos_url":"https://api.github.com/users/carlnordenfelt/repos","events_url":"https://api.github.com/users/carlnordenfelt/events{/privacy}","received_events_url":"https://api.github.com/users/carlnordenfelt/received_events","type":"User","site_admin":false},"repo":{"id":71358608,"name":"webpagetest","full_name":"carlnordenfelt/webpagetest","owner":{"login":"carlnordenfelt","id":5034401,"avatar_url":"https://avatars.githubusercontent.com/u/5034401?v=3","gravatar_id":"","url":"https://api.github.com/users/carlnordenfelt","html_url":"https://github.com/carlnordenfelt","followers_url":"https://api.github.com/users/carlnordenfelt/followers","following_url":"https://api.github.com/users/carlnordenfelt/following{/other_user}","gists_url":"https://api.github.com/users/carlnordenfelt/gists{/gist_id}","starred_url":"https://api.github.com/users/carlnordenfelt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carlnordenfelt/subscriptions","organizations_url":"https://api.github.com/users/carlnordenfelt/orgs","repos_url":"https://api.github.com/users/carlnordenfelt/repos","events_url":"https://api.github.com/users/carlnordenfelt/events{/privacy}","received_events_url":"https://api.github.com/users/carlnordenfelt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/carlnordenfelt/webpagetest","description":"Official repository for WebPagetest","fork":true,"url":"https://api.github.com/repos/carlnordenfelt/webpagetest","forks_url":"https://api.github.com/repos/carlnordenfelt/webpagetest/forks","keys_url":"https://api.github.com/repos/carlnordenfelt/webpagetest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/carlnordenfelt/webpagetest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/carlnordenfelt/webpagetest/teams","hooks_url":"https://api.github.com/repos/carlnordenfelt/webpagetest/hooks","issue_events_url":"https://api.github.com/repos/carlnordenfelt/webpagetest/issues/events{/number}","events_url":"https://api.github.com/repos/carlnordenfelt/webpagetest/events","assignees_url":"https://api.github.com/repos/carlnordenfelt/webpagetest/assignees{/user}","branches_url":"https://api.github.com/repos/carlnordenfelt/webpagetest/branches{/branch}","tags_url":"https://api.github.com/repos/carlnordenfelt/webpagetest/tags","blobs_url":"https://api.github.com/repos/carlnordenfelt/webpagetest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/carlnordenfelt/webpagetest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/carlnordenfelt/webpagetest/git/refs{/sha}","trees_url":"https://api.github.com/repos/carlnordenfelt/webpagetest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/carlnordenfelt/webpagetest/statuses/{sha}","languages_url":"https://api.github.com/repos/carlnordenfelt/webpagetest/languages","stargazers_url":"https://api.github.com/repos/carlnordenfelt/webpagetest/stargazers","contributors_url":"https://api.github.com/repos/carlnordenfelt/webpagetest/contributors","subscribers_url":"https://api.github.com/repos/carlnordenfelt/webpagetest/subscribers","subscription_url":"https://api.github.com/repos/carlnordenfelt/webpagetest/subscription","commits_url":"https://api.github.com/repos/carlnordenfelt/webpagetest/commits{/sha}","git_commits_url":"https://api.github.com/repos/carlnordenfelt/webpagetest/git/commits{/sha}","comments_url":"https://api.github.com/repos/carlnordenfelt/webpagetest/comments{/number}","issue_comment_url":"https://api.github.com/repos/carlnordenfelt/webpagetest/issues/comments{/number}","contents_url":"https://api.github.com/repos/carlnordenfelt/webpagetest/contents/{+path}","compare_url":"https://api.github.com/repos/carlnordenfelt/webpagetest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/carlnordenfelt/webpagetest/merges","archive_url":"https://api.github.com/repos/carlnordenfelt/webpagetest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/carlnordenfelt/webpagetest/downloads","issues_url":"https://api.github.com/repos/carlnordenfelt/webpagetest/issues{/number}","pulls_url":"https://api.github.com/repos/carlnordenfelt/webpagetest/pulls{/number}","milestones_url":"https://api.github.com/repos/carlnordenfelt/webpagetest/milestones{/number}","notifications_url":"https://api.github.com/repos/carlnordenfelt/webpagetest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/carlnordenfelt/webpagetest/labels{/name}","releases_url":"https://api.github.com/repos/carlnordenfelt/webpagetest/releases{/id}","deployments_url":"https://api.github.com/repos/carlnordenfelt/webpagetest/deployments","created_at":"2016-10-19T13:11:49Z","updated_at":"2016-10-19T13:12:05Z","pushed_at":"2016-10-20T14:18:24Z","git_url":"git://github.com/carlnordenfelt/webpagetest.git","ssh_url":"git@github.com:carlnordenfelt/webpagetest.git","clone_url":"https://github.com/carlnordenfelt/webpagetest.git","svn_url":"https://github.com/carlnordenfelt/webpagetest","homepage":null,"size":637935,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"WPO-Foundation:master","ref":"master","sha":"8e980e0175c0cabb2f1f5458f76d674ffe10c16c","user":{"login":"WPO-Foundation","id":4622875,"avatar_url":"https://avatars.githubusercontent.com/u/4622875?v=3","gravatar_id":"","url":"https://api.github.com/users/WPO-Foundation","html_url":"https://github.com/WPO-Foundation","followers_url":"https://api.github.com/users/WPO-Foundation/followers","following_url":"https://api.github.com/users/WPO-Foundation/following{/other_user}","gists_url":"https://api.github.com/users/WPO-Foundation/gists{/gist_id}","starred_url":"https://api.github.com/users/WPO-Foundation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WPO-Foundation/subscriptions","organizations_url":"https://api.github.com/users/WPO-Foundation/orgs","repos_url":"https://api.github.com/users/WPO-Foundation/repos","events_url":"https://api.github.com/users/WPO-Foundation/events{/privacy}","received_events_url":"https://api.github.com/users/WPO-Foundation/received_events","type":"Organization","site_admin":false},"repo":{"id":11029192,"name":"webpagetest","full_name":"WPO-Foundation/webpagetest","owner":{"login":"WPO-Foundation","id":4622875,"avatar_url":"https://avatars.githubusercontent.com/u/4622875?v=3","gravatar_id":"","url":"https://api.github.com/users/WPO-Foundation","html_url":"https://github.com/WPO-Foundation","followers_url":"https://api.github.com/users/WPO-Foundation/followers","following_url":"https://api.github.com/users/WPO-Foundation/following{/other_user}","gists_url":"https://api.github.com/users/WPO-Foundation/gists{/gist_id}","starred_url":"https://api.github.com/users/WPO-Foundation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WPO-Foundation/subscriptions","organizations_url":"https://api.github.com/users/WPO-Foundation/orgs","repos_url":"https://api.github.com/users/WPO-Foundation/repos","events_url":"https://api.github.com/users/WPO-Foundation/events{/privacy}","received_events_url":"https://api.github.com/users/WPO-Foundation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WPO-Foundation/webpagetest","description":"Official repository for WebPagetest","fork":false,"url":"https://api.github.com/repos/WPO-Foundation/webpagetest","forks_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/forks","keys_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/teams","hooks_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/hooks","issue_events_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/issues/events{/number}","events_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/events","assignees_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/assignees{/user}","branches_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/branches{/branch}","tags_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/tags","blobs_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/git/refs{/sha}","trees_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/statuses/{sha}","languages_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/languages","stargazers_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/stargazers","contributors_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/contributors","subscribers_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/subscribers","subscription_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/subscription","commits_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/commits{/sha}","git_commits_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/git/commits{/sha}","comments_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/comments{/number}","issue_comment_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/issues/comments{/number}","contents_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/contents/{+path}","compare_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/merges","archive_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/downloads","issues_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/issues{/number}","pulls_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/pulls{/number}","milestones_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/milestones{/number}","notifications_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/labels{/name}","releases_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/releases{/id}","deployments_url":"https://api.github.com/repos/WPO-Foundation/webpagetest/deployments","created_at":"2013-06-28T14:54:54Z","updated_at":"2016-10-20T06:10:06Z","pushed_at":"2016-10-20T14:18:25Z","git_url":"git://github.com/WPO-Foundation/webpagetest.git","ssh_url":"git@github.com:WPO-Foundation/webpagetest.git","clone_url":"https://github.com/WPO-Foundation/webpagetest.git","svn_url":"https://github.com/WPO-Foundation/webpagetest","homepage":null,"size":674924,"stargazers_count":1192,"watchers_count":1192,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":319,"mirror_url":null,"open_issues_count":227,"forks":319,"open_issues":227,"watchers":1192,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/WPO-Foundation/webpagetest/pulls/749"},"html":{"href":"https://github.com/WPO-Foundation/webpagetest/pull/749"},"issue":{"href":"https://api.github.com/repos/WPO-Foundation/webpagetest/issues/749"},"comments":{"href":"https://api.github.com/repos/WPO-Foundation/webpagetest/issues/749/comments"},"review_comments":{"href":"https://api.github.com/repos/WPO-Foundation/webpagetest/pulls/749/comments"},"review_comment":{"href":"https://api.github.com/repos/WPO-Foundation/webpagetest/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WPO-Foundation/webpagetest/pulls/749/commits"},"statuses":{"href":"https://api.github.com/repos/WPO-Foundation/webpagetest/statuses/a71218b5c127b4220c8847690fdff8b9bb0d5654"}}}}
{"actor":{"display_login":"carlnordenfelt"}}