{"action":"created","comment":{"url":"https://api.github.com/repos/envato/stack_master/pulls/comments/61166141","id":61166141,"diff_hunk":"@@ -0,0 +1,34 @@\n+module StackMaster\n+  module ParameterResolvers\n+    class AmiFinder\n+      def initialize(region)\n+        @region = region\n+        @owner = ['self']\n+      end\n+\n+      def build_filters(value, prefix = nil)\n+        value.split(',').map do |name_with_value|\n+          name, value = name_with_value.strip.split('=')\n+          @owner.push name if name == 'owner_id'","path":"lib/stack_master/parameter_resolvers/ami_finder.rb","position":null,"original_position":12,"commit_id":"766f5a78cc90d8e1598ffe1b3e5b535b79383b55","original_commit_id":"85fa00ff17d5058b82cc81bb1f3b8d19b8d640a1","user":{"login":"nemski","id":2901882,"avatar_url":"https://avatars.githubusercontent.com/u/2901882?v=3","gravatar_id":"","url":"https://api.github.com/users/nemski","html_url":"https://github.com/nemski","followers_url":"https://api.github.com/users/nemski/followers","following_url":"https://api.github.com/users/nemski/following{/other_user}","gists_url":"https://api.github.com/users/nemski/gists{/gist_id}","starred_url":"https://api.github.com/users/nemski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nemski/subscriptions","organizations_url":"https://api.github.com/users/nemski/orgs","repos_url":"https://api.github.com/users/nemski/repos","events_url":"https://api.github.com/users/nemski/events{/privacy}","received_events_url":"https://api.github.com/users/nemski/received_events","type":"User","site_admin":false},"body":"Fixed in b258da7","created_at":"2016-04-26T21:17:50Z","updated_at":"2016-04-26T21:17:50Z","html_url":"https://github.com/envato/stack_master/pull/108#discussion_r61166141","pull_request_url":"https://api.github.com/repos/envato/stack_master/pulls/108","_links":{"self":{"href":"https://api.github.com/repos/envato/stack_master/pulls/comments/61166141"},"html":{"href":"https://github.com/envato/stack_master/pull/108#discussion_r61166141"},"pull_request":{"href":"https://api.github.com/repos/envato/stack_master/pulls/108"}}},"pull_request":{"url":"https://api.github.com/repos/envato/stack_master/pulls/108","id":67481465,"html_url":"https://github.com/envato/stack_master/pull/108","diff_url":"https://github.com/envato/stack_master/pull/108.diff","patch_url":"https://github.com/envato/stack_master/pull/108.patch","issue_url":"https://api.github.com/repos/envato/stack_master/issues/108","number":108,"state":"open","locked":false,"title":"Create a LatestAmi Parameter Resolver","user":{"login":"nemski","id":2901882,"avatar_url":"https://avatars.githubusercontent.com/u/2901882?v=3","gravatar_id":"","url":"https://api.github.com/users/nemski","html_url":"https://github.com/nemski","followers_url":"https://api.github.com/users/nemski/followers","following_url":"https://api.github.com/users/nemski/following{/other_user}","gists_url":"https://api.github.com/users/nemski/gists{/gist_id}","starred_url":"https://api.github.com/users/nemski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nemski/subscriptions","organizations_url":"https://api.github.com/users/nemski/orgs","repos_url":"https://api.github.com/users/nemski/repos","events_url":"https://api.github.com/users/nemski/events{/privacy}","received_events_url":"https://api.github.com/users/nemski/received_events","type":"User","site_admin":false},"body":"When trying to use an AMI that is shared (publicly or privately) the tags of the AMI are not visible.\r\nSo we must resort to other attributes, such as the name, to find the required AMI.\r\n\r\nThis implements a new resolver and de-couples the logic from LatestAmiByTag into a separate class.\r\n\r\nWe also do some validation that the AMI is from the correct owner. ~~Users need the `iam:ListUsers` permission to do this. This might be a breaking change for some users! However~~ currently the only reason LatestAmiByTags won't return AMIs from other owners is because, the tags of the AMI are not visible. LatestAmi should, in my opinion, only return results from the current account by default. Doing otherwise would be surprising to users and a potential security risk.","created_at":"2016-04-22T09:14:51Z","updated_at":"2016-04-26T21:17:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"752eb62b2a58628296313ddb3b222eec788bfcaf","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/envato/stack_master/pulls/108/commits","review_comments_url":"https://api.github.com/repos/envato/stack_master/pulls/108/comments","review_comment_url":"https://api.github.com/repos/envato/stack_master/pulls/comments{/number}","comments_url":"https://api.github.com/repos/envato/stack_master/issues/108/comments","statuses_url":"https://api.github.com/repos/envato/stack_master/statuses/766f5a78cc90d8e1598ffe1b3e5b535b79383b55","head":{"label":"envato:latest-ami-by-name","ref":"latest-ami-by-name","sha":"766f5a78cc90d8e1598ffe1b3e5b535b79383b55","user":{"login":"envato","id":14786,"avatar_url":"https://avatars.githubusercontent.com/u/14786?v=3","gravatar_id":"","url":"https://api.github.com/users/envato","html_url":"https://github.com/envato","followers_url":"https://api.github.com/users/envato/followers","following_url":"https://api.github.com/users/envato/following{/other_user}","gists_url":"https://api.github.com/users/envato/gists{/gist_id}","starred_url":"https://api.github.com/users/envato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/envato/subscriptions","organizations_url":"https://api.github.com/users/envato/orgs","repos_url":"https://api.github.com/users/envato/repos","events_url":"https://api.github.com/users/envato/events{/privacy}","received_events_url":"https://api.github.com/users/envato/received_events","type":"Organization","site_admin":false},"repo":{"id":44935321,"name":"stack_master","full_name":"envato/stack_master","owner":{"login":"envato","id":14786,"avatar_url":"https://avatars.githubusercontent.com/u/14786?v=3","gravatar_id":"","url":"https://api.github.com/users/envato","html_url":"https://github.com/envato","followers_url":"https://api.github.com/users/envato/followers","following_url":"https://api.github.com/users/envato/following{/other_user}","gists_url":"https://api.github.com/users/envato/gists{/gist_id}","starred_url":"https://api.github.com/users/envato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/envato/subscriptions","organizations_url":"https://api.github.com/users/envato/orgs","repos_url":"https://api.github.com/users/envato/repos","events_url":"https://api.github.com/users/envato/events{/privacy}","received_events_url":"https://api.github.com/users/envato/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/envato/stack_master","description":"The missing CloudFormation tool","fork":false,"url":"https://api.github.com/repos/envato/stack_master","forks_url":"https://api.github.com/repos/envato/stack_master/forks","keys_url":"https://api.github.com/repos/envato/stack_master/keys{/key_id}","collaborators_url":"https://api.github.com/repos/envato/stack_master/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/envato/stack_master/teams","hooks_url":"https://api.github.com/repos/envato/stack_master/hooks","issue_events_url":"https://api.github.com/repos/envato/stack_master/issues/events{/number}","events_url":"https://api.github.com/repos/envato/stack_master/events","assignees_url":"https://api.github.com/repos/envato/stack_master/assignees{/user}","branches_url":"https://api.github.com/repos/envato/stack_master/branches{/branch}","tags_url":"https://api.github.com/repos/envato/stack_master/tags","blobs_url":"https://api.github.com/repos/envato/stack_master/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/envato/stack_master/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/envato/stack_master/git/refs{/sha}","trees_url":"https://api.github.com/repos/envato/stack_master/git/trees{/sha}","statuses_url":"https://api.github.com/repos/envato/stack_master/statuses/{sha}","languages_url":"https://api.github.com/repos/envato/stack_master/languages","stargazers_url":"https://api.github.com/repos/envato/stack_master/stargazers","contributors_url":"https://api.github.com/repos/envato/stack_master/contributors","subscribers_url":"https://api.github.com/repos/envato/stack_master/subscribers","subscription_url":"https://api.github.com/repos/envato/stack_master/subscription","commits_url":"https://api.github.com/repos/envato/stack_master/commits{/sha}","git_commits_url":"https://api.github.com/repos/envato/stack_master/git/commits{/sha}","comments_url":"https://api.github.com/repos/envato/stack_master/comments{/number}","issue_comment_url":"https://api.github.com/repos/envato/stack_master/issues/comments{/number}","contents_url":"https://api.github.com/repos/envato/stack_master/contents/{+path}","compare_url":"https://api.github.com/repos/envato/stack_master/compare/{base}...{head}","merges_url":"https://api.github.com/repos/envato/stack_master/merges","archive_url":"https://api.github.com/repos/envato/stack_master/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/envato/stack_master/downloads","issues_url":"https://api.github.com/repos/envato/stack_master/issues{/number}","pulls_url":"https://api.github.com/repos/envato/stack_master/pulls{/number}","milestones_url":"https://api.github.com/repos/envato/stack_master/milestones{/number}","notifications_url":"https://api.github.com/repos/envato/stack_master/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/envato/stack_master/labels{/name}","releases_url":"https://api.github.com/repos/envato/stack_master/releases{/id}","deployments_url":"https://api.github.com/repos/envato/stack_master/deployments","created_at":"2015-10-25T23:40:28Z","updated_at":"2016-04-06T01:09:11Z","pushed_at":"2016-04-26T06:28:12Z","git_url":"git://github.com/envato/stack_master.git","ssh_url":"git@github.com:envato/stack_master.git","clone_url":"https://github.com/envato/stack_master.git","svn_url":"https://github.com/envato/stack_master","homepage":"https://github.com/envato/stack_master","size":859,"stargazers_count":33,"watchers_count":33,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":13,"forks":7,"open_issues":13,"watchers":33,"default_branch":"master"}},"base":{"label":"envato:master","ref":"master","sha":"7c93d60e5bbfaf28aa2afa67ee522ad66e535cde","user":{"login":"envato","id":14786,"avatar_url":"https://avatars.githubusercontent.com/u/14786?v=3","gravatar_id":"","url":"https://api.github.com/users/envato","html_url":"https://github.com/envato","followers_url":"https://api.github.com/users/envato/followers","following_url":"https://api.github.com/users/envato/following{/other_user}","gists_url":"https://api.github.com/users/envato/gists{/gist_id}","starred_url":"https://api.github.com/users/envato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/envato/subscriptions","organizations_url":"https://api.github.com/users/envato/orgs","repos_url":"https://api.github.com/users/envato/repos","events_url":"https://api.github.com/users/envato/events{/privacy}","received_events_url":"https://api.github.com/users/envato/received_events","type":"Organization","site_admin":false},"repo":{"id":44935321,"name":"stack_master","full_name":"envato/stack_master","owner":{"login":"envato","id":14786,"avatar_url":"https://avatars.githubusercontent.com/u/14786?v=3","gravatar_id":"","url":"https://api.github.com/users/envato","html_url":"https://github.com/envato","followers_url":"https://api.github.com/users/envato/followers","following_url":"https://api.github.com/users/envato/following{/other_user}","gists_url":"https://api.github.com/users/envato/gists{/gist_id}","starred_url":"https://api.github.com/users/envato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/envato/subscriptions","organizations_url":"https://api.github.com/users/envato/orgs","repos_url":"https://api.github.com/users/envato/repos","events_url":"https://api.github.com/users/envato/events{/privacy}","received_events_url":"https://api.github.com/users/envato/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/envato/stack_master","description":"The missing CloudFormation tool","fork":false,"url":"https://api.github.com/repos/envato/stack_master","forks_url":"https://api.github.com/repos/envato/stack_master/forks","keys_url":"https://api.github.com/repos/envato/stack_master/keys{/key_id}","collaborators_url":"https://api.github.com/repos/envato/stack_master/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/envato/stack_master/teams","hooks_url":"https://api.github.com/repos/envato/stack_master/hooks","issue_events_url":"https://api.github.com/repos/envato/stack_master/issues/events{/number}","events_url":"https://api.github.com/repos/envato/stack_master/events","assignees_url":"https://api.github.com/repos/envato/stack_master/assignees{/user}","branches_url":"https://api.github.com/repos/envato/stack_master/branches{/branch}","tags_url":"https://api.github.com/repos/envato/stack_master/tags","blobs_url":"https://api.github.com/repos/envato/stack_master/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/envato/stack_master/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/envato/stack_master/git/refs{/sha}","trees_url":"https://api.github.com/repos/envato/stack_master/git/trees{/sha}","statuses_url":"https://api.github.com/repos/envato/stack_master/statuses/{sha}","languages_url":"https://api.github.com/repos/envato/stack_master/languages","stargazers_url":"https://api.github.com/repos/envato/stack_master/stargazers","contributors_url":"https://api.github.com/repos/envato/stack_master/contributors","subscribers_url":"https://api.github.com/repos/envato/stack_master/subscribers","subscription_url":"https://api.github.com/repos/envato/stack_master/subscription","commits_url":"https://api.github.com/repos/envato/stack_master/commits{/sha}","git_commits_url":"https://api.github.com/repos/envato/stack_master/git/commits{/sha}","comments_url":"https://api.github.com/repos/envato/stack_master/comments{/number}","issue_comment_url":"https://api.github.com/repos/envato/stack_master/issues/comments{/number}","contents_url":"https://api.github.com/repos/envato/stack_master/contents/{+path}","compare_url":"https://api.github.com/repos/envato/stack_master/compare/{base}...{head}","merges_url":"https://api.github.com/repos/envato/stack_master/merges","archive_url":"https://api.github.com/repos/envato/stack_master/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/envato/stack_master/downloads","issues_url":"https://api.github.com/repos/envato/stack_master/issues{/number}","pulls_url":"https://api.github.com/repos/envato/stack_master/pulls{/number}","milestones_url":"https://api.github.com/repos/envato/stack_master/milestones{/number}","notifications_url":"https://api.github.com/repos/envato/stack_master/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/envato/stack_master/labels{/name}","releases_url":"https://api.github.com/repos/envato/stack_master/releases{/id}","deployments_url":"https://api.github.com/repos/envato/stack_master/deployments","created_at":"2015-10-25T23:40:28Z","updated_at":"2016-04-06T01:09:11Z","pushed_at":"2016-04-26T06:28:12Z","git_url":"git://github.com/envato/stack_master.git","ssh_url":"git@github.com:envato/stack_master.git","clone_url":"https://github.com/envato/stack_master.git","svn_url":"https://github.com/envato/stack_master","homepage":"https://github.com/envato/stack_master","size":859,"stargazers_count":33,"watchers_count":33,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":13,"forks":7,"open_issues":13,"watchers":33,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/envato/stack_master/pulls/108"},"html":{"href":"https://github.com/envato/stack_master/pull/108"},"issue":{"href":"https://api.github.com/repos/envato/stack_master/issues/108"},"comments":{"href":"https://api.github.com/repos/envato/stack_master/issues/108/comments"},"review_comments":{"href":"https://api.github.com/repos/envato/stack_master/pulls/108/comments"},"review_comment":{"href":"https://api.github.com/repos/envato/stack_master/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/envato/stack_master/pulls/108/commits"},"statuses":{"href":"https://api.github.com/repos/envato/stack_master/statuses/766f5a78cc90d8e1598ffe1b3e5b535b79383b55"}}}}