-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added second module for creating folder and project structure
- Loading branch information
Chris Carty
committed
Apr 6, 2021
1 parent
8147533
commit a624aca
Showing
22 changed files
with
397 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,7 @@ Session.vim | |
# .tfstate files | ||
*.tfstate | ||
*.tfstate.* | ||
variables.tfvar | ||
|
||
# Crash log files | ||
crash.log | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
terraform { | ||
backend "gcs" { | ||
bucket = "bootstrap-landingzone" | ||
bucket = "gcp-gc-accelerator" | ||
prefix = "/orgadmin/seeding/" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
deployment-templates/Terraform/1-common/variables.tfvar.example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
org_audit_logs_project_alert_spent_percents = [50,25,10] | ||
org_audit_logs_project_alert_pubsub_topic = "project-alerts" | ||
admin_group_users="[email protected]" | ||
audit_data_users="[email protected]" | ||
org_id="ORG_ID" | ||
terraform_service_account="[email protected]" | ||
billing_account="BILLING_ACCOUNT" | ||
billing_data_users="[email protected]" | ||
ssc_data_users="[email protected]" | ||
ssc_broker_users="[email protected]" | ||
audit_logs_table_delete_contents_on_destroy=true | ||
log_export_storage_force_destroy=false |
55 changes: 55 additions & 0 deletions
55
deployment-templates/Terraform/2-projects/Host_Project_Dev.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
### DEV Host Project in the Shared VPC setup####### | ||
|
||
|
||
resource "random_id" "default-project-id" { | ||
byte_length = 2 | ||
prefix = "host-dev" | ||
} | ||
|
||
resource "google_project" "host" { | ||
name = var.project_name | ||
project_id = random_id.default-project-id.hex | ||
folder_id = google_folder.ProB_dev.name | ||
billing_account = var.billing_account | ||
auto_create_network = false | ||
} | ||
|
||
resource "google_project_service" "host" { | ||
project = google_project.host.project_id | ||
|
||
service = "compute.googleapis.com" | ||
disable_on_destroy = false | ||
} | ||
|
||
data "google_iam_policy" "network-users" { | ||
binding { | ||
role = "roles/compute.networkUser" | ||
members = "${var.network_users}" | ||
} | ||
} | ||
|
||
resource "google_project_iam_policy" "network-users" { | ||
project = google_project_service.host.project | ||
policy_data = data.google_iam_policy.network-users.policy_data | ||
} | ||
|
||
resource "google_compute_shared_vpc_host_project" "host" { | ||
project = google_project_service.host.project | ||
|
||
depends_on = [google_project_service.host] | ||
} | ||
|
||
resource "google_compute_network" "svc_network" { | ||
project = "${google_project.host.project_id}" | ||
name = "svc-network" | ||
auto_create_subnetworks = "false" | ||
} | ||
|
||
resource "google_compute_subnetwork" "service" { | ||
project = "${google_project.host.project_id}" | ||
ip_cidr_range = "${var.subnet_cidr_dev}" | ||
name = "service-zone" | ||
network = "${google_compute_network.svc_network.name}" | ||
region = "${var.default_region}" | ||
private_ip_google_access = true | ||
} |
55 changes: 55 additions & 0 deletions
55
deployment-templates/Terraform/2-projects/Host_Project_Prod.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
### DEV Host Project in the Shared VPC setup####### | ||
|
||
|
||
resource "random_id" "default-project-id-prd" { | ||
byte_length = 2 | ||
prefix = "host-prod" | ||
} | ||
|
||
resource "google_project" "host_prod" { | ||
name = "${var.project_name}-Prod" | ||
project_id = random_id.default-project-id-prd.hex | ||
folder_id = google_folder.ProB_Prod.name | ||
billing_account = var.billing_account | ||
auto_create_network = false | ||
} | ||
|
||
resource "google_project_service" "host_prod" { | ||
project = "${google_project.host_prod.project_id}" | ||
|
||
service = "compute.googleapis.com" | ||
disable_on_destroy = false | ||
} | ||
|
||
data "google_iam_policy" "network-users_prod" { | ||
binding { | ||
role = "roles/compute.networkUser" | ||
members = "${var.network_users}" | ||
} | ||
} | ||
|
||
resource "google_project_iam_policy" "network-users-prod" { | ||
project = "${google_project_service.host_prod.project}" | ||
policy_data = "${data.google_iam_policy.network-users_prod.policy_data}" | ||
} | ||
|
||
resource "google_compute_shared_vpc_host_project" "host_prod" { | ||
project = "${google_project_service.host_prod.project}" | ||
|
||
depends_on = ["google_project_service.host_prod"] | ||
} | ||
|
||
resource "google_compute_network" "svc_network_prod" { | ||
project = "${google_project.host_prod.project_id}" | ||
name = "svc-network" | ||
auto_create_subnetworks = "false" | ||
} | ||
|
||
resource "google_compute_subnetwork" "service_prod" { | ||
project = "${google_project.host_prod.project_id}" | ||
ip_cidr_range = "${var.subnet_cidr_prod}" | ||
name = "service-zone" | ||
network = "${google_compute_network.svc_network_prod.name}" | ||
region = "${var.default_region}" | ||
private_ip_google_access = true | ||
} |
Oops, something went wrong.