{"action":"created","comment":{"url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/pulls/comments/191831265","pull_request_review_id":124482399,"id":191831265,"diff_hunk":"@@ -0,0 +1,116 @@\n+# -*- coding: utf-8 -*-\n+# Copyright (c) 2016-present, CloudZero, Inc. All rights reserved.\n+# Licensed under the BSD-style license. See LICENSE file in the project root for full license information.\n+\n+\"\"\"\n+Module that provides safe and easy access to cloud account resource data.\n+\"\"\"\n+\n+import botocore.exceptions\n+\n+import lambda_tools\n+from reactor.common.plugin_loader import list_available_plugins_for_loader\n+import reactor.features.accounts.exceptions as exceptions\n+import reactor.features.accounts.probe_plugins.plugin_loader as plugin_loader\n+import reactor.features.accounts.facades.account_cache_bucket as account_cache_bucket\n+\n+\n+logger = lambda_tools.setup_logging('reactor')\n+\n+\n+def force_load_all_metadata_from_account(account_context):\n+    \"\"\"\n+    Given an account context, load all available resource metadata directly from the account.\n+    This also forces an update of the Cloud Account Cache.\n+    WARNING: Use this sparingly, as AWS is likely to throttle the Reactor otherwise.\n+\n+    Args:\n+        account_context (attrdict): Contextual information about the connected account and the Reactor installation\n+\n+    Returns:\n+        None\n+    \"\"\"\n+    cache_bucket_name = _build_cache_bucket_name(account_context)\n+    supported_resources = list_available_plugins_for_loader(plugin_loader)\n+    for service_type, resource_type in supported_resources:","path":"reactor/features/accounts/probe.py","position":35,"original_position":35,"commit_id":"8de192418c179d9c90e382fc24d5462d3a82a1c7","original_commit_id":"3c16e9f3485c58799dded43367e83833d1af0d4d","user":{"login":"killthrush","id":6638896,"avatar_url":"https://avatars0.githubusercontent.com/u/6638896?v=4","gravatar_id":"","url":"https://api.github.com/users/killthrush","html_url":"https://github.com/killthrush","followers_url":"https://api.github.com/users/killthrush/followers","following_url":"https://api.github.com/users/killthrush/following{/other_user}","gists_url":"https://api.github.com/users/killthrush/gists{/gist_id}","starred_url":"https://api.github.com/users/killthrush/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/killthrush/subscriptions","organizations_url":"https://api.github.com/users/killthrush/orgs","repos_url":"https://api.github.com/users/killthrush/repos","events_url":"https://api.github.com/users/killthrush/events{/privacy}","received_events_url":"https://api.github.com/users/killthrush/received_events","type":"User","site_admin":false},"body":"it's a list of tuples: `[('ec2', 'instance), ('ec2', 'network-interface')]`, etc","created_at":"2018-05-30T16:15:05Z","updated_at":"2018-05-30T16:15:05Z","html_url":"https://github.com/Cloudzero/cloudzero-reactor-aws/pull/89#discussion_r191831265","pull_request_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/pulls/89","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/pulls/comments/191831265"},"html":{"href":"https://github.com/Cloudzero/cloudzero-reactor-aws/pull/89#discussion_r191831265"},"pull_request":{"href":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/pulls/89"}},"in_reply_to_id":191822027},"pull_request":{"url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/pulls/89","id":190982705,"html_url":"https://github.com/Cloudzero/cloudzero-reactor-aws/pull/89","diff_url":"https://github.com/Cloudzero/cloudzero-reactor-aws/pull/89.diff","patch_url":"https://github.com/Cloudzero/cloudzero-reactor-aws/pull/89.patch","issue_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/issues/89","number":89,"state":"open","locked":false,"title":"Feature/reactor 381 - cloud account probe system","user":{"login":"killthrush","id":6638896,"avatar_url":"https://avatars0.githubusercontent.com/u/6638896?v=4","gravatar_id":"","url":"https://api.github.com/users/killthrush","html_url":"https://github.com/killthrush","followers_url":"https://api.github.com/users/killthrush/followers","following_url":"https://api.github.com/users/killthrush/following{/other_user}","gists_url":"https://api.github.com/users/killthrush/gists{/gist_id}","starred_url":"https://api.github.com/users/killthrush/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/killthrush/subscriptions","organizations_url":"https://api.github.com/users/killthrush/orgs","repos_url":"https://api.github.com/users/killthrush/repos","events_url":"https://api.github.com/users/killthrush/events{/privacy}","received_events_url":"https://api.github.com/users/killthrush/received_events","type":"User","site_admin":false},"body":"### Description\r\n<!--- Provide a brief description of the PR and issue it addresses. -->\r\nAdd a subsystem designed to interface with and control access to connected cloud accounts for the purpose of loading resource data.\r\nIncludes:\r\n* New s3 bucket for caching cloud account metadata\r\n* Account context functions - a data structure used for making account operations easier\r\n* Probe operation used to load all resource metadata from an account on demand and cache it\r\n* Probe plugins for all supported resource types - these contain functions for loading metadata with boto and extracting CZRNs\r\n* Functions to allow loading metadata from the cache for the benefit of enrichment plugins\r\n* New lambda/API endpoint used to force an account probe and make a list of resource observations\r\n* various fixes/cleanup\r\n\r\n- [ ] Existing GitHub Issue? Please provide #: \r\n\r\n### Acceptance checklist\r\n<!--- Here we make sure all criteria for merge has been satisfied. -->\r\n- [ ] Feedback addressed\r\n- [ ] Tests added or modified appropriately\r\n- [ ] All tests passed\r\n\r\n","created_at":"2018-05-28T18:55:17Z","updated_at":"2018-05-30T16:15:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5161ac68a9841639e408cd2935c8bca3a46908fb","assignee":null,"assignees":[],"requested_reviewers":[{"login":"silvexis","id":609050,"avatar_url":"https://avatars0.githubusercontent.com/u/609050?v=4","gravatar_id":"","url":"https://api.github.com/users/silvexis","html_url":"https://github.com/silvexis","followers_url":"https://api.github.com/users/silvexis/followers","following_url":"https://api.github.com/users/silvexis/following{/other_user}","gists_url":"https://api.github.com/users/silvexis/gists{/gist_id}","starred_url":"https://api.github.com/users/silvexis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silvexis/subscriptions","organizations_url":"https://api.github.com/users/silvexis/orgs","repos_url":"https://api.github.com/users/silvexis/repos","events_url":"https://api.github.com/users/silvexis/events{/privacy}","received_events_url":"https://api.github.com/users/silvexis/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/pulls/89/commits","review_comments_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/pulls/89/comments","review_comment_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/issues/89/comments","statuses_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/statuses/8de192418c179d9c90e382fc24d5462d3a82a1c7","head":{"label":"Cloudzero:feature/REACTOR-381","ref":"feature/REACTOR-381","sha":"8de192418c179d9c90e382fc24d5462d3a82a1c7","user":{"login":"Cloudzero","id":22050846,"avatar_url":"https://avatars0.githubusercontent.com/u/22050846?v=4","gravatar_id":"","url":"https://api.github.com/users/Cloudzero","html_url":"https://github.com/Cloudzero","followers_url":"https://api.github.com/users/Cloudzero/followers","following_url":"https://api.github.com/users/Cloudzero/following{/other_user}","gists_url":"https://api.github.com/users/Cloudzero/gists{/gist_id}","starred_url":"https://api.github.com/users/Cloudzero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cloudzero/subscriptions","organizations_url":"https://api.github.com/users/Cloudzero/orgs","repos_url":"https://api.github.com/users/Cloudzero/repos","events_url":"https://api.github.com/users/Cloudzero/events{/privacy}","received_events_url":"https://api.github.com/users/Cloudzero/received_events","type":"Organization","site_admin":false},"repo":{"id":104886482,"name":"cloudzero-reactor-aws","full_name":"Cloudzero/cloudzero-reactor-aws","owner":{"login":"Cloudzero","id":22050846,"avatar_url":"https://avatars0.githubusercontent.com/u/22050846?v=4","gravatar_id":"","url":"https://api.github.com/users/Cloudzero","html_url":"https://github.com/Cloudzero","followers_url":"https://api.github.com/users/Cloudzero/followers","following_url":"https://api.github.com/users/Cloudzero/following{/other_user}","gists_url":"https://api.github.com/users/Cloudzero/gists{/gist_id}","starred_url":"https://api.github.com/users/Cloudzero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cloudzero/subscriptions","organizations_url":"https://api.github.com/users/Cloudzero/orgs","repos_url":"https://api.github.com/users/Cloudzero/repos","events_url":"https://api.github.com/users/Cloudzero/events{/privacy}","received_events_url":"https://api.github.com/users/Cloudzero/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Cloudzero/cloudzero-reactor-aws","description":"CloudZero Reactor for AWS","fork":false,"url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws","forks_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/forks","keys_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/teams","hooks_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/hooks","issue_events_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/issues/events{/number}","events_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/events","assignees_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/assignees{/user}","branches_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/branches{/branch}","tags_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/tags","blobs_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/git/refs{/sha}","trees_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/statuses/{sha}","languages_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/languages","stargazers_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/stargazers","contributors_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/contributors","subscribers_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/subscribers","subscription_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/subscription","commits_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/commits{/sha}","git_commits_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/git/commits{/sha}","comments_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/comments{/number}","issue_comment_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/issues/comments{/number}","contents_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/contents/{+path}","compare_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/merges","archive_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/downloads","issues_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/issues{/number}","pulls_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/pulls{/number}","milestones_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/milestones{/number}","notifications_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/labels{/name}","releases_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/releases{/id}","deployments_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/deployments","created_at":"2017-09-26T13:13:15Z","updated_at":"2018-05-29T17:21:29Z","pushed_at":"2018-05-30T13:10:53Z","git_url":"git://github.com/Cloudzero/cloudzero-reactor-aws.git","ssh_url":"git@github.com:Cloudzero/cloudzero-reactor-aws.git","clone_url":"https://github.com/Cloudzero/cloudzero-reactor-aws.git","svn_url":"https://github.com/Cloudzero/cloudzero-reactor-aws","homepage":"https://www.cloudzero.com/","size":26261,"stargazers_count":20,"watchers_count":20,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":0,"open_issues":2,"watchers":20,"default_branch":"develop"}},"base":{"label":"Cloudzero:develop","ref":"develop","sha":"b0cb9a2c7e06ae97629159a9e6955c2b2deb63e3","user":{"login":"Cloudzero","id":22050846,"avatar_url":"https://avatars0.githubusercontent.com/u/22050846?v=4","gravatar_id":"","url":"https://api.github.com/users/Cloudzero","html_url":"https://github.com/Cloudzero","followers_url":"https://api.github.com/users/Cloudzero/followers","following_url":"https://api.github.com/users/Cloudzero/following{/other_user}","gists_url":"https://api.github.com/users/Cloudzero/gists{/gist_id}","starred_url":"https://api.github.com/users/Cloudzero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cloudzero/subscriptions","organizations_url":"https://api.github.com/users/Cloudzero/orgs","repos_url":"https://api.github.com/users/Cloudzero/repos","events_url":"https://api.github.com/users/Cloudzero/events{/privacy}","received_events_url":"https://api.github.com/users/Cloudzero/received_events","type":"Organization","site_admin":false},"repo":{"id":104886482,"name":"cloudzero-reactor-aws","full_name":"Cloudzero/cloudzero-reactor-aws","owner":{"login":"Cloudzero","id":22050846,"avatar_url":"https://avatars0.githubusercontent.com/u/22050846?v=4","gravatar_id":"","url":"https://api.github.com/users/Cloudzero","html_url":"https://github.com/Cloudzero","followers_url":"https://api.github.com/users/Cloudzero/followers","following_url":"https://api.github.com/users/Cloudzero/following{/other_user}","gists_url":"https://api.github.com/users/Cloudzero/gists{/gist_id}","starred_url":"https://api.github.com/users/Cloudzero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cloudzero/subscriptions","organizations_url":"https://api.github.com/users/Cloudzero/orgs","repos_url":"https://api.github.com/users/Cloudzero/repos","events_url":"https://api.github.com/users/Cloudzero/events{/privacy}","received_events_url":"https://api.github.com/users/Cloudzero/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Cloudzero/cloudzero-reactor-aws","description":"CloudZero Reactor for AWS","fork":false,"url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws","forks_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/forks","keys_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/teams","hooks_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/hooks","issue_events_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/issues/events{/number}","events_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/events","assignees_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/assignees{/user}","branches_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/branches{/branch}","tags_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/tags","blobs_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/git/refs{/sha}","trees_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/statuses/{sha}","languages_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/languages","stargazers_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/stargazers","contributors_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/contributors","subscribers_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/subscribers","subscription_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/subscription","commits_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/commits{/sha}","git_commits_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/git/commits{/sha}","comments_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/comments{/number}","issue_comment_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/issues/comments{/number}","contents_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/contents/{+path}","compare_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/merges","archive_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/downloads","issues_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/issues{/number}","pulls_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/pulls{/number}","milestones_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/milestones{/number}","notifications_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/labels{/name}","releases_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/releases{/id}","deployments_url":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/deployments","created_at":"2017-09-26T13:13:15Z","updated_at":"2018-05-29T17:21:29Z","pushed_at":"2018-05-30T13:10:53Z","git_url":"git://github.com/Cloudzero/cloudzero-reactor-aws.git","ssh_url":"git@github.com:Cloudzero/cloudzero-reactor-aws.git","clone_url":"https://github.com/Cloudzero/cloudzero-reactor-aws.git","svn_url":"https://github.com/Cloudzero/cloudzero-reactor-aws","homepage":"https://www.cloudzero.com/","size":26261,"stargazers_count":20,"watchers_count":20,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":0,"open_issues":2,"watchers":20,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/pulls/89"},"html":{"href":"https://github.com/Cloudzero/cloudzero-reactor-aws/pull/89"},"issue":{"href":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/issues/89"},"comments":{"href":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/issues/89/comments"},"review_comments":{"href":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/pulls/89/comments"},"review_comment":{"href":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/pulls/89/commits"},"statuses":{"href":"https://api.github.com/repos/Cloudzero/cloudzero-reactor-aws/statuses/8de192418c179d9c90e382fc24d5462d3a82a1c7"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"killthrush"}}