-
Notifications
You must be signed in to change notification settings - Fork 724
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* adding copy of 3-network folder for hub-and-spoke definition * Removing unnecessary hub-and-spoke setup on 3-networks step * Adding script to undo the disable_tf_files.sh removal * adding 3-networks-hub-and-spoke directory to scripts disable/restore * Adding 3-networks-hub-and-spoke/shared to disable/restore scripts * Adding hub-and-spoke IT for networks and shared test folders * Adding conditional for specific netwotk folder based on environment mode * adjusting 3-networks-hub-and-spoke to only contain this topology * Removing unnecessary additional test files * Adjusting projects test to hit the specific networks folder * Renaming 3-networks to 3-networks-dual-svpc * Making the scripts sensitive to the TF_VAR_example_foundations_mode env * Removing hub and spoke references * Adjusting hub-and-spoke .tf setup * generate docs * Updating readme with new folders * Internal review issues changes * Cherry pick from "Feature/private service connect module" * Lint fixes * Internal PR small issues * Adding missing tfvars file for environments on new networks folders * Updating network version of the modules in advance to merge conflict * Removing unnecessary transitivity module and adjusting some readme details * "network architecture" description updated on readme * Removing some unnecessary conditional flow from hub and spoke * Resolving the conflicts from master * Corrections after generate docs and lint * FIxing some more lint issues * Fixing wrong conditional removes * Generate docs fix * putting enable HS transitivity back
- Loading branch information
Showing
216 changed files
with
6,694 additions
and
148 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
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
File renamed without changes.
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
File renamed without changes.
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,27 @@ | ||
/** | ||
* Copyright 2021 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
org_id = "000000000000" | ||
|
||
terraform_service_account = "org-terraform@prj-b-seed-2334.iam.gserviceaccount.com" | ||
|
||
// The DNS name of peering managed zone. Must end with a period. | ||
domain = "example.com." | ||
|
||
// Optional - for an organization with existing projects or for development/validation. | ||
// Must be the same value used in previous steps. | ||
//parent_folder = "000000000000" | ||
|
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,46 @@ | ||
# 3-networks-dual-svpc/development | ||
|
||
The purpose of this step is to set up base and restricted shared VPCs with default DNS, NAT (optional), Private Service networking, VPC service controls, onprem Dedicated Interconnect, onprem VPN and baseline firewall rules for environment development. | ||
|
||
## Prerequisites | ||
|
||
1. 0-bootstrap executed successfully. | ||
1. 1-org executed successfully. | ||
1. 2-environments/envs/development executed successfully. | ||
1. 3-networks-dual-svpc/envs/shared executed successfully. | ||
1. Obtain the value for the access_context_manager_policy_id variable. Can be obtained by running `gcloud access-context-manager policies list --organization YOUR_ORGANIZATION_ID --format="value(name)"`. | ||
|
||
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --> | ||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|------|---------|:--------:| | ||
| access\_context\_manager\_policy\_id | The id of the default Access Context Manager policy created in step `1-org`. Can be obtained by running `gcloud access-context-manager policies list --organization YOUR_ORGANIZATION_ID --format="value(name)"`. | `number` | n/a | yes | | ||
| domain | The DNS name of peering managed zone, for instance 'example.com.'. Must end with a period. | `string` | n/a | yes | | ||
| folder\_prefix | Name prefix to use for folders created. Should be the same in all steps. | `string` | `"fldr"` | no | | ||
| org\_id | Organization ID | `string` | n/a | yes | | ||
| parent\_folder | Optional - for an organization with existing projects or for development/validation. It will place all the example foundation resources under the provided folder instead of the root organization. The value is the numeric folder ID. The folder must already exist. Must be the same value used in previous step. | `string` | `""` | no | | ||
| terraform\_service\_account | Service account email of the account to impersonate to run Terraform. | `string` | n/a | yes | | ||
|
||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| base\_host\_project\_id | The base host project ID | | ||
| base\_network\_name | The name of the VPC being created | | ||
| base\_network\_self\_link | The URI of the VPC being created | | ||
| base\_subnets\_ips | The IPs and CIDRs of the subnets being created | | ||
| base\_subnets\_names | The names of the subnets being created | | ||
| base\_subnets\_secondary\_ranges | The secondary ranges associated with these subnets | | ||
| base\_subnets\_self\_links | The self-links of subnets being created | | ||
| restricted\_access\_level\_name | Access context manager access level name | | ||
| restricted\_host\_project\_id | The restricted host project ID | | ||
| restricted\_network\_name | The name of the VPC being created | | ||
| restricted\_network\_self\_link | The URI of the VPC being created | | ||
| restricted\_service\_perimeter\_name | Access context manager service perimeter name | | ||
| restricted\_subnets\_ips | The IPs and CIDRs of the subnets being created | | ||
| restricted\_subnets\_names | The names of the subnets being created | | ||
| restricted\_subnets\_secondary\_ranges | The secondary ranges associated with these subnets | | ||
| restricted\_subnets\_self\_links | The self-links of subnets being created | | ||
|
||
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,84 @@ | ||
/** | ||
* Copyright 2021 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
locals { | ||
env = "development" | ||
environment_code = substr(local.env, 0, 1) | ||
default_region1 = "us-west1" | ||
default_region2 = "us-central1" | ||
/* | ||
* Base network ranges | ||
*/ | ||
base_private_service_cidr = "10.16.64.0/21" | ||
base_subnet_primary_ranges = { | ||
(local.default_region1) = "10.0.64.0/21" | ||
(local.default_region2) = "10.1.64.0/21" | ||
} | ||
base_subnet_secondary_ranges = { | ||
(local.default_region1) = [ | ||
{ | ||
range_name = "rn-${local.environment_code}-shared-base-${local.default_region1}-gke-pod" | ||
ip_cidr_range = "100.64.64.0/21" | ||
}, | ||
{ | ||
range_name = "rn-${local.environment_code}-shared-base-${local.default_region1}-gke-svc" | ||
ip_cidr_range = "100.64.72.0/21" | ||
} | ||
] | ||
} | ||
/* | ||
* Restricted network ranges | ||
*/ | ||
restricted_private_service_cidr = "10.24.64.0/21" | ||
restricted_subnet_primary_ranges = { | ||
(local.default_region1) = "10.8.64.0/21" | ||
(local.default_region2) = "10.9.64.0/21" | ||
} | ||
restricted_subnet_secondary_ranges = { | ||
(local.default_region1) = [ | ||
{ | ||
range_name = "rn-${local.environment_code}-shared-restricted-${local.default_region1}-gke-pod" | ||
ip_cidr_range = "100.72.64.0/21" | ||
}, | ||
{ | ||
range_name = "rn-${local.environment_code}-shared-restricted-${local.default_region1}-gke-svc" | ||
ip_cidr_range = "100.72.72.0/21" | ||
} | ||
] | ||
} | ||
} | ||
|
||
module "base_env" { | ||
source = "../../modules/base_env" | ||
|
||
env = local.env | ||
environment_code = local.environment_code | ||
org_id = var.org_id | ||
access_context_manager_policy_id = var.access_context_manager_policy_id | ||
terraform_service_account = var.terraform_service_account | ||
default_region1 = local.default_region1 | ||
default_region2 = local.default_region2 | ||
domain = var.domain | ||
parent_folder = var.parent_folder | ||
enable_partner_interconnect = false | ||
base_private_service_cidr = local.base_private_service_cidr | ||
base_subnet_primary_ranges = local.base_subnet_primary_ranges | ||
base_subnet_secondary_ranges = local.base_subnet_secondary_ranges | ||
restricted_private_service_cidr = local.restricted_private_service_cidr | ||
restricted_subnet_primary_ranges = local.restricted_subnet_primary_ranges | ||
restricted_subnet_secondary_ranges = local.restricted_subnet_secondary_ranges | ||
|
||
} |
File renamed without changes.
File renamed without changes.
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,47 @@ | ||
/** | ||
* Copyright 2021 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
variable "org_id" { | ||
type = string | ||
description = "Organization ID" | ||
} | ||
|
||
variable "access_context_manager_policy_id" { | ||
type = number | ||
description = "The id of the default Access Context Manager policy created in step `1-org`. Can be obtained by running `gcloud access-context-manager policies list --organization YOUR_ORGANIZATION_ID --format=\"value(name)\"`." | ||
} | ||
|
||
variable "terraform_service_account" { | ||
type = string | ||
description = "Service account email of the account to impersonate to run Terraform." | ||
} | ||
|
||
variable "domain" { | ||
type = string | ||
description = "The DNS name of peering managed zone, for instance 'example.com.'. Must end with a period." | ||
} | ||
|
||
variable "parent_folder" { | ||
description = "Optional - for an organization with existing projects or for development/validation. It will place all the example foundation resources under the provided folder instead of the root organization. The value is the numeric folder ID. The folder must already exist. Must be the same value used in previous step." | ||
type = string | ||
default = "" | ||
} | ||
|
||
variable "folder_prefix" { | ||
description = "Name prefix to use for folders created. Should be the same in all steps." | ||
type = string | ||
default = "fldr" | ||
} |
File renamed without changes.
Oops, something went wrong.