{"action":"created","comment":{"url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/pulls/comments/131154581","pull_request_review_id":54106981,"id":131154581,"diff_hunk":"@@ -0,0 +1,121 @@\n+package azurerm\n+\n+import (\n+\t\"fmt\"\n+\t\"net/http\"\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 TestAccAzureRMPostgreSQLDatabase_basic(t *testing.T) {\n+\tresourceName := \"azurerm_postgresql_database.test\"\n+\tri := acctest.RandInt()\n+\tconfig := testAccAzureRMPostgreSQLDatabase_basic(ri)\n+\n+\tresource.Test(t, resource.TestCase{\n+\t\tPreCheck:     func() { testAccPreCheck(t) },\n+\t\tProviders:    testAccProviders,\n+\t\tCheckDestroy: testCheckAzureRMPostgreSQLDatabaseDestroy,\n+\t\tSteps: []resource.TestStep{\n+\t\t\t{\n+\t\t\t\tConfig: config,\n+\t\t\t\tCheck: resource.ComposeTestCheckFunc(\n+\t\t\t\t\ttestCheckAzureRMPostgreSQLDatabaseExists(resourceName),\n+\t\t\t\t),\n+\t\t\t},\n+\t\t},\n+\t})\n+}\n+\n+func testCheckAzureRMPostgreSQLDatabaseExists(name string) resource.TestCheckFunc {\n+\treturn func(s *terraform.State) error {\n+\t\t// Ensure we have enough information in state to look up in API\n+\t\trs, ok := s.RootModule().Resources[name]\n+\t\tif !ok {\n+\t\t\treturn fmt.Errorf(\"Not found: %s\", name)\n+\t\t}\n+\n+\t\tname := rs.Primary.Attributes[\"name\"]\n+\t\tserverName := rs.Primary.Attributes[\"server_name\"]\n+\t\tresourceGroup, hasResourceGroup := rs.Primary.Attributes[\"resource_group_name\"]\n+\t\tif !hasResourceGroup {\n+\t\t\treturn fmt.Errorf(\"Bad: no resource group found in state for PostgreSQL Database: %s\", name)\n+\t\t}\n+\n+\t\tclient := testAccProvider.Meta().(*ArmClient).postgresqlDatabasesClient\n+\n+\t\tresp, err := client.Get(resourceGroup, serverName, name)\n+\t\tif err != nil {\n+\t\t\treturn fmt.Errorf(\"Bad: Get on postgresqlDatabasesClient: %s\", err)","path":"azurerm/resource_arm_postgresql_database_test.go","position":52,"original_position":52,"commit_id":"8bd2cc5e096fe9deb0c80314f97839d2da036082","original_commit_id":"8bd2cc5e096fe9deb0c80314f97839d2da036082","user":{"login":"tombuildsstuff","id":666005,"avatar_url":"https://avatars1.githubusercontent.com/u/666005?v=4","gravatar_id":"","url":"https://api.github.com/users/tombuildsstuff","html_url":"https://github.com/tombuildsstuff","followers_url":"https://api.github.com/users/tombuildsstuff/followers","following_url":"https://api.github.com/users/tombuildsstuff/following{/other_user}","gists_url":"https://api.github.com/users/tombuildsstuff/gists{/gist_id}","starred_url":"https://api.github.com/users/tombuildsstuff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tombuildsstuff/subscriptions","organizations_url":"https://api.github.com/users/tombuildsstuff/orgs","repos_url":"https://api.github.com/users/tombuildsstuff/repos","events_url":"https://api.github.com/users/tombuildsstuff/events{/privacy}","received_events_url":"https://api.github.com/users/tombuildsstuff/received_events","type":"User","site_admin":false},"body":"this can be updated to `%+v`","created_at":"2017-08-03T14:18:30Z","updated_at":"2017-08-03T14:38:47Z","html_url":"https://github.com/terraform-providers/terraform-provider-azurerm/pull/210#discussion_r131154581","pull_request_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/pulls/210","_links":{"self":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/pulls/comments/131154581"},"html":{"href":"https://github.com/terraform-providers/terraform-provider-azurerm/pull/210#discussion_r131154581"},"pull_request":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/pulls/210"}}},"pull_request":{"url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/pulls/210","id":133955119,"html_url":"https://github.com/terraform-providers/terraform-provider-azurerm/pull/210","diff_url":"https://github.com/terraform-providers/terraform-provider-azurerm/pull/210.diff","patch_url":"https://github.com/terraform-providers/terraform-provider-azurerm/pull/210.patch","issue_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/issues/210","number":210,"state":"open","locked":false,"title":"[WIP] PostgreSQL Resources","user":{"login":"tombuildsstuff","id":666005,"avatar_url":"https://avatars1.githubusercontent.com/u/666005?v=4","gravatar_id":"","url":"https://api.github.com/users/tombuildsstuff","html_url":"https://github.com/tombuildsstuff","followers_url":"https://api.github.com/users/tombuildsstuff/followers","following_url":"https://api.github.com/users/tombuildsstuff/following{/other_user}","gists_url":"https://api.github.com/users/tombuildsstuff/gists{/gist_id}","starred_url":"https://api.github.com/users/tombuildsstuff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tombuildsstuff/subscriptions","organizations_url":"https://api.github.com/users/tombuildsstuff/orgs","repos_url":"https://api.github.com/users/tombuildsstuff/repos","events_url":"https://api.github.com/users/tombuildsstuff/events{/privacy}","received_events_url":"https://api.github.com/users/tombuildsstuff/received_events","type":"User","site_admin":false},"body":"Adds the following resources:\r\n\r\n- `azurerm_postgresql_configuration`\r\n- `azurerm_postgresql_database`\r\n- `azurerm_postgresql_firewall_rule`\r\n- `azurerm_postgresql_server`\r\n\r\nThis still needs some refactoring - I'm more opening this PR to keep track of items than anything else. In addition, each of these resources builds on one another - so unfortunately due to the way I started writing this it's ended up as one big PR - but I can split it out if needed.\r\n\r\nFixes #158 ","created_at":"2017-08-03T14:14:21Z","updated_at":"2017-08-03T14:38:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1e4f619501060ff7e3a2a112558a4a00458eaa60","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/pulls/210/commits","review_comments_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/pulls/210/comments","review_comment_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/issues/210/comments","statuses_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/statuses/8bd2cc5e096fe9deb0c80314f97839d2da036082","head":{"label":"terraform-providers:postgresql","ref":"postgresql","sha":"8bd2cc5e096fe9deb0c80314f97839d2da036082","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":93446042,"name":"terraform-provider-azurerm","full_name":"terraform-providers/terraform-provider-azurerm","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-azurerm","description":"Terraform azurerm provider","fork":false,"url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm","forks_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/forks","keys_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/teams","hooks_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/hooks","issue_events_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/issues/events{/number}","events_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/events","assignees_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/assignees{/user}","branches_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/branches{/branch}","tags_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/tags","blobs_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/git/refs{/sha}","trees_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/statuses/{sha}","languages_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/languages","stargazers_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/stargazers","contributors_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/contributors","subscribers_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/subscribers","subscription_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/subscription","commits_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/commits{/sha}","git_commits_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/git/commits{/sha}","comments_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/comments{/number}","issue_comment_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/issues/comments{/number}","contents_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/contents/{+path}","compare_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/merges","archive_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/downloads","issues_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/issues{/number}","pulls_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/pulls{/number}","milestones_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/milestones{/number}","notifications_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/labels{/name}","releases_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/releases{/id}","deployments_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/deployments","created_at":"2017-06-05T20:53:54Z","updated_at":"2017-08-03T11:14:23Z","pushed_at":"2017-08-03T14:14:21Z","git_url":"git://github.com/terraform-providers/terraform-provider-azurerm.git","ssh_url":"git@github.com:terraform-providers/terraform-provider-azurerm.git","clone_url":"https://github.com/terraform-providers/terraform-provider-azurerm.git","svn_url":"https://github.com/terraform-providers/terraform-provider-azurerm","homepage":"","size":5918,"stargazers_count":35,"watchers_count":35,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":27,"mirror_url":null,"open_issues_count":117,"forks":27,"open_issues":117,"watchers":35,"default_branch":"master"}},"base":{"label":"terraform-providers:master","ref":"master","sha":"2976af29c0a1d5f59cce7166272e5a0da26529b2","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":93446042,"name":"terraform-provider-azurerm","full_name":"terraform-providers/terraform-provider-azurerm","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-azurerm","description":"Terraform azurerm provider","fork":false,"url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm","forks_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/forks","keys_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/teams","hooks_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/hooks","issue_events_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/issues/events{/number}","events_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/events","assignees_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/assignees{/user}","branches_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/branches{/branch}","tags_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/tags","blobs_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/git/refs{/sha}","trees_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/statuses/{sha}","languages_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/languages","stargazers_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/stargazers","contributors_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/contributors","subscribers_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/subscribers","subscription_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/subscription","commits_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/commits{/sha}","git_commits_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/git/commits{/sha}","comments_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/comments{/number}","issue_comment_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/issues/comments{/number}","contents_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/contents/{+path}","compare_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/merges","archive_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/downloads","issues_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/issues{/number}","pulls_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/pulls{/number}","milestones_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/milestones{/number}","notifications_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/labels{/name}","releases_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/releases{/id}","deployments_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/deployments","created_at":"2017-06-05T20:53:54Z","updated_at":"2017-08-03T11:14:23Z","pushed_at":"2017-08-03T14:14:21Z","git_url":"git://github.com/terraform-providers/terraform-provider-azurerm.git","ssh_url":"git@github.com:terraform-providers/terraform-provider-azurerm.git","clone_url":"https://github.com/terraform-providers/terraform-provider-azurerm.git","svn_url":"https://github.com/terraform-providers/terraform-provider-azurerm","homepage":"","size":5918,"stargazers_count":35,"watchers_count":35,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":27,"mirror_url":null,"open_issues_count":117,"forks":27,"open_issues":117,"watchers":35,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/pulls/210"},"html":{"href":"https://github.com/terraform-providers/terraform-provider-azurerm/pull/210"},"issue":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/issues/210"},"comments":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/issues/210/comments"},"review_comments":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/pulls/210/comments"},"review_comment":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/pulls/210/commits"},"statuses":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/statuses/8bd2cc5e096fe9deb0c80314f97839d2da036082"}}}}
{"actor":{"display_login":"tombuildsstuff"}}