-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
97 lines (94 loc) · 3.71 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/**
* 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 = "production"
environment_code = substr(local.env, 0, 1)
default_region1 = "us-west1"
default_region2 = "us-central1"
/*
* Base network ranges
*/
base_private_service_cidr = "10.16.24.0/21"
base_subnet_primary_ranges = {
(local.default_region1) = "10.0.192.0/18"
(local.default_region2) = "10.1.192.0/18"
}
base_subnet_proxy_ranges = {
(local.default_region1) = "10.18.6.0/23"
(local.default_region2) = "10.19.6.0/23"
}
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.192.0/18"
},
{
range_name = "rn-${local.environment_code}-shared-base-${local.default_region1}-gke-svc"
ip_cidr_range = "100.65.192.0/18"
}
]
}
/*
* Restricted network ranges
*/
restricted_private_service_cidr = "10.16.56.0/21"
restricted_subnet_primary_ranges = {
(local.default_region1) = "10.8.192.0/18"
(local.default_region2) = "10.9.192.0/18"
}
restricted_subnet_proxy_ranges = {
(local.default_region1) = "10.26.6.0/23"
(local.default_region2) = "10.27.6.0/23"
}
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.192.0/18"
},
{
range_name = "rn-${local.environment_code}-shared-restricted-${local.default_region1}-gke-svc"
ip_cidr_range = "100.73.192.0/18"
}
]
}
}
module "base_env" {
source = "../../modules/base_env"
env = local.env
environment_code = local.environment_code
access_context_manager_policy_id = var.access_context_manager_policy_id
perimeter_additional_members = var.perimeter_additional_members
default_region1 = local.default_region1
default_region2 = local.default_region2
domain = var.domain
ingress_policies = var.ingress_policies
egress_policies = var.egress_policies
enable_partner_interconnect = false
base_private_service_cidr = local.base_private_service_cidr
base_subnet_primary_ranges = local.base_subnet_primary_ranges
base_subnet_proxy_ranges = local.base_subnet_proxy_ranges
base_subnet_secondary_ranges = local.base_subnet_secondary_ranges
base_private_service_connect_ip = "10.17.0.4"
restricted_private_service_cidr = local.restricted_private_service_cidr
restricted_subnet_primary_ranges = local.restricted_subnet_primary_ranges
restricted_subnet_proxy_ranges = local.restricted_subnet_proxy_ranges
restricted_subnet_secondary_ranges = local.restricted_subnet_secondary_ranges
restricted_private_service_connect_ip = "10.17.0.8"
remote_state_bucket = var.remote_state_bucket
tfc_org_name = var.tfc_org_name
}