{"action":"created","comment":{"url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/pulls/comments/167888391","pull_request_review_id":96169553,"id":167888391,"diff_hunk":"@@ -14,6 +16,67 @@ import (\n \t\"github.com/hashicorp/terraform/terraform\"\n )\n \n+func init() {\n+\tresource.AddTestSweepers(\"aws_dynamodb_table\", &resource.Sweeper{\n+\t\tName: \"aws_dynamodb_table\",\n+\t\tF:    testSweepDynamoDbTables,\n+\t})\n+}\n+\n+func testSweepDynamoDbTables(region string) error {\n+\tclient, err := sharedClientForRegion(region)\n+\tif err != nil {\n+\t\treturn fmt.Errorf(\"error getting client: %s\", err)\n+\t}\n+\tconn := client.(*AWSClient).dynamodbconn\n+\n+\tprefixes := []string{\n+\t\t\"TerraformTest\",\n+\t\t\"tf-acc-test-\",\n+\t\t\"tf-autoscaled-table-\",\n+\t}\n+\n+\terr = conn.ListTablesPages(&dynamodb.ListTablesInput{}, func(out *dynamodb.ListTablesOutput, lastPage bool) bool {\n+\t\tfor _, tableName := range out.TableNames {\n+\t\t\thasPrefix := false\n+\t\t\tfor _, prefix := range prefixes {\n+\t\t\t\tif strings.HasPrefix(*tableName, prefix) {\n+\t\t\t\t\thasPrefix = true\n+\t\t\t\t}\n+\t\t\t}\n+\t\t\tif !hasPrefix {\n+\t\t\t\tcontinue\n+\t\t\t}","path":"aws/resource_aws_dynamodb_table_test.go","position":44,"original_position":44,"commit_id":"fac17ca6dd9e3f209193b4c4d94d6c2b19cb0800","original_commit_id":"fac17ca6dd9e3f209193b4c4d94d6c2b19cb0800","user":{"login":"bflad","id":189114,"avatar_url":"https://avatars3.githubusercontent.com/u/189114?v=4","gravatar_id":"","url":"https://api.github.com/users/bflad","html_url":"https://github.com/bflad","followers_url":"https://api.github.com/users/bflad/followers","following_url":"https://api.github.com/users/bflad/following{/other_user}","gists_url":"https://api.github.com/users/bflad/gists{/gist_id}","starred_url":"https://api.github.com/users/bflad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bflad/subscriptions","organizations_url":"https://api.github.com/users/bflad/orgs","repos_url":"https://api.github.com/users/bflad/repos","events_url":"https://api.github.com/users/bflad/events{/privacy}","received_events_url":"https://api.github.com/users/bflad/received_events","type":"User","site_admin":false},"body":"Ha yes it can. Copypasta 🍝 ","created_at":"2018-02-13T14:55:44Z","updated_at":"2018-02-13T14:55:44Z","html_url":"https://github.com/terraform-providers/terraform-provider-aws/pull/3351#discussion_r167888391","pull_request_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/pulls/3351","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/pulls/comments/167888391"},"html":{"href":"https://github.com/terraform-providers/terraform-provider-aws/pull/3351#discussion_r167888391"},"pull_request":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/pulls/3351"}},"in_reply_to_id":167887949},"pull_request":{"url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/pulls/3351","id":168857691,"html_url":"https://github.com/terraform-providers/terraform-provider-aws/pull/3351","diff_url":"https://github.com/terraform-providers/terraform-provider-aws/pull/3351.diff","patch_url":"https://github.com/terraform-providers/terraform-provider-aws/pull/3351.patch","issue_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/3351","number":3351,"state":"open","locked":false,"title":"test/resource/aws_dynamodb_table: Add sweeper","user":{"login":"bflad","id":189114,"avatar_url":"https://avatars3.githubusercontent.com/u/189114?v=4","gravatar_id":"","url":"https://api.github.com/users/bflad","html_url":"https://github.com/bflad","followers_url":"https://api.github.com/users/bflad/followers","following_url":"https://api.github.com/users/bflad/following{/other_user}","gists_url":"https://api.github.com/users/bflad/gists{/gist_id}","starred_url":"https://api.github.com/users/bflad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bflad/subscriptions","organizations_url":"https://api.github.com/users/bflad/orgs","repos_url":"https://api.github.com/users/bflad/repos","events_url":"https://api.github.com/users/bflad/events{/privacy}","received_events_url":"https://api.github.com/users/bflad/received_events","type":"User","site_admin":false},"body":"♻️ ","created_at":"2018-02-13T14:24:55Z","updated_at":"2018-02-13T14:55:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b44a0b133ae14dd09bb104c628fb35acddd3f0cd","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":801971597,"url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/labels/service/dynamodb","name":"service/dynamodb","color":"bfd4f2","default":false},{"id":737832193,"url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/labels/size/M","name":"size/M","color":"ffffff","default":false},{"id":784095310,"url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/labels/tests","name":"tests","color":"DDDDDD","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/pulls/3351/commits","review_comments_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/pulls/3351/comments","review_comment_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/pulls/comments{/number}","comments_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/3351/comments","statuses_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/statuses/fac17ca6dd9e3f209193b4c4d94d6c2b19cb0800","head":{"label":"terraform-providers:t-aws_dynamodb_table-add-sweeper","ref":"t-aws_dynamodb_table-add-sweeper","sha":"fac17ca6dd9e3f209193b4c4d94d6c2b19cb0800","user":{"login":"terraform-providers","id":29154831,"avatar_url":"https://avatars0.githubusercontent.com/u/29154831?v=4","gravatar_id":"","url":"https://api.github.com/users/terraform-providers","html_url":"https://github.com/terraform-providers","followers_url":"https://api.github.com/users/terraform-providers/followers","following_url":"https://api.github.com/users/terraform-providers/following{/other_user}","gists_url":"https://api.github.com/users/terraform-providers/gists{/gist_id}","starred_url":"https://api.github.com/users/terraform-providers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/terraform-providers/subscriptions","organizations_url":"https://api.github.com/users/terraform-providers/orgs","repos_url":"https://api.github.com/users/terraform-providers/repos","events_url":"https://api.github.com/users/terraform-providers/events{/privacy}","received_events_url":"https://api.github.com/users/terraform-providers/received_events","type":"Organization","site_admin":false},"repo":{"id":93444615,"name":"terraform-provider-aws","full_name":"terraform-providers/terraform-provider-aws","owner":{"login":"terraform-providers","id":29154831,"avatar_url":"https://avatars0.githubusercontent.com/u/29154831?v=4","gravatar_id":"","url":"https://api.github.com/users/terraform-providers","html_url":"https://github.com/terraform-providers","followers_url":"https://api.github.com/users/terraform-providers/followers","following_url":"https://api.github.com/users/terraform-providers/following{/other_user}","gists_url":"https://api.github.com/users/terraform-providers/gists{/gist_id}","starred_url":"https://api.github.com/users/terraform-providers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/terraform-providers/subscriptions","organizations_url":"https://api.github.com/users/terraform-providers/orgs","repos_url":"https://api.github.com/users/terraform-providers/repos","events_url":"https://api.github.com/users/terraform-providers/events{/privacy}","received_events_url":"https://api.github.com/users/terraform-providers/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/terraform-providers/terraform-provider-aws","description":"Terraform AWS provider","fork":false,"url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws","forks_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/forks","keys_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/keys{/key_id}","collaborators_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/teams","hooks_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/hooks","issue_events_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/events{/number}","events_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/events","assignees_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/assignees{/user}","branches_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/branches{/branch}","tags_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/tags","blobs_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/git/refs{/sha}","trees_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/git/trees{/sha}","statuses_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/statuses/{sha}","languages_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/languages","stargazers_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/stargazers","contributors_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/contributors","subscribers_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/subscribers","subscription_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/subscription","commits_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/commits{/sha}","git_commits_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/git/commits{/sha}","comments_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/comments{/number}","issue_comment_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/comments{/number}","contents_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/contents/{+path}","compare_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/compare/{base}...{head}","merges_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/merges","archive_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/downloads","issues_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues{/number}","pulls_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/pulls{/number}","milestones_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/milestones{/number}","notifications_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/labels{/name}","releases_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/releases{/id}","deployments_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/deployments","created_at":"2017-06-05T20:37:52Z","updated_at":"2018-02-13T11:20:51Z","pushed_at":"2018-02-13T14:40:53Z","git_url":"git://github.com/terraform-providers/terraform-provider-aws.git","ssh_url":"git@github.com:terraform-providers/terraform-provider-aws.git","clone_url":"https://github.com/terraform-providers/terraform-provider-aws.git","svn_url":"https://github.com/terraform-providers/terraform-provider-aws","homepage":"https://www.terraform.io/docs/providers/aws/","size":29092,"stargazers_count":795,"watchers_count":795,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":726,"mirror_url":null,"archived":false,"open_issues_count":1662,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0"},"forks":726,"open_issues":1662,"watchers":795,"default_branch":"master"}},"base":{"label":"terraform-providers:master","ref":"master","sha":"c231d4cbb052220058751112d4f547a29b1ee989","user":{"login":"terraform-providers","id":29154831,"avatar_url":"https://avatars0.githubusercontent.com/u/29154831?v=4","gravatar_id":"","url":"https://api.github.com/users/terraform-providers","html_url":"https://github.com/terraform-providers","followers_url":"https://api.github.com/users/terraform-providers/followers","following_url":"https://api.github.com/users/terraform-providers/following{/other_user}","gists_url":"https://api.github.com/users/terraform-providers/gists{/gist_id}","starred_url":"https://api.github.com/users/terraform-providers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/terraform-providers/subscriptions","organizations_url":"https://api.github.com/users/terraform-providers/orgs","repos_url":"https://api.github.com/users/terraform-providers/repos","events_url":"https://api.github.com/users/terraform-providers/events{/privacy}","received_events_url":"https://api.github.com/users/terraform-providers/received_events","type":"Organization","site_admin":false},"repo":{"id":93444615,"name":"terraform-provider-aws","full_name":"terraform-providers/terraform-provider-aws","owner":{"login":"terraform-providers","id":29154831,"avatar_url":"https://avatars0.githubusercontent.com/u/29154831?v=4","gravatar_id":"","url":"https://api.github.com/users/terraform-providers","html_url":"https://github.com/terraform-providers","followers_url":"https://api.github.com/users/terraform-providers/followers","following_url":"https://api.github.com/users/terraform-providers/following{/other_user}","gists_url":"https://api.github.com/users/terraform-providers/gists{/gist_id}","starred_url":"https://api.github.com/users/terraform-providers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/terraform-providers/subscriptions","organizations_url":"https://api.github.com/users/terraform-providers/orgs","repos_url":"https://api.github.com/users/terraform-providers/repos","events_url":"https://api.github.com/users/terraform-providers/events{/privacy}","received_events_url":"https://api.github.com/users/terraform-providers/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/terraform-providers/terraform-provider-aws","description":"Terraform AWS provider","fork":false,"url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws","forks_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/forks","keys_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/keys{/key_id}","collaborators_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/teams","hooks_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/hooks","issue_events_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/events{/number}","events_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/events","assignees_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/assignees{/user}","branches_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/branches{/branch}","tags_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/tags","blobs_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/git/refs{/sha}","trees_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/git/trees{/sha}","statuses_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/statuses/{sha}","languages_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/languages","stargazers_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/stargazers","contributors_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/contributors","subscribers_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/subscribers","subscription_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/subscription","commits_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/commits{/sha}","git_commits_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/git/commits{/sha}","comments_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/comments{/number}","issue_comment_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/comments{/number}","contents_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/contents/{+path}","compare_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/compare/{base}...{head}","merges_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/merges","archive_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/downloads","issues_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues{/number}","pulls_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/pulls{/number}","milestones_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/milestones{/number}","notifications_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/labels{/name}","releases_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/releases{/id}","deployments_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/deployments","created_at":"2017-06-05T20:37:52Z","updated_at":"2018-02-13T11:20:51Z","pushed_at":"2018-02-13T14:40:53Z","git_url":"git://github.com/terraform-providers/terraform-provider-aws.git","ssh_url":"git@github.com:terraform-providers/terraform-provider-aws.git","clone_url":"https://github.com/terraform-providers/terraform-provider-aws.git","svn_url":"https://github.com/terraform-providers/terraform-provider-aws","homepage":"https://www.terraform.io/docs/providers/aws/","size":29092,"stargazers_count":795,"watchers_count":795,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":726,"mirror_url":null,"archived":false,"open_issues_count":1662,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0"},"forks":726,"open_issues":1662,"watchers":795,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/pulls/3351"},"html":{"href":"https://github.com/terraform-providers/terraform-provider-aws/pull/3351"},"issue":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/3351"},"comments":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/3351/comments"},"review_comments":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/pulls/3351/comments"},"review_comment":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/pulls/3351/commits"},"statuses":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/statuses/fac17ca6dd9e3f209193b4c4d94d6c2b19cb0800"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"bflad"}}