{"action":"created","comment":{"url":"https://api.github.com/repos/capitalone/cloud-custodian/pulls/comments/89187720","pull_request_review_id":9735718,"id":89187720,"diff_hunk":"@@ -107,3 +109,34 @@ def _augment(r):\n \n         return super(LambdaCrossAccountAccessFilter, self).process(\n             resources, event)\n+\n+@actions.register('delete')\n+class Delete(BaseAction):\n+\n+    schema = {\n+        'type': 'object',\n+        'properties': {\n+            'type': {'enum': ['delete'],\n+                     'qualifier': {'type': 'string'}}\n+            }\n+        }\n+\n+    def process(self, functions):\n+        qualifier = self.data.get('qualifier', '')\n+\n+        # Concurrency feels like overkill here.\n+        client = local_session(self.manager.session_factory).client('lambda')\n+        for function in functions:\n+            params = dict(\n+                FunctionName=function['FunctionName'])\n+            if qualifier:\n+                params['Qualifier'] = qualifier\n+\n+            try:\n+                client.delete_function(**params)\n+            except ClientError as e:\n+                if e.response['Error']['Code'] == \"ResourceNotFoundException\":\n+                    continue\n+                raise\n+\n+            self.log.info(\"Deleted function: %s\", function['FunctionName'])","path":"c7n/resources/awslambda.py","position":49,"original_position":49,"commit_id":"7370d18c15bb853903eb66fc96ab575aa30d569a","original_commit_id":"7370d18c15bb853903eb66fc96ab575aa30d569a","user":{"login":"kapilt","id":21650,"avatar_url":"https://avatars.githubusercontent.com/u/21650?v=3","gravatar_id":"","url":"https://api.github.com/users/kapilt","html_url":"https://github.com/kapilt","followers_url":"https://api.github.com/users/kapilt/followers","following_url":"https://api.github.com/users/kapilt/following{/other_user}","gists_url":"https://api.github.com/users/kapilt/gists{/gist_id}","starred_url":"https://api.github.com/users/kapilt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kapilt/subscriptions","organizations_url":"https://api.github.com/users/kapilt/orgs","repos_url":"https://api.github.com/users/kapilt/repos","events_url":"https://api.github.com/users/kapilt/events{/privacy}","received_events_url":"https://api.github.com/users/kapilt/received_events","type":"User","site_admin":false},"body":"this should be log.debug due to volume of messages from a loop\r\n","created_at":"2016-11-22T19:07:09Z","updated_at":"2016-11-22T19:08:52Z","html_url":"https://github.com/capitalone/cloud-custodian/pull/645#discussion_r89187720","pull_request_url":"https://api.github.com/repos/capitalone/cloud-custodian/pulls/645","_links":{"self":{"href":"https://api.github.com/repos/capitalone/cloud-custodian/pulls/comments/89187720"},"html":{"href":"https://github.com/capitalone/cloud-custodian/pull/645#discussion_r89187720"},"pull_request":{"href":"https://api.github.com/repos/capitalone/cloud-custodian/pulls/645"}}},"pull_request":{"url":"https://api.github.com/repos/capitalone/cloud-custodian/pulls/645","id":94820560,"html_url":"https://github.com/capitalone/cloud-custodian/pull/645","diff_url":"https://github.com/capitalone/cloud-custodian/pull/645.diff","patch_url":"https://github.com/capitalone/cloud-custodian/pull/645.patch","issue_url":"https://api.github.com/repos/capitalone/cloud-custodian/issues/645","number":645,"state":"open","locked":false,"title":"Added delete action to awslambda resource.","user":{"login":"jimmyraywv","id":1210431,"avatar_url":"https://avatars.githubusercontent.com/u/1210431?v=3","gravatar_id":"","url":"https://api.github.com/users/jimmyraywv","html_url":"https://github.com/jimmyraywv","followers_url":"https://api.github.com/users/jimmyraywv/followers","following_url":"https://api.github.com/users/jimmyraywv/following{/other_user}","gists_url":"https://api.github.com/users/jimmyraywv/gists{/gist_id}","starred_url":"https://api.github.com/users/jimmyraywv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimmyraywv/subscriptions","organizations_url":"https://api.github.com/users/jimmyraywv/orgs","repos_url":"https://api.github.com/users/jimmyraywv/repos","events_url":"https://api.github.com/users/jimmyraywv/events{/privacy}","received_events_url":"https://api.github.com/users/jimmyraywv/received_events","type":"User","site_admin":false},"body":"Still need to update tests.","created_at":"2016-11-22T14:08:41Z","updated_at":"2016-11-22T19:08:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"983ab9a66dd4160cd012ebcfbe379bca9925f27c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/capitalone/cloud-custodian/pulls/645/commits","review_comments_url":"https://api.github.com/repos/capitalone/cloud-custodian/pulls/645/comments","review_comment_url":"https://api.github.com/repos/capitalone/cloud-custodian/pulls/comments{/number}","comments_url":"https://api.github.com/repos/capitalone/cloud-custodian/issues/645/comments","statuses_url":"https://api.github.com/repos/capitalone/cloud-custodian/statuses/7370d18c15bb853903eb66fc96ab575aa30d569a","head":{"label":"jimmyraywv:master","ref":"master","sha":"7370d18c15bb853903eb66fc96ab575aa30d569a","user":{"login":"jimmyraywv","id":1210431,"avatar_url":"https://avatars.githubusercontent.com/u/1210431?v=3","gravatar_id":"","url":"https://api.github.com/users/jimmyraywv","html_url":"https://github.com/jimmyraywv","followers_url":"https://api.github.com/users/jimmyraywv/followers","following_url":"https://api.github.com/users/jimmyraywv/following{/other_user}","gists_url":"https://api.github.com/users/jimmyraywv/gists{/gist_id}","starred_url":"https://api.github.com/users/jimmyraywv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimmyraywv/subscriptions","organizations_url":"https://api.github.com/users/jimmyraywv/orgs","repos_url":"https://api.github.com/users/jimmyraywv/repos","events_url":"https://api.github.com/users/jimmyraywv/events{/privacy}","received_events_url":"https://api.github.com/users/jimmyraywv/received_events","type":"User","site_admin":false},"repo":{"id":73727160,"name":"cloud-custodian","full_name":"jimmyraywv/cloud-custodian","owner":{"login":"jimmyraywv","id":1210431,"avatar_url":"https://avatars.githubusercontent.com/u/1210431?v=3","gravatar_id":"","url":"https://api.github.com/users/jimmyraywv","html_url":"https://github.com/jimmyraywv","followers_url":"https://api.github.com/users/jimmyraywv/followers","following_url":"https://api.github.com/users/jimmyraywv/following{/other_user}","gists_url":"https://api.github.com/users/jimmyraywv/gists{/gist_id}","starred_url":"https://api.github.com/users/jimmyraywv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimmyraywv/subscriptions","organizations_url":"https://api.github.com/users/jimmyraywv/orgs","repos_url":"https://api.github.com/users/jimmyraywv/repos","events_url":"https://api.github.com/users/jimmyraywv/events{/privacy}","received_events_url":"https://api.github.com/users/jimmyraywv/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jimmyraywv/cloud-custodian","description":"Rules engine for AWS management, DSL in yaml for query, filter, and actions on resources","fork":true,"url":"https://api.github.com/repos/jimmyraywv/cloud-custodian","forks_url":"https://api.github.com/repos/jimmyraywv/cloud-custodian/forks","keys_url":"https://api.github.com/repos/jimmyraywv/cloud-custodian/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jimmyraywv/cloud-custodian/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jimmyraywv/cloud-custodian/teams","hooks_url":"https://api.github.com/repos/jimmyraywv/cloud-custodian/hooks","issue_events_url":"https://api.github.com/repos/jimmyraywv/cloud-custodian/issues/events{/number}","events_url":"https://api.github.com/repos/jimmyraywv/cloud-custodian/events","assignees_url":"https://api.github.com/repos/jimmyraywv/cloud-custodian/assignees{/user}","branches_url":"https://api.github.com/repos/jimmyraywv/cloud-custodian/branches{/branch}","tags_url":"https://api.github.com/repos/jimmyraywv/cloud-custodian/tags","blobs_url":"https://api.github.com/repos/jimmyraywv/cloud-custodian/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jimmyraywv/cloud-custodian/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jimmyraywv/cloud-custodian/git/refs{/sha}","trees_url":"https://api.github.com/repos/jimmyraywv/cloud-custodian/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jimmyraywv/cloud-custodian/statuses/{sha}","languages_url":"https://api.github.com/repos/jimmyraywv/cloud-custodian/languages","stargazers_url":"https://api.github.com/repos/jimmyraywv/cloud-custodian/stargazers","contributors_url":"https://api.github.com/repos/jimmyraywv/cloud-custodian/contributors","subscribers_url":"https://api.github.com/repos/jimmyraywv/cloud-custodian/subscribers","subscription_url":"https://api.github.com/repos/jimmyraywv/cloud-custodian/subscription","commits_url":"https://api.github.com/repos/jimmyraywv/cloud-custodian/commits{/sha}","git_commits_url":"https://api.github.com/repos/jimmyraywv/cloud-custodian/git/commits{/sha}","comments_url":"https://api.github.com/repos/jimmyraywv/cloud-custodian/comments{/number}","issue_comment_url":"https://api.github.com/repos/jimmyraywv/cloud-custodian/issues/comments{/number}","contents_url":"https://api.github.com/repos/jimmyraywv/cloud-custodian/contents/{+path}","compare_url":"https://api.github.com/repos/jimmyraywv/cloud-custodian/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jimmyraywv/cloud-custodian/merges","archive_url":"https://api.github.com/repos/jimmyraywv/cloud-custodian/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jimmyraywv/cloud-custodian/downloads","issues_url":"https://api.github.com/repos/jimmyraywv/cloud-custodian/issues{/number}","pulls_url":"https://api.github.com/repos/jimmyraywv/cloud-custodian/pulls{/number}","milestones_url":"https://api.github.com/repos/jimmyraywv/cloud-custodian/milestones{/number}","notifications_url":"https://api.github.com/repos/jimmyraywv/cloud-custodian/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jimmyraywv/cloud-custodian/labels{/name}","releases_url":"https://api.github.com/repos/jimmyraywv/cloud-custodian/releases{/id}","deployments_url":"https://api.github.com/repos/jimmyraywv/cloud-custodian/deployments","created_at":"2016-11-14T16:57:23Z","updated_at":"2016-11-14T16:57:25Z","pushed_at":"2016-11-22T18:39:53Z","git_url":"git://github.com/jimmyraywv/cloud-custodian.git","ssh_url":"git@github.com:jimmyraywv/cloud-custodian.git","clone_url":"https://github.com/jimmyraywv/cloud-custodian.git","svn_url":"https://github.com/jimmyraywv/cloud-custodian","homepage":"http://www.capitalone.io/cloud-custodian/","size":8230,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"capitalone:master","ref":"master","sha":"b1ab59465f9b80e19de97f1b1a8cfa5563eb1539","user":{"login":"capitalone","id":8644615,"avatar_url":"https://avatars.githubusercontent.com/u/8644615?v=3","gravatar_id":"","url":"https://api.github.com/users/capitalone","html_url":"https://github.com/capitalone","followers_url":"https://api.github.com/users/capitalone/followers","following_url":"https://api.github.com/users/capitalone/following{/other_user}","gists_url":"https://api.github.com/users/capitalone/gists{/gist_id}","starred_url":"https://api.github.com/users/capitalone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/capitalone/subscriptions","organizations_url":"https://api.github.com/users/capitalone/orgs","repos_url":"https://api.github.com/users/capitalone/repos","events_url":"https://api.github.com/users/capitalone/events{/privacy}","received_events_url":"https://api.github.com/users/capitalone/received_events","type":"Organization","site_admin":false},"repo":{"id":52837350,"name":"cloud-custodian","full_name":"capitalone/cloud-custodian","owner":{"login":"capitalone","id":8644615,"avatar_url":"https://avatars.githubusercontent.com/u/8644615?v=3","gravatar_id":"","url":"https://api.github.com/users/capitalone","html_url":"https://github.com/capitalone","followers_url":"https://api.github.com/users/capitalone/followers","following_url":"https://api.github.com/users/capitalone/following{/other_user}","gists_url":"https://api.github.com/users/capitalone/gists{/gist_id}","starred_url":"https://api.github.com/users/capitalone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/capitalone/subscriptions","organizations_url":"https://api.github.com/users/capitalone/orgs","repos_url":"https://api.github.com/users/capitalone/repos","events_url":"https://api.github.com/users/capitalone/events{/privacy}","received_events_url":"https://api.github.com/users/capitalone/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/capitalone/cloud-custodian","description":"Rules engine for AWS management, DSL in yaml for query, filter, and actions on resources","fork":false,"url":"https://api.github.com/repos/capitalone/cloud-custodian","forks_url":"https://api.github.com/repos/capitalone/cloud-custodian/forks","keys_url":"https://api.github.com/repos/capitalone/cloud-custodian/keys{/key_id}","collaborators_url":"https://api.github.com/repos/capitalone/cloud-custodian/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/capitalone/cloud-custodian/teams","hooks_url":"https://api.github.com/repos/capitalone/cloud-custodian/hooks","issue_events_url":"https://api.github.com/repos/capitalone/cloud-custodian/issues/events{/number}","events_url":"https://api.github.com/repos/capitalone/cloud-custodian/events","assignees_url":"https://api.github.com/repos/capitalone/cloud-custodian/assignees{/user}","branches_url":"https://api.github.com/repos/capitalone/cloud-custodian/branches{/branch}","tags_url":"https://api.github.com/repos/capitalone/cloud-custodian/tags","blobs_url":"https://api.github.com/repos/capitalone/cloud-custodian/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/capitalone/cloud-custodian/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/capitalone/cloud-custodian/git/refs{/sha}","trees_url":"https://api.github.com/repos/capitalone/cloud-custodian/git/trees{/sha}","statuses_url":"https://api.github.com/repos/capitalone/cloud-custodian/statuses/{sha}","languages_url":"https://api.github.com/repos/capitalone/cloud-custodian/languages","stargazers_url":"https://api.github.com/repos/capitalone/cloud-custodian/stargazers","contributors_url":"https://api.github.com/repos/capitalone/cloud-custodian/contributors","subscribers_url":"https://api.github.com/repos/capitalone/cloud-custodian/subscribers","subscription_url":"https://api.github.com/repos/capitalone/cloud-custodian/subscription","commits_url":"https://api.github.com/repos/capitalone/cloud-custodian/commits{/sha}","git_commits_url":"https://api.github.com/repos/capitalone/cloud-custodian/git/commits{/sha}","comments_url":"https://api.github.com/repos/capitalone/cloud-custodian/comments{/number}","issue_comment_url":"https://api.github.com/repos/capitalone/cloud-custodian/issues/comments{/number}","contents_url":"https://api.github.com/repos/capitalone/cloud-custodian/contents/{+path}","compare_url":"https://api.github.com/repos/capitalone/cloud-custodian/compare/{base}...{head}","merges_url":"https://api.github.com/repos/capitalone/cloud-custodian/merges","archive_url":"https://api.github.com/repos/capitalone/cloud-custodian/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/capitalone/cloud-custodian/downloads","issues_url":"https://api.github.com/repos/capitalone/cloud-custodian/issues{/number}","pulls_url":"https://api.github.com/repos/capitalone/cloud-custodian/pulls{/number}","milestones_url":"https://api.github.com/repos/capitalone/cloud-custodian/milestones{/number}","notifications_url":"https://api.github.com/repos/capitalone/cloud-custodian/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/capitalone/cloud-custodian/labels{/name}","releases_url":"https://api.github.com/repos/capitalone/cloud-custodian/releases{/id}","deployments_url":"https://api.github.com/repos/capitalone/cloud-custodian/deployments","created_at":"2016-03-01T01:11:20Z","updated_at":"2016-11-22T11:31:24Z","pushed_at":"2016-11-22T18:54:05Z","git_url":"git://github.com/capitalone/cloud-custodian.git","ssh_url":"git@github.com:capitalone/cloud-custodian.git","clone_url":"https://github.com/capitalone/cloud-custodian.git","svn_url":"https://github.com/capitalone/cloud-custodian","homepage":"http://www.capitalone.io/cloud-custodian/","size":11941,"stargazers_count":470,"watchers_count":470,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":97,"mirror_url":null,"open_issues_count":106,"forks":97,"open_issues":106,"watchers":470,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/capitalone/cloud-custodian/pulls/645"},"html":{"href":"https://github.com/capitalone/cloud-custodian/pull/645"},"issue":{"href":"https://api.github.com/repos/capitalone/cloud-custodian/issues/645"},"comments":{"href":"https://api.github.com/repos/capitalone/cloud-custodian/issues/645/comments"},"review_comments":{"href":"https://api.github.com/repos/capitalone/cloud-custodian/pulls/645/comments"},"review_comment":{"href":"https://api.github.com/repos/capitalone/cloud-custodian/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/capitalone/cloud-custodian/pulls/645/commits"},"statuses":{"href":"https://api.github.com/repos/capitalone/cloud-custodian/statuses/7370d18c15bb853903eb66fc96ab575aa30d569a"}}}}
{"actor":{"display_login":"kapilt"}}