{"action":"created","comment":{"url":"https://api.github.com/repos/gpii-ops/gpii-infra/pulls/comments/205741698","pull_request_review_id":141073307,"id":205741698,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNTc0MTY5OA==","diff_hunk":"@@ -0,0 +1,89 @@\n+# this Terraform module creates the same resources as project_init script and\n+# set the DNS zones structure.\n+\n+terraform {\n+  backend \"gcs\" {}\n+}\n+\n+variable \"project_name\" {}\n+variable \"project_owner\" {}\n+variable \"billing_id\" {}\n+variable \"organization_id\" {}\n+\n+# compute the project_id to get the dns zone in JSON format\n+# I wasn't able to replicate this function using HCL code\n+data \"external\" \"calculate_dns_zone\" {\n+  program = [\"python\", \"-c\", \"print(\\\"{\\\\\\\"zone\\\\\\\": \\\\\\\"\\\" + \\\".\\\".join(\\\"${google_project.project.project_id}\\\".split(\\\"-\\\")[::-1]) + \\\".net.\\\") + \\\"\\\\\\\"}\\\"\"]\n+}\n+ \n+resource \"google_project\" \"project\" {\n+  name            = \"gpii-gcp-${var.project_name}\"\n+  project_id      = \"gpii-gcp-${var.project_name}\"\n+  billing_account = \"${var.billing_id}\"\n+  org_id          = \"${var.organization_id}\"\n+}\n+\n+resource \"google_project_services\" \"project\" {\n+  project = \"${google_project.project.project_id}\"\n+  services = [\n+    \"compute.googleapis.com\",\n+    \"logging.googleapis.com\",\n+    \"monitoring.googleapis.com\",\n+    \"dns.googleapis.com\"\n+  ]\n+}\n+\n+resource \"google_service_account\" \"project\" {\n+  account_id   = \"projectowner\"\n+  display_name = \"Project owner service account\"\n+  project      = \"${google_project.project.project_id}\"\n+}\n+\n+resource \"google_project_iam_binding\" \"project\" {\n+  project = \"${google_project.project.project_id}\"\n+  role    = \"roles/owner\"\n+  members = [\n+    \"user:${var.project_owner}\",\n+    \"serviceAccount:${google_service_account.project.email}\",\n+  ]\n+}\n+ \n+resource \"google_dns_managed_zone\" \"project\" {","path":"common/modules/gcp-project/main.tf","position":51,"original_position":51,"commit_id":"4b25c2181ef7594277dcede98952bc09bac2fc1e","original_commit_id":"4b25c2181ef7594277dcede98952bc09bac2fc1e","user":{"login":"amatas","id":158641,"node_id":"MDQ6VXNlcjE1ODY0MQ==","avatar_url":"https://avatars3.githubusercontent.com/u/158641?v=4","gravatar_id":"","url":"https://api.github.com/users/amatas","html_url":"https://github.com/amatas","followers_url":"https://api.github.com/users/amatas/followers","following_url":"https://api.github.com/users/amatas/following{/other_user}","gists_url":"https://api.github.com/users/amatas/gists{/gist_id}","starred_url":"https://api.github.com/users/amatas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amatas/subscriptions","organizations_url":"https://api.github.com/users/amatas/orgs","repos_url":"https://api.github.com/users/amatas/repos","events_url":"https://api.github.com/users/amatas/events{/privacy}","received_events_url":"https://api.github.com/users/amatas/received_events","type":"User","site_admin":false},"body":"My first attempt would be to import the resource before running the `up` command in order to be \"ignored\" in the apply step. This could be the less disruptive change in the infrastructure. \r\n\r\nOther approaches could be either removing the resource from the gke-network module, or change the zone creation at this PR.\r\n\r\nBut I can't either test or evaluate the impact all of the above before deploying the project first.","created_at":"2018-07-27T11:13:54Z","updated_at":"2018-07-27T11:13:54Z","html_url":"https://github.com/gpii-ops/gpii-infra/pull/60#discussion_r205741698","pull_request_url":"https://api.github.com/repos/gpii-ops/gpii-infra/pulls/60","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/gpii-ops/gpii-infra/pulls/comments/205741698"},"html":{"href":"https://github.com/gpii-ops/gpii-infra/pull/60#discussion_r205741698"},"pull_request":{"href":"https://api.github.com/repos/gpii-ops/gpii-infra/pulls/60"}},"in_reply_to_id":205671169},"pull_request":{"url":"https://api.github.com/repos/gpii-ops/gpii-infra/pulls/60","id":202350685,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAyMzUwNjg1","html_url":"https://github.com/gpii-ops/gpii-infra/pull/60","diff_url":"https://github.com/gpii-ops/gpii-infra/pull/60.diff","patch_url":"https://github.com/gpii-ops/gpii-infra/pull/60.patch","issue_url":"https://api.github.com/repos/gpii-ops/gpii-infra/issues/60","number":60,"state":"open","locked":false,"title":"GPII-3125 Init GCP organization","user":{"login":"amatas","id":158641,"node_id":"MDQ6VXNlcjE1ODY0MQ==","avatar_url":"https://avatars3.githubusercontent.com/u/158641?v=4","gravatar_id":"","url":"https://api.github.com/users/amatas","html_url":"https://github.com/amatas","followers_url":"https://api.github.com/users/amatas/followers","following_url":"https://api.github.com/users/amatas/following{/other_user}","gists_url":"https://api.github.com/users/amatas/gists{/gist_id}","starred_url":"https://api.github.com/users/amatas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amatas/subscriptions","organizations_url":"https://api.github.com/users/amatas/orgs","repos_url":"https://api.github.com/users/amatas/repos","events_url":"https://api.github.com/users/amatas/events{/privacy}","received_events_url":"https://api.github.com/users/amatas/received_events","type":"User","site_admin":false},"body":"This code covers [GPII-3125](https://issues.gpii.net/browse/GPII-3125), [GPII-3127](https://issues.gpii.net/browse/GPII-3127), [GPII-3126](https://issues.gpii.net/browse/GPII-3126) and [GPII-3128](https://issues.gpii.net/browse/GPII-3128).\r\n\r\nMore info about how to apply this code is in the [README.md](https://github.com/amatas/gpii-infra/blob/6f1b136748acbe9ac34c11c669654cf7704f68ca/gcp/README.md#project-structure)","created_at":"2018-07-18T19:07:08Z","updated_at":"2018-07-27T11:13:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8cd309dc16ad028b1e24bb56377b496196452f3b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/gpii-ops/gpii-infra/pulls/60/commits","review_comments_url":"https://api.github.com/repos/gpii-ops/gpii-infra/pulls/60/comments","review_comment_url":"https://api.github.com/repos/gpii-ops/gpii-infra/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gpii-ops/gpii-infra/issues/60/comments","statuses_url":"https://api.github.com/repos/gpii-ops/gpii-infra/statuses/4b25c2181ef7594277dcede98952bc09bac2fc1e","head":{"label":"amatas:GPII-3125","ref":"GPII-3125","sha":"4b25c2181ef7594277dcede98952bc09bac2fc1e","user":{"login":"amatas","id":158641,"node_id":"MDQ6VXNlcjE1ODY0MQ==","avatar_url":"https://avatars3.githubusercontent.com/u/158641?v=4","gravatar_id":"","url":"https://api.github.com/users/amatas","html_url":"https://github.com/amatas","followers_url":"https://api.github.com/users/amatas/followers","following_url":"https://api.github.com/users/amatas/following{/other_user}","gists_url":"https://api.github.com/users/amatas/gists{/gist_id}","starred_url":"https://api.github.com/users/amatas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amatas/subscriptions","organizations_url":"https://api.github.com/users/amatas/orgs","repos_url":"https://api.github.com/users/amatas/repos","events_url":"https://api.github.com/users/amatas/events{/privacy}","received_events_url":"https://api.github.com/users/amatas/received_events","type":"User","site_admin":false},"repo":{"id":103160364,"node_id":"MDEwOlJlcG9zaXRvcnkxMDMxNjAzNjQ=","name":"gpii-infra","full_name":"amatas/gpii-infra","owner":{"login":"amatas","id":158641,"node_id":"MDQ6VXNlcjE1ODY0MQ==","avatar_url":"https://avatars3.githubusercontent.com/u/158641?v=4","gravatar_id":"","url":"https://api.github.com/users/amatas","html_url":"https://github.com/amatas","followers_url":"https://api.github.com/users/amatas/followers","following_url":"https://api.github.com/users/amatas/following{/other_user}","gists_url":"https://api.github.com/users/amatas/gists{/gist_id}","starred_url":"https://api.github.com/users/amatas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amatas/subscriptions","organizations_url":"https://api.github.com/users/amatas/orgs","repos_url":"https://api.github.com/users/amatas/repos","events_url":"https://api.github.com/users/amatas/events{/privacy}","received_events_url":"https://api.github.com/users/amatas/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/amatas/gpii-infra","description":null,"fork":true,"url":"https://api.github.com/repos/amatas/gpii-infra","forks_url":"https://api.github.com/repos/amatas/gpii-infra/forks","keys_url":"https://api.github.com/repos/amatas/gpii-infra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amatas/gpii-infra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amatas/gpii-infra/teams","hooks_url":"https://api.github.com/repos/amatas/gpii-infra/hooks","issue_events_url":"https://api.github.com/repos/amatas/gpii-infra/issues/events{/number}","events_url":"https://api.github.com/repos/amatas/gpii-infra/events","assignees_url":"https://api.github.com/repos/amatas/gpii-infra/assignees{/user}","branches_url":"https://api.github.com/repos/amatas/gpii-infra/branches{/branch}","tags_url":"https://api.github.com/repos/amatas/gpii-infra/tags","blobs_url":"https://api.github.com/repos/amatas/gpii-infra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amatas/gpii-infra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amatas/gpii-infra/git/refs{/sha}","trees_url":"https://api.github.com/repos/amatas/gpii-infra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amatas/gpii-infra/statuses/{sha}","languages_url":"https://api.github.com/repos/amatas/gpii-infra/languages","stargazers_url":"https://api.github.com/repos/amatas/gpii-infra/stargazers","contributors_url":"https://api.github.com/repos/amatas/gpii-infra/contributors","subscribers_url":"https://api.github.com/repos/amatas/gpii-infra/subscribers","subscription_url":"https://api.github.com/repos/amatas/gpii-infra/subscription","commits_url":"https://api.github.com/repos/amatas/gpii-infra/commits{/sha}","git_commits_url":"https://api.github.com/repos/amatas/gpii-infra/git/commits{/sha}","comments_url":"https://api.github.com/repos/amatas/gpii-infra/comments{/number}","issue_comment_url":"https://api.github.com/repos/amatas/gpii-infra/issues/comments{/number}","contents_url":"https://api.github.com/repos/amatas/gpii-infra/contents/{+path}","compare_url":"https://api.github.com/repos/amatas/gpii-infra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amatas/gpii-infra/merges","archive_url":"https://api.github.com/repos/amatas/gpii-infra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amatas/gpii-infra/downloads","issues_url":"https://api.github.com/repos/amatas/gpii-infra/issues{/number}","pulls_url":"https://api.github.com/repos/amatas/gpii-infra/pulls{/number}","milestones_url":"https://api.github.com/repos/amatas/gpii-infra/milestones{/number}","notifications_url":"https://api.github.com/repos/amatas/gpii-infra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amatas/gpii-infra/labels{/name}","releases_url":"https://api.github.com/repos/amatas/gpii-infra/releases{/id}","deployments_url":"https://api.github.com/repos/amatas/gpii-infra/deployments","created_at":"2017-09-11T16:29:43Z","updated_at":"2018-06-20T11:51:59Z","pushed_at":"2018-07-26T18:02:50Z","git_url":"git://github.com/amatas/gpii-infra.git","ssh_url":"git@github.com:amatas/gpii-infra.git","clone_url":"https://github.com/amatas/gpii-infra.git","svn_url":"https://github.com/amatas/gpii-infra","homepage":null,"size":814,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"gpii-ops:master","ref":"master","sha":"50296927fb556c6edf50e2e2e95c56c476abcd44","user":{"login":"gpii-ops","id":10503302,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNTAzMzAy","avatar_url":"https://avatars1.githubusercontent.com/u/10503302?v=4","gravatar_id":"","url":"https://api.github.com/users/gpii-ops","html_url":"https://github.com/gpii-ops","followers_url":"https://api.github.com/users/gpii-ops/followers","following_url":"https://api.github.com/users/gpii-ops/following{/other_user}","gists_url":"https://api.github.com/users/gpii-ops/gists{/gist_id}","starred_url":"https://api.github.com/users/gpii-ops/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gpii-ops/subscriptions","organizations_url":"https://api.github.com/users/gpii-ops/orgs","repos_url":"https://api.github.com/users/gpii-ops/repos","events_url":"https://api.github.com/users/gpii-ops/events{/privacy}","received_events_url":"https://api.github.com/users/gpii-ops/received_events","type":"Organization","site_admin":false},"repo":{"id":97767979,"node_id":"MDEwOlJlcG9zaXRvcnk5Nzc2Nzk3OQ==","name":"gpii-infra","full_name":"gpii-ops/gpii-infra","owner":{"login":"gpii-ops","id":10503302,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNTAzMzAy","avatar_url":"https://avatars1.githubusercontent.com/u/10503302?v=4","gravatar_id":"","url":"https://api.github.com/users/gpii-ops","html_url":"https://github.com/gpii-ops","followers_url":"https://api.github.com/users/gpii-ops/followers","following_url":"https://api.github.com/users/gpii-ops/following{/other_user}","gists_url":"https://api.github.com/users/gpii-ops/gists{/gist_id}","starred_url":"https://api.github.com/users/gpii-ops/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gpii-ops/subscriptions","organizations_url":"https://api.github.com/users/gpii-ops/orgs","repos_url":"https://api.github.com/users/gpii-ops/repos","events_url":"https://api.github.com/users/gpii-ops/events{/privacy}","received_events_url":"https://api.github.com/users/gpii-ops/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gpii-ops/gpii-infra","description":null,"fork":true,"url":"https://api.github.com/repos/gpii-ops/gpii-infra","forks_url":"https://api.github.com/repos/gpii-ops/gpii-infra/forks","keys_url":"https://api.github.com/repos/gpii-ops/gpii-infra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gpii-ops/gpii-infra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gpii-ops/gpii-infra/teams","hooks_url":"https://api.github.com/repos/gpii-ops/gpii-infra/hooks","issue_events_url":"https://api.github.com/repos/gpii-ops/gpii-infra/issues/events{/number}","events_url":"https://api.github.com/repos/gpii-ops/gpii-infra/events","assignees_url":"https://api.github.com/repos/gpii-ops/gpii-infra/assignees{/user}","branches_url":"https://api.github.com/repos/gpii-ops/gpii-infra/branches{/branch}","tags_url":"https://api.github.com/repos/gpii-ops/gpii-infra/tags","blobs_url":"https://api.github.com/repos/gpii-ops/gpii-infra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gpii-ops/gpii-infra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gpii-ops/gpii-infra/git/refs{/sha}","trees_url":"https://api.github.com/repos/gpii-ops/gpii-infra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gpii-ops/gpii-infra/statuses/{sha}","languages_url":"https://api.github.com/repos/gpii-ops/gpii-infra/languages","stargazers_url":"https://api.github.com/repos/gpii-ops/gpii-infra/stargazers","contributors_url":"https://api.github.com/repos/gpii-ops/gpii-infra/contributors","subscribers_url":"https://api.github.com/repos/gpii-ops/gpii-infra/subscribers","subscription_url":"https://api.github.com/repos/gpii-ops/gpii-infra/subscription","commits_url":"https://api.github.com/repos/gpii-ops/gpii-infra/commits{/sha}","git_commits_url":"https://api.github.com/repos/gpii-ops/gpii-infra/git/commits{/sha}","comments_url":"https://api.github.com/repos/gpii-ops/gpii-infra/comments{/number}","issue_comment_url":"https://api.github.com/repos/gpii-ops/gpii-infra/issues/comments{/number}","contents_url":"https://api.github.com/repos/gpii-ops/gpii-infra/contents/{+path}","compare_url":"https://api.github.com/repos/gpii-ops/gpii-infra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gpii-ops/gpii-infra/merges","archive_url":"https://api.github.com/repos/gpii-ops/gpii-infra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gpii-ops/gpii-infra/downloads","issues_url":"https://api.github.com/repos/gpii-ops/gpii-infra/issues{/number}","pulls_url":"https://api.github.com/repos/gpii-ops/gpii-infra/pulls{/number}","milestones_url":"https://api.github.com/repos/gpii-ops/gpii-infra/milestones{/number}","notifications_url":"https://api.github.com/repos/gpii-ops/gpii-infra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gpii-ops/gpii-infra/labels{/name}","releases_url":"https://api.github.com/repos/gpii-ops/gpii-infra/releases{/id}","deployments_url":"https://api.github.com/repos/gpii-ops/gpii-infra/deployments","created_at":"2017-07-19T22:54:03Z","updated_at":"2018-07-27T05:43:05Z","pushed_at":"2018-07-27T07:00:43Z","git_url":"git://github.com/gpii-ops/gpii-infra.git","ssh_url":"git@github.com:gpii-ops/gpii-infra.git","clone_url":"https://github.com/gpii-ops/gpii-infra.git","svn_url":"https://github.com/gpii-ops/gpii-infra","homepage":null,"size":785,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":6,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gpii-ops/gpii-infra/pulls/60"},"html":{"href":"https://github.com/gpii-ops/gpii-infra/pull/60"},"issue":{"href":"https://api.github.com/repos/gpii-ops/gpii-infra/issues/60"},"comments":{"href":"https://api.github.com/repos/gpii-ops/gpii-infra/issues/60/comments"},"review_comments":{"href":"https://api.github.com/repos/gpii-ops/gpii-infra/pulls/60/comments"},"review_comment":{"href":"https://api.github.com/repos/gpii-ops/gpii-infra/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gpii-ops/gpii-infra/pulls/60/commits"},"statuses":{"href":"https://api.github.com/repos/gpii-ops/gpii-infra/statuses/4b25c2181ef7594277dcede98952bc09bac2fc1e"}},"author_association":"NONE"}}
{"actor":{"display_login":"amatas"}}