{"action":"created","comment":{"url":"https://api.github.com/repos/chef/ohai/pulls/comments/90230536","pull_request_review_id":10751796,"id":90230536,"diff_hunk":"@@ -200,6 +201,13 @@ def fetch_userdata\n         response.code == \"200\" ? response.body : nil\n       end\n \n+      def fetch_dynamic_data","path":"lib/ohai/mixin/ec2_metadata.rb","position":4,"original_position":12,"commit_id":"d9738d918a76fae7afc66b71c9c85482b4921791","original_commit_id":"1dce27366b508eb43f2ad27aab6dc9bbc9d45465","user":{"login":"Fodoj","id":78866,"avatar_url":"https://avatars.githubusercontent.com/u/78866?v=3","gravatar_id":"","url":"https://api.github.com/users/Fodoj","html_url":"https://github.com/Fodoj","followers_url":"https://api.github.com/users/Fodoj/followers","following_url":"https://api.github.com/users/Fodoj/following{/other_user}","gists_url":"https://api.github.com/users/Fodoj/gists{/gist_id}","starred_url":"https://api.github.com/users/Fodoj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fodoj/subscriptions","organizations_url":"https://api.github.com/users/Fodoj/orgs","repos_url":"https://api.github.com/users/Fodoj/repos","events_url":"https://api.github.com/users/Fodoj/events{/privacy}","received_events_url":"https://api.github.com/users/Fodoj/received_events","type":"User","site_admin":false},"body":"Also, other attributes like user data is not memoized as well in this plugin","created_at":"2016-11-30T13:24:49Z","updated_at":"2016-11-30T13:24:49Z","html_url":"https://github.com/chef/ohai/pull/907#discussion_r90230536","pull_request_url":"https://api.github.com/repos/chef/ohai/pulls/907","_links":{"self":{"href":"https://api.github.com/repos/chef/ohai/pulls/comments/90230536"},"html":{"href":"https://github.com/chef/ohai/pull/907#discussion_r90230536"},"pull_request":{"href":"https://api.github.com/repos/chef/ohai/pulls/907"}}},"pull_request":{"url":"https://api.github.com/repos/chef/ohai/pulls/907","id":95524189,"html_url":"https://github.com/chef/ohai/pull/907","diff_url":"https://github.com/chef/ohai/pull/907.diff","patch_url":"https://github.com/chef/ohai/pull/907.patch","issue_url":"https://api.github.com/repos/chef/ohai/issues/907","number":907,"state":"open","locked":false,"title":"Fetch AWS Account ID from metadata","user":{"login":"Fodoj","id":78866,"avatar_url":"https://avatars.githubusercontent.com/u/78866?v=3","gravatar_id":"","url":"https://api.github.com/users/Fodoj","html_url":"https://github.com/Fodoj","followers_url":"https://api.github.com/users/Fodoj/followers","following_url":"https://api.github.com/users/Fodoj/following{/other_user}","gists_url":"https://api.github.com/users/Fodoj/gists{/gist_id}","starred_url":"https://api.github.com/users/Fodoj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fodoj/subscriptions","organizations_url":"https://api.github.com/users/Fodoj/orgs","repos_url":"https://api.github.com/users/Fodoj/repos","events_url":"https://api.github.com/users/Fodoj/events{/privacy}","received_events_url":"https://api.github.com/users/Fodoj/received_events","type":"User","site_admin":false},"body":"In addition to meta-data and userdata EC2 also provides \"dynamic\" data (not sure why it's called dynamic though). One extra useful attribute that it has, and that seems to be not available in other sources, is AWS account id (try running curl http://169.254.169.254/latest/dynamic/instance-identity/document). It is possible to fetch account id from the instance that has IAM role attached (by parsing ARN of the role) but for instances without any IAM role this dynamic data is the only way to figure out to which account it belongs to.","created_at":"2016-11-28T15:53:43Z","updated_at":"2016-11-30T13:24:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9ae1da072a0ce2e361151941388469c7eabbb7c3","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/chef/ohai/pulls/907/commits","review_comments_url":"https://api.github.com/repos/chef/ohai/pulls/907/comments","review_comment_url":"https://api.github.com/repos/chef/ohai/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chef/ohai/issues/907/comments","statuses_url":"https://api.github.com/repos/chef/ohai/statuses/d9738d918a76fae7afc66b71c9c85482b4921791","head":{"label":"Fodoj:master","ref":"master","sha":"d9738d918a76fae7afc66b71c9c85482b4921791","user":{"login":"Fodoj","id":78866,"avatar_url":"https://avatars.githubusercontent.com/u/78866?v=3","gravatar_id":"","url":"https://api.github.com/users/Fodoj","html_url":"https://github.com/Fodoj","followers_url":"https://api.github.com/users/Fodoj/followers","following_url":"https://api.github.com/users/Fodoj/following{/other_user}","gists_url":"https://api.github.com/users/Fodoj/gists{/gist_id}","starred_url":"https://api.github.com/users/Fodoj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fodoj/subscriptions","organizations_url":"https://api.github.com/users/Fodoj/orgs","repos_url":"https://api.github.com/users/Fodoj/repos","events_url":"https://api.github.com/users/Fodoj/events{/privacy}","received_events_url":"https://api.github.com/users/Fodoj/received_events","type":"User","site_admin":false},"repo":{"id":74986031,"name":"ohai","full_name":"Fodoj/ohai","owner":{"login":"Fodoj","id":78866,"avatar_url":"https://avatars.githubusercontent.com/u/78866?v=3","gravatar_id":"","url":"https://api.github.com/users/Fodoj","html_url":"https://github.com/Fodoj","followers_url":"https://api.github.com/users/Fodoj/followers","following_url":"https://api.github.com/users/Fodoj/following{/other_user}","gists_url":"https://api.github.com/users/Fodoj/gists{/gist_id}","starred_url":"https://api.github.com/users/Fodoj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fodoj/subscriptions","organizations_url":"https://api.github.com/users/Fodoj/orgs","repos_url":"https://api.github.com/users/Fodoj/repos","events_url":"https://api.github.com/users/Fodoj/events{/privacy}","received_events_url":"https://api.github.com/users/Fodoj/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Fodoj/ohai","description":"Ohai profiles your system and emits JSON","fork":true,"url":"https://api.github.com/repos/Fodoj/ohai","forks_url":"https://api.github.com/repos/Fodoj/ohai/forks","keys_url":"https://api.github.com/repos/Fodoj/ohai/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Fodoj/ohai/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Fodoj/ohai/teams","hooks_url":"https://api.github.com/repos/Fodoj/ohai/hooks","issue_events_url":"https://api.github.com/repos/Fodoj/ohai/issues/events{/number}","events_url":"https://api.github.com/repos/Fodoj/ohai/events","assignees_url":"https://api.github.com/repos/Fodoj/ohai/assignees{/user}","branches_url":"https://api.github.com/repos/Fodoj/ohai/branches{/branch}","tags_url":"https://api.github.com/repos/Fodoj/ohai/tags","blobs_url":"https://api.github.com/repos/Fodoj/ohai/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Fodoj/ohai/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Fodoj/ohai/git/refs{/sha}","trees_url":"https://api.github.com/repos/Fodoj/ohai/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Fodoj/ohai/statuses/{sha}","languages_url":"https://api.github.com/repos/Fodoj/ohai/languages","stargazers_url":"https://api.github.com/repos/Fodoj/ohai/stargazers","contributors_url":"https://api.github.com/repos/Fodoj/ohai/contributors","subscribers_url":"https://api.github.com/repos/Fodoj/ohai/subscribers","subscription_url":"https://api.github.com/repos/Fodoj/ohai/subscription","commits_url":"https://api.github.com/repos/Fodoj/ohai/commits{/sha}","git_commits_url":"https://api.github.com/repos/Fodoj/ohai/git/commits{/sha}","comments_url":"https://api.github.com/repos/Fodoj/ohai/comments{/number}","issue_comment_url":"https://api.github.com/repos/Fodoj/ohai/issues/comments{/number}","contents_url":"https://api.github.com/repos/Fodoj/ohai/contents/{+path}","compare_url":"https://api.github.com/repos/Fodoj/ohai/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Fodoj/ohai/merges","archive_url":"https://api.github.com/repos/Fodoj/ohai/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Fodoj/ohai/downloads","issues_url":"https://api.github.com/repos/Fodoj/ohai/issues{/number}","pulls_url":"https://api.github.com/repos/Fodoj/ohai/pulls{/number}","milestones_url":"https://api.github.com/repos/Fodoj/ohai/milestones{/number}","notifications_url":"https://api.github.com/repos/Fodoj/ohai/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Fodoj/ohai/labels{/name}","releases_url":"https://api.github.com/repos/Fodoj/ohai/releases{/id}","deployments_url":"https://api.github.com/repos/Fodoj/ohai/deployments","created_at":"2016-11-28T15:23:54Z","updated_at":"2016-11-28T18:32:46Z","pushed_at":"2016-11-30T13:24:04Z","git_url":"git://github.com/Fodoj/ohai.git","ssh_url":"git@github.com:Fodoj/ohai.git","clone_url":"https://github.com/Fodoj/ohai.git","svn_url":"https://github.com/Fodoj/ohai","homepage":"https://docs.chef.io/ohai.html","size":4709,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"chef:master","ref":"master","sha":"51ac6d9ddfe65bf8401ce999cdb3ff48efed22c3","user":{"login":"chef","id":29740,"avatar_url":"https://avatars.githubusercontent.com/u/29740?v=3","gravatar_id":"","url":"https://api.github.com/users/chef","html_url":"https://github.com/chef","followers_url":"https://api.github.com/users/chef/followers","following_url":"https://api.github.com/users/chef/following{/other_user}","gists_url":"https://api.github.com/users/chef/gists{/gist_id}","starred_url":"https://api.github.com/users/chef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chef/subscriptions","organizations_url":"https://api.github.com/users/chef/orgs","repos_url":"https://api.github.com/users/chef/repos","events_url":"https://api.github.com/users/chef/events{/privacy}","received_events_url":"https://api.github.com/users/chef/received_events","type":"Organization","site_admin":false},"repo":{"id":108289,"name":"ohai","full_name":"chef/ohai","owner":{"login":"chef","id":29740,"avatar_url":"https://avatars.githubusercontent.com/u/29740?v=3","gravatar_id":"","url":"https://api.github.com/users/chef","html_url":"https://github.com/chef","followers_url":"https://api.github.com/users/chef/followers","following_url":"https://api.github.com/users/chef/following{/other_user}","gists_url":"https://api.github.com/users/chef/gists{/gist_id}","starred_url":"https://api.github.com/users/chef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chef/subscriptions","organizations_url":"https://api.github.com/users/chef/orgs","repos_url":"https://api.github.com/users/chef/repos","events_url":"https://api.github.com/users/chef/events{/privacy}","received_events_url":"https://api.github.com/users/chef/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/chef/ohai","description":"Ohai profiles your system and emits JSON","fork":false,"url":"https://api.github.com/repos/chef/ohai","forks_url":"https://api.github.com/repos/chef/ohai/forks","keys_url":"https://api.github.com/repos/chef/ohai/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chef/ohai/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chef/ohai/teams","hooks_url":"https://api.github.com/repos/chef/ohai/hooks","issue_events_url":"https://api.github.com/repos/chef/ohai/issues/events{/number}","events_url":"https://api.github.com/repos/chef/ohai/events","assignees_url":"https://api.github.com/repos/chef/ohai/assignees{/user}","branches_url":"https://api.github.com/repos/chef/ohai/branches{/branch}","tags_url":"https://api.github.com/repos/chef/ohai/tags","blobs_url":"https://api.github.com/repos/chef/ohai/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chef/ohai/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chef/ohai/git/refs{/sha}","trees_url":"https://api.github.com/repos/chef/ohai/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chef/ohai/statuses/{sha}","languages_url":"https://api.github.com/repos/chef/ohai/languages","stargazers_url":"https://api.github.com/repos/chef/ohai/stargazers","contributors_url":"https://api.github.com/repos/chef/ohai/contributors","subscribers_url":"https://api.github.com/repos/chef/ohai/subscribers","subscription_url":"https://api.github.com/repos/chef/ohai/subscription","commits_url":"https://api.github.com/repos/chef/ohai/commits{/sha}","git_commits_url":"https://api.github.com/repos/chef/ohai/git/commits{/sha}","comments_url":"https://api.github.com/repos/chef/ohai/comments{/number}","issue_comment_url":"https://api.github.com/repos/chef/ohai/issues/comments{/number}","contents_url":"https://api.github.com/repos/chef/ohai/contents/{+path}","compare_url":"https://api.github.com/repos/chef/ohai/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chef/ohai/merges","archive_url":"https://api.github.com/repos/chef/ohai/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chef/ohai/downloads","issues_url":"https://api.github.com/repos/chef/ohai/issues{/number}","pulls_url":"https://api.github.com/repos/chef/ohai/pulls{/number}","milestones_url":"https://api.github.com/repos/chef/ohai/milestones{/number}","notifications_url":"https://api.github.com/repos/chef/ohai/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chef/ohai/labels{/name}","releases_url":"https://api.github.com/repos/chef/ohai/releases{/id}","deployments_url":"https://api.github.com/repos/chef/ohai/deployments","created_at":"2009-01-15T20:50:43Z","updated_at":"2016-11-23T02:25:54Z","pushed_at":"2016-11-30T13:24:04Z","git_url":"git://github.com/chef/ohai.git","ssh_url":"git@github.com:chef/ohai.git","clone_url":"https://github.com/chef/ohai.git","svn_url":"https://github.com/chef/ohai","homepage":"https://docs.chef.io/ohai.html","size":6406,"stargazers_count":541,"watchers_count":541,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":390,"mirror_url":null,"open_issues_count":49,"forks":390,"open_issues":49,"watchers":541,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chef/ohai/pulls/907"},"html":{"href":"https://github.com/chef/ohai/pull/907"},"issue":{"href":"https://api.github.com/repos/chef/ohai/issues/907"},"comments":{"href":"https://api.github.com/repos/chef/ohai/issues/907/comments"},"review_comments":{"href":"https://api.github.com/repos/chef/ohai/pulls/907/comments"},"review_comment":{"href":"https://api.github.com/repos/chef/ohai/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chef/ohai/pulls/907/commits"},"statuses":{"href":"https://api.github.com/repos/chef/ohai/statuses/d9738d918a76fae7afc66b71c9c85482b4921791"}}}}
{"actor":{"display_login":"Fodoj"}}