{"action":"created","comment":{"url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/pulls/comments/215439527","pull_request_review_id":152698832,"id":215439527,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNTQzOTUyNw==","diff_hunk":"@@ -0,0 +1,218 @@\n+package google\n+\n+import (\n+\t\"fmt\"\n+\t\"testing\"\n+\n+\t\"github.com/hashicorp/terraform/helper/acctest\"\n+\t\"github.com/hashicorp/terraform/helper/resource\"\n+\t\"github.com/hashicorp/terraform/terraform\"\n+)\n+\n+func TestAccAttachedDisk_basic(t *testing.T) {\n+\tt.Parallel()\n+\n+\tdiskName := acctest.RandomWithPrefix(\"tf-test-disk\")\n+\tinstanceName := acctest.RandomWithPrefix(\"tf-test-inst\")\n+\timportID := fmt.Sprintf(\"%s/us-central1-a/%s:%s\", getTestProjectFromEnv(), instanceName, diskName)\n+\n+\tresource.Test(t, resource.TestCase{\n+\t\tPreCheck:     func() { testAccPreCheck(t) },\n+\t\tProviders:    testAccProviders,\n+\t\tCheckDestroy: nil,\n+\t\tSteps: []resource.TestStep{\n+\t\t\tresource.TestStep{\n+\t\t\t\tConfig: testAttachedDiskResource(diskName, instanceName) + testAttachedDiskResourceAttachment(),\n+\t\t\t},\n+\t\t\tresource.TestStep{\n+\t\t\t\tResourceName:      \"google_compute_attached_disk.test\",\n+\t\t\t\tImportStateId:     importID,\n+\t\t\t\tImportState:       true,\n+\t\t\t\tImportStateVerify: true,\n+\t\t\t},\n+\t\t\tresource.TestStep{\n+\t\t\t\tConfig: testAttachedDiskResource(diskName, instanceName),\n+\t\t\t\tCheck: resource.ComposeTestCheckFunc(\n+\t\t\t\t\ttestAccAttachedDiskIsNowDetached(instanceName, diskName),\n+\t\t\t\t),\n+\t\t\t},\n+\t\t},\n+\t})\n+}\n+\n+func TestAccAttachedDisk_defaults(t *testing.T) {\n+\tt.Parallel()\n+\n+\tdiskName := acctest.RandomWithPrefix(\"tf-test\")\n+\tinstanceName := acctest.RandomWithPrefix(\"tf-test\")\n+\timportID := fmt.Sprintf(\"%s/us-central1-a/%s:%s\", getTestProjectFromEnv(), instanceName, diskName)\n+\n+\tresource.Test(t, resource.TestCase{\n+\t\tPreCheck:     func() { testAccPreCheck(t) },\n+\t\tProviders:    testAccProviders,\n+\t\tCheckDestroy: nil,\n+\t\tSteps: []resource.TestStep{\n+\t\t\tresource.TestStep{\n+\t\t\t\tConfig: testAttachedDiskResource(diskName, instanceName) + testAttachedDiskResourceAttachmentDefaults(),\n+\t\t\t},\n+\t\t\tresource.TestStep{\n+\t\t\t\tResourceName:      \"google_compute_attached_disk.test\",\n+\t\t\t\tImportStateId:     importID,\n+\t\t\t\tImportState:       true,\n+\t\t\t\tImportStateVerify: true,\n+\t\t\t},\n+\t\t},\n+\t})\n+\n+}\n+\n+func TestAccAttachedDisk_count(t *testing.T) {\n+\tt.Parallel()\n+\n+\tdiskPrefix := acctest.RandomWithPrefix(\"tf-test\")\n+\tinstanceName := acctest.RandomWithPrefix(\"tf-test\")\n+\tcount := 2\n+\n+\tresource.Test(t, resource.TestCase{\n+\t\tPreCheck:     func() { testAccPreCheck(t) },\n+\t\tProviders:    testAccProviders,\n+\t\tCheckDestroy: nil,\n+\t\tSteps: []resource.TestStep{\n+\t\t\tresource.TestStep{\n+\t\t\t\tConfig: testAttachedDiskResourceCount(diskPrefix, instanceName, count),\n+\t\t\t\tCheck: resource.ComposeTestCheckFunc(\n+\t\t\t\t\ttestAccAttachedDiskContainsManyDisks(instanceName, count),\n+\t\t\t\t),\n+\t\t\t},\n+\t\t},\n+\t})\n+\n+}\n+\n+func testAccAttachedDiskIsNowDetached(instanceName, diskName string) resource.TestCheckFunc {","path":"google/resource_compute_attached_disk_test.go","position":92,"original_position":92,"commit_id":"73e2eb5821671db56e7352cf601f1151fd418fcd","original_commit_id":"73e2eb5821671db56e7352cf601f1151fd418fcd","user":{"login":"danawillow","id":1130694,"node_id":"MDQ6VXNlcjExMzA2OTQ=","avatar_url":"https://avatars2.githubusercontent.com/u/1130694?v=4","gravatar_id":"","url":"https://api.github.com/users/danawillow","html_url":"https://github.com/danawillow","followers_url":"https://api.github.com/users/danawillow/followers","following_url":"https://api.github.com/users/danawillow/following{/other_user}","gists_url":"https://api.github.com/users/danawillow/gists{/gist_id}","starred_url":"https://api.github.com/users/danawillow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danawillow/subscriptions","organizations_url":"https://api.github.com/users/danawillow/orgs","repos_url":"https://api.github.com/users/danawillow/repos","events_url":"https://api.github.com/users/danawillow/events{/privacy}","received_events_url":"https://api.github.com/users/danawillow/received_events","type":"User","site_admin":false},"body":"For all of the checking functions, let's call them `testCheckAttachedDisk[whatever]`","created_at":"2018-09-05T22:01:50Z","updated_at":"2018-09-05T22:26:42Z","html_url":"https://github.com/terraform-providers/terraform-provider-google/pull/1957#discussion_r215439527","pull_request_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/pulls/1957","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-google/pulls/comments/215439527"},"html":{"href":"https://github.com/terraform-providers/terraform-provider-google/pull/1957#discussion_r215439527"},"pull_request":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-google/pulls/1957"}}},"pull_request":{"url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/pulls/1957","id":211570187,"node_id":"MDExOlB1bGxSZXF1ZXN0MjExNTcwMTg3","html_url":"https://github.com/terraform-providers/terraform-provider-google/pull/1957","diff_url":"https://github.com/terraform-providers/terraform-provider-google/pull/1957.diff","patch_url":"https://github.com/terraform-providers/terraform-provider-google/pull/1957.patch","issue_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/issues/1957","number":1957,"state":"open","locked":false,"title":"Attached disk resource","user":{"login":"chrisst","id":1569002,"node_id":"MDQ6VXNlcjE1NjkwMDI=","avatar_url":"https://avatars2.githubusercontent.com/u/1569002?v=4","gravatar_id":"","url":"https://api.github.com/users/chrisst","html_url":"https://github.com/chrisst","followers_url":"https://api.github.com/users/chrisst/followers","following_url":"https://api.github.com/users/chrisst/following{/other_user}","gists_url":"https://api.github.com/users/chrisst/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisst/subscriptions","organizations_url":"https://api.github.com/users/chrisst/orgs","repos_url":"https://api.github.com/users/chrisst/repos","events_url":"https://api.github.com/users/chrisst/events{/privacy}","received_events_url":"https://api.github.com/users/chrisst/received_events","type":"User","site_admin":false},"body":"This is a new resource for attaching disks to instances as requested in https://github.com/terraform-providers/terraform-provider-google/issues/1585","created_at":"2018-08-28T21:56:52Z","updated_at":"2018-09-05T22:26:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"81008265b0e627ccae9b3f0b6cb6f9964e4da959","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":737832355,"node_id":"MDU6TGFiZWw3Mzc4MzIzNTU=","url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/labels/size/XL","name":"size/XL","color":"ffffff","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/pulls/1957/commits","review_comments_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/pulls/1957/comments","review_comment_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/pulls/comments{/number}","comments_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/issues/1957/comments","statuses_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/statuses/73e2eb5821671db56e7352cf601f1151fd418fcd","head":{"label":"chrisst:1585-attached-disk","ref":"1585-attached-disk","sha":"73e2eb5821671db56e7352cf601f1151fd418fcd","user":{"login":"chrisst","id":1569002,"node_id":"MDQ6VXNlcjE1NjkwMDI=","avatar_url":"https://avatars2.githubusercontent.com/u/1569002?v=4","gravatar_id":"","url":"https://api.github.com/users/chrisst","html_url":"https://github.com/chrisst","followers_url":"https://api.github.com/users/chrisst/followers","following_url":"https://api.github.com/users/chrisst/following{/other_user}","gists_url":"https://api.github.com/users/chrisst/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisst/subscriptions","organizations_url":"https://api.github.com/users/chrisst/orgs","repos_url":"https://api.github.com/users/chrisst/repos","events_url":"https://api.github.com/users/chrisst/events{/privacy}","received_events_url":"https://api.github.com/users/chrisst/received_events","type":"User","site_admin":false},"repo":{"id":143218653,"node_id":"MDEwOlJlcG9zaXRvcnkxNDMyMTg2NTM=","name":"terraform-provider-google","full_name":"chrisst/terraform-provider-google","owner":{"login":"chrisst","id":1569002,"node_id":"MDQ6VXNlcjE1NjkwMDI=","avatar_url":"https://avatars2.githubusercontent.com/u/1569002?v=4","gravatar_id":"","url":"https://api.github.com/users/chrisst","html_url":"https://github.com/chrisst","followers_url":"https://api.github.com/users/chrisst/followers","following_url":"https://api.github.com/users/chrisst/following{/other_user}","gists_url":"https://api.github.com/users/chrisst/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisst/subscriptions","organizations_url":"https://api.github.com/users/chrisst/orgs","repos_url":"https://api.github.com/users/chrisst/repos","events_url":"https://api.github.com/users/chrisst/events{/privacy}","received_events_url":"https://api.github.com/users/chrisst/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chrisst/terraform-provider-google","description":"Terraform Google Cloud provider","fork":true,"url":"https://api.github.com/repos/chrisst/terraform-provider-google","forks_url":"https://api.github.com/repos/chrisst/terraform-provider-google/forks","keys_url":"https://api.github.com/repos/chrisst/terraform-provider-google/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chrisst/terraform-provider-google/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chrisst/terraform-provider-google/teams","hooks_url":"https://api.github.com/repos/chrisst/terraform-provider-google/hooks","issue_events_url":"https://api.github.com/repos/chrisst/terraform-provider-google/issues/events{/number}","events_url":"https://api.github.com/repos/chrisst/terraform-provider-google/events","assignees_url":"https://api.github.com/repos/chrisst/terraform-provider-google/assignees{/user}","branches_url":"https://api.github.com/repos/chrisst/terraform-provider-google/branches{/branch}","tags_url":"https://api.github.com/repos/chrisst/terraform-provider-google/tags","blobs_url":"https://api.github.com/repos/chrisst/terraform-provider-google/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chrisst/terraform-provider-google/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chrisst/terraform-provider-google/git/refs{/sha}","trees_url":"https://api.github.com/repos/chrisst/terraform-provider-google/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chrisst/terraform-provider-google/statuses/{sha}","languages_url":"https://api.github.com/repos/chrisst/terraform-provider-google/languages","stargazers_url":"https://api.github.com/repos/chrisst/terraform-provider-google/stargazers","contributors_url":"https://api.github.com/repos/chrisst/terraform-provider-google/contributors","subscribers_url":"https://api.github.com/repos/chrisst/terraform-provider-google/subscribers","subscription_url":"https://api.github.com/repos/chrisst/terraform-provider-google/subscription","commits_url":"https://api.github.com/repos/chrisst/terraform-provider-google/commits{/sha}","git_commits_url":"https://api.github.com/repos/chrisst/terraform-provider-google/git/commits{/sha}","comments_url":"https://api.github.com/repos/chrisst/terraform-provider-google/comments{/number}","issue_comment_url":"https://api.github.com/repos/chrisst/terraform-provider-google/issues/comments{/number}","contents_url":"https://api.github.com/repos/chrisst/terraform-provider-google/contents/{+path}","compare_url":"https://api.github.com/repos/chrisst/terraform-provider-google/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chrisst/terraform-provider-google/merges","archive_url":"https://api.github.com/repos/chrisst/terraform-provider-google/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chrisst/terraform-provider-google/downloads","issues_url":"https://api.github.com/repos/chrisst/terraform-provider-google/issues{/number}","pulls_url":"https://api.github.com/repos/chrisst/terraform-provider-google/pulls{/number}","milestones_url":"https://api.github.com/repos/chrisst/terraform-provider-google/milestones{/number}","notifications_url":"https://api.github.com/repos/chrisst/terraform-provider-google/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chrisst/terraform-provider-google/labels{/name}","releases_url":"https://api.github.com/repos/chrisst/terraform-provider-google/releases{/id}","deployments_url":"https://api.github.com/repos/chrisst/terraform-provider-google/deployments","created_at":"2018-08-01T23:34:39Z","updated_at":"2018-09-05T21:19:15Z","pushed_at":"2018-09-05T22:19:14Z","git_url":"git://github.com/chrisst/terraform-provider-google.git","ssh_url":"git@github.com:chrisst/terraform-provider-google.git","clone_url":"https://github.com/chrisst/terraform-provider-google.git","svn_url":"https://github.com/chrisst/terraform-provider-google","homepage":"https://www.terraform.io/docs/providers/google/","size":13170,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"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","node_id":"MDc6TGljZW5zZTE0"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"terraform-providers:master","ref":"master","sha":"92587817537d19f430ffad3ce61ac5cdf0e2ba53","user":{"login":"terraform-providers","id":29154831,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5MTU0ODMx","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":93446075,"node_id":"MDEwOlJlcG9zaXRvcnk5MzQ0NjA3NQ==","name":"terraform-provider-google","full_name":"terraform-providers/terraform-provider-google","owner":{"login":"terraform-providers","id":29154831,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5MTU0ODMx","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-google","description":"Terraform Google Cloud provider","fork":false,"url":"https://api.github.com/repos/terraform-providers/terraform-provider-google","forks_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/forks","keys_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/keys{/key_id}","collaborators_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/teams","hooks_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/hooks","issue_events_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/issues/events{/number}","events_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/events","assignees_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/assignees{/user}","branches_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/branches{/branch}","tags_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/tags","blobs_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/git/refs{/sha}","trees_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/git/trees{/sha}","statuses_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/statuses/{sha}","languages_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/languages","stargazers_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/stargazers","contributors_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/contributors","subscribers_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/subscribers","subscription_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/subscription","commits_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/commits{/sha}","git_commits_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/git/commits{/sha}","comments_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/comments{/number}","issue_comment_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/issues/comments{/number}","contents_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/contents/{+path}","compare_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/compare/{base}...{head}","merges_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/merges","archive_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/downloads","issues_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/issues{/number}","pulls_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/pulls{/number}","milestones_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/milestones{/number}","notifications_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/labels{/name}","releases_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/releases{/id}","deployments_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/deployments","created_at":"2017-06-05T20:54:02Z","updated_at":"2018-09-05T22:19:18Z","pushed_at":"2018-09-05T22:24:44Z","git_url":"git://github.com/terraform-providers/terraform-provider-google.git","ssh_url":"git@github.com:terraform-providers/terraform-provider-google.git","clone_url":"https://github.com/terraform-providers/terraform-provider-google.git","svn_url":"https://github.com/terraform-providers/terraform-provider-google","homepage":"https://www.terraform.io/docs/providers/google/","size":13155,"stargazers_count":371,"watchers_count":371,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":308,"mirror_url":null,"archived":false,"open_issues_count":213,"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","node_id":"MDc6TGljZW5zZTE0"},"forks":308,"open_issues":213,"watchers":371,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-google/pulls/1957"},"html":{"href":"https://github.com/terraform-providers/terraform-provider-google/pull/1957"},"issue":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-google/issues/1957"},"comments":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-google/issues/1957/comments"},"review_comments":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-google/pulls/1957/comments"},"review_comment":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-google/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-google/pulls/1957/commits"},"statuses":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-google/statuses/73e2eb5821671db56e7352cf601f1151fd418fcd"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"danawillow"}}