{"action":"created","comment":{"url":"https://api.github.com/repos/gruntwork-io/aws-nuke/pulls/comments/166625762","pull_request_review_id":94714283,"id":166625762,"diff_hunk":"@@ -19,17 +22,32 @@ func CreateCli(version string) *cli.App {\n \tapp.HelpName = app.Name\n \tapp.Author = \"Gruntwork <www.gruntwork.io>\"\n \tapp.Version = version\n-\tapp.Usage = \"A CLI tool to cleanup AWS resources (EC2). THIS TOOL WILL COMPLETELY REMOVE ALL RESOURCES AND ITS EFFECTS ARE IRREVERSIBLE!!!\"\n+\tapp.Usage = \"A CLI tool to cleanup AWS resources (ASG, ELB, ELBv2, EBS, EC2). THIS TOOL WILL COMPLETELY REMOVE ALL RESOURCES AND ITS EFFECTS ARE IRREVERSIBLE!!!\"\n+\tapp.Flags = []cli.Flag{\n+\t\tcli.StringSliceFlag{\n+\t\t\tName:  \"exclude-region\",\n+\t\t\tUsage: \"regions to exclude\",\n+\t\t},\n+\t}\n \tapp.Action = errors.WithPanicHandling(awsNuke)\n \n \treturn app\n }\n \n // Nuke it all!!!\n func awsNuke(c *cli.Context) error {\n-\tlogging.Logger.Infoln(\"Retrieving all active AWS resources\")\n+\tregions := aws.GetAllRegions()\n+\texcludedRegions := c.StringSlice(\"exclude-region\")\n+\n+\tfor _, excludedRegion := range excludedRegions {\n+\t\tif !collections.ListContainsElement(regions, excludedRegion) {\n+\t\t\tfmt.Println(excludedRegion + \"is not a valid AWS Region\")\n+\t\t\treturn InvalidFlagError{}","path":"commands/cli.go","position":38,"original_position":38,"commit_id":"d6ce82ccada6580f776f774de8c2e5a0c431b4aa","original_commit_id":"d6ce82ccada6580f776f774de8c2e5a0c431b4aa","user":{"login":"brikis98","id":711908,"avatar_url":"https://avatars1.githubusercontent.com/u/711908?v=4","gravatar_id":"","url":"https://api.github.com/users/brikis98","html_url":"https://github.com/brikis98","followers_url":"https://api.github.com/users/brikis98/followers","following_url":"https://api.github.com/users/brikis98/following{/other_user}","gists_url":"https://api.github.com/users/brikis98/gists{/gist_id}","starred_url":"https://api.github.com/users/brikis98/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brikis98/subscriptions","organizations_url":"https://api.github.com/users/brikis98/orgs","repos_url":"https://api.github.com/users/brikis98/repos","events_url":"https://api.github.com/users/brikis98/events{/privacy}","received_events_url":"https://api.github.com/users/brikis98/received_events","type":"User","site_admin":false},"body":"Instead of the error message in a println and a separate error with no info, update `InvalidFlagError` to have the flag name and value as fields and to have an `Error()` method that clearly shows them to the user.","created_at":"2018-02-07T14:05:15Z","updated_at":"2018-02-07T14:06:45Z","html_url":"https://github.com/gruntwork-io/aws-nuke/pull/5#discussion_r166625762","pull_request_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/pulls/5","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/gruntwork-io/aws-nuke/pulls/comments/166625762"},"html":{"href":"https://github.com/gruntwork-io/aws-nuke/pull/5#discussion_r166625762"},"pull_request":{"href":"https://api.github.com/repos/gruntwork-io/aws-nuke/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/gruntwork-io/aws-nuke/pulls/5","id":167118963,"html_url":"https://github.com/gruntwork-io/aws-nuke/pull/5","diff_url":"https://github.com/gruntwork-io/aws-nuke/pull/5.diff","patch_url":"https://github.com/gruntwork-io/aws-nuke/pull/5.patch","issue_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/issues/5","number":5,"state":"open","locked":false,"title":"aws-nuke v0.0.2","user":{"login":"tonerdo","id":7319262,"avatar_url":"https://avatars3.githubusercontent.com/u/7319262?v=4","gravatar_id":"","url":"https://api.github.com/users/tonerdo","html_url":"https://github.com/tonerdo","followers_url":"https://api.github.com/users/tonerdo/followers","following_url":"https://api.github.com/users/tonerdo/following{/other_user}","gists_url":"https://api.github.com/users/tonerdo/gists{/gist_id}","starred_url":"https://api.github.com/users/tonerdo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonerdo/subscriptions","organizations_url":"https://api.github.com/users/tonerdo/orgs","repos_url":"https://api.github.com/users/tonerdo/repos","events_url":"https://api.github.com/users/tonerdo/events{/privacy}","received_events_url":"https://api.github.com/users/tonerdo/received_events","type":"User","site_admin":false},"body":"Adds support for nuking:\r\n\r\n- Auto Scale Groups\r\n- Elastic Load Balancers (Classic and v2)\r\n- EBS Volumes","created_at":"2018-02-05T11:23:57Z","updated_at":"2018-02-07T14:06:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1c30f2f8e056a45d9855c789510e308adca3f777","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/pulls/5/commits","review_comments_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/pulls/5/comments","review_comment_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/issues/5/comments","statuses_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/statuses/d6ce82ccada6580f776f774de8c2e5a0c431b4aa","head":{"label":"gruntwork-io:v0.0.2","ref":"v0.0.2","sha":"d6ce82ccada6580f776f774de8c2e5a0c431b4aa","user":{"login":"gruntwork-io","id":17118990,"avatar_url":"https://avatars3.githubusercontent.com/u/17118990?v=4","gravatar_id":"","url":"https://api.github.com/users/gruntwork-io","html_url":"https://github.com/gruntwork-io","followers_url":"https://api.github.com/users/gruntwork-io/followers","following_url":"https://api.github.com/users/gruntwork-io/following{/other_user}","gists_url":"https://api.github.com/users/gruntwork-io/gists{/gist_id}","starred_url":"https://api.github.com/users/gruntwork-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gruntwork-io/subscriptions","organizations_url":"https://api.github.com/users/gruntwork-io/orgs","repos_url":"https://api.github.com/users/gruntwork-io/repos","events_url":"https://api.github.com/users/gruntwork-io/events{/privacy}","received_events_url":"https://api.github.com/users/gruntwork-io/received_events","type":"Organization","site_admin":false},"repo":{"id":90905599,"name":"aws-nuke","full_name":"gruntwork-io/aws-nuke","owner":{"login":"gruntwork-io","id":17118990,"avatar_url":"https://avatars3.githubusercontent.com/u/17118990?v=4","gravatar_id":"","url":"https://api.github.com/users/gruntwork-io","html_url":"https://github.com/gruntwork-io","followers_url":"https://api.github.com/users/gruntwork-io/followers","following_url":"https://api.github.com/users/gruntwork-io/following{/other_user}","gists_url":"https://api.github.com/users/gruntwork-io/gists{/gist_id}","starred_url":"https://api.github.com/users/gruntwork-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gruntwork-io/subscriptions","organizations_url":"https://api.github.com/users/gruntwork-io/orgs","repos_url":"https://api.github.com/users/gruntwork-io/repos","events_url":"https://api.github.com/users/gruntwork-io/events{/privacy}","received_events_url":"https://api.github.com/users/gruntwork-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gruntwork-io/aws-nuke","description":null,"fork":false,"url":"https://api.github.com/repos/gruntwork-io/aws-nuke","forks_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/forks","keys_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/teams","hooks_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/hooks","issue_events_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/issues/events{/number}","events_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/events","assignees_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/assignees{/user}","branches_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/branches{/branch}","tags_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/tags","blobs_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/git/refs{/sha}","trees_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/statuses/{sha}","languages_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/languages","stargazers_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/stargazers","contributors_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/contributors","subscribers_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/subscribers","subscription_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/subscription","commits_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/commits{/sha}","git_commits_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/git/commits{/sha}","comments_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/comments{/number}","issue_comment_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/issues/comments{/number}","contents_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/contents/{+path}","compare_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/merges","archive_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/downloads","issues_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/issues{/number}","pulls_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/pulls{/number}","milestones_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/milestones{/number}","notifications_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/labels{/name}","releases_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/releases{/id}","deployments_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/deployments","created_at":"2017-05-10T20:30:15Z","updated_at":"2018-02-05T21:39:24Z","pushed_at":"2018-02-07T12:17:14Z","git_url":"git://github.com/gruntwork-io/aws-nuke.git","ssh_url":"git@github.com:gruntwork-io/aws-nuke.git","clone_url":"https://github.com/gruntwork-io/aws-nuke.git","svn_url":"https://github.com/gruntwork-io/aws-nuke","homepage":null,"size":103,"stargazers_count":7,"watchers_count":7,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":4,"open_issues":1,"watchers":7,"default_branch":"master"}},"base":{"label":"gruntwork-io:master","ref":"master","sha":"698207e3a2386eb27d81071ed44d3efc206747e3","user":{"login":"gruntwork-io","id":17118990,"avatar_url":"https://avatars3.githubusercontent.com/u/17118990?v=4","gravatar_id":"","url":"https://api.github.com/users/gruntwork-io","html_url":"https://github.com/gruntwork-io","followers_url":"https://api.github.com/users/gruntwork-io/followers","following_url":"https://api.github.com/users/gruntwork-io/following{/other_user}","gists_url":"https://api.github.com/users/gruntwork-io/gists{/gist_id}","starred_url":"https://api.github.com/users/gruntwork-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gruntwork-io/subscriptions","organizations_url":"https://api.github.com/users/gruntwork-io/orgs","repos_url":"https://api.github.com/users/gruntwork-io/repos","events_url":"https://api.github.com/users/gruntwork-io/events{/privacy}","received_events_url":"https://api.github.com/users/gruntwork-io/received_events","type":"Organization","site_admin":false},"repo":{"id":90905599,"name":"aws-nuke","full_name":"gruntwork-io/aws-nuke","owner":{"login":"gruntwork-io","id":17118990,"avatar_url":"https://avatars3.githubusercontent.com/u/17118990?v=4","gravatar_id":"","url":"https://api.github.com/users/gruntwork-io","html_url":"https://github.com/gruntwork-io","followers_url":"https://api.github.com/users/gruntwork-io/followers","following_url":"https://api.github.com/users/gruntwork-io/following{/other_user}","gists_url":"https://api.github.com/users/gruntwork-io/gists{/gist_id}","starred_url":"https://api.github.com/users/gruntwork-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gruntwork-io/subscriptions","organizations_url":"https://api.github.com/users/gruntwork-io/orgs","repos_url":"https://api.github.com/users/gruntwork-io/repos","events_url":"https://api.github.com/users/gruntwork-io/events{/privacy}","received_events_url":"https://api.github.com/users/gruntwork-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gruntwork-io/aws-nuke","description":null,"fork":false,"url":"https://api.github.com/repos/gruntwork-io/aws-nuke","forks_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/forks","keys_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/teams","hooks_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/hooks","issue_events_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/issues/events{/number}","events_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/events","assignees_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/assignees{/user}","branches_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/branches{/branch}","tags_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/tags","blobs_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/git/refs{/sha}","trees_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/statuses/{sha}","languages_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/languages","stargazers_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/stargazers","contributors_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/contributors","subscribers_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/subscribers","subscription_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/subscription","commits_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/commits{/sha}","git_commits_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/git/commits{/sha}","comments_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/comments{/number}","issue_comment_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/issues/comments{/number}","contents_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/contents/{+path}","compare_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/merges","archive_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/downloads","issues_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/issues{/number}","pulls_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/pulls{/number}","milestones_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/milestones{/number}","notifications_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/labels{/name}","releases_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/releases{/id}","deployments_url":"https://api.github.com/repos/gruntwork-io/aws-nuke/deployments","created_at":"2017-05-10T20:30:15Z","updated_at":"2018-02-05T21:39:24Z","pushed_at":"2018-02-07T12:17:14Z","git_url":"git://github.com/gruntwork-io/aws-nuke.git","ssh_url":"git@github.com:gruntwork-io/aws-nuke.git","clone_url":"https://github.com/gruntwork-io/aws-nuke.git","svn_url":"https://github.com/gruntwork-io/aws-nuke","homepage":null,"size":103,"stargazers_count":7,"watchers_count":7,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":4,"open_issues":1,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gruntwork-io/aws-nuke/pulls/5"},"html":{"href":"https://github.com/gruntwork-io/aws-nuke/pull/5"},"issue":{"href":"https://api.github.com/repos/gruntwork-io/aws-nuke/issues/5"},"comments":{"href":"https://api.github.com/repos/gruntwork-io/aws-nuke/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/gruntwork-io/aws-nuke/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/gruntwork-io/aws-nuke/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gruntwork-io/aws-nuke/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/gruntwork-io/aws-nuke/statuses/d6ce82ccada6580f776f774de8c2e5a0c431b4aa"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"brikis98"}}