-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
234 lines (196 loc) · 6.79 KB
/
variables.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
/**
* 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.
*/
/******************************************
Required variables
*******************************************/
variable "org_id" {
description = "GCP Organization ID"
type = string
}
variable "billing_account" {
description = "The ID of the billing account to associate projects with."
type = string
}
variable "group_org_admins" {
description = "Google Group for GCP Organization Administrators"
type = string
}
variable "default_region" {
description = "Default region to create resources where applicable."
type = string
default = "us-central1"
}
/* ----------------------------------------
Specific to CICD Project
---------------------------------------- */
variable "jenkins_agent_gce_name" {
description = "Jenkins Agent GCE Instance name."
type = string
default = "jenkins-agent-01"
}
variable "jenkins_agent_gce_machine_type" {
description = "Jenkins Agent GCE Instance type."
type = string
default = "n1-standard-1"
}
variable "jenkins_agent_gce_subnetwork_cidr_range" {
description = "The subnetwork to which the Jenkins Agent will be connected to (in CIDR range 0.0.0.0/0)"
type = string
}
variable "jenkins_agent_gce_private_ip_address" {
description = "The private IP Address of the Jenkins Agent. This IP Address must be in the CIDR range of `jenkins_agent_gce_subnetwork_cidr_range` and be reachable through the VPN that exists between on-prem (Jenkins Master) and GCP (CICD Project, where the Jenkins Agent is located)."
type = string
}
variable "jenkins_agent_gce_ssh_user" {
description = "Jenkins Agent GCE Instance SSH username."
type = string
default = "jenkins"
}
variable "jenkins_agent_gce_ssh_pub_key" {
description = "SSH public key needed by the Jenkins Agent GCE Instance. The Jenkins Master holds the SSH private key. The correct format is `'ssh-rsa [KEY_VALUE] [USERNAME]'`"
type = string
}
variable "jenkins_agent_sa_email" {
description = "Email for Jenkins Agent service account."
type = string
default = "jenkins-agent-gce"
}
variable "jenkins_master_subnetwork_cidr_range" {
description = "A list of CIDR IP ranges of the Jenkins Master in the form ['0.0.0.0/0']. Usually only one IP in the form '0.0.0.0/32'. Needed to create a FW rule that allows communication with the Jenkins Agent GCE Instance."
type = list(string)
}
variable "nat_bgp_asn" {
type = number
description = "BGP ASN for NAT cloud route. This is needed to allow the Jenkins Agent to download packages and updates from the internet without having an external IP address."
}
variable "vpn_shared_secret" {
description = "The shared secret used in the VPN"
type = string
}
variable "on_prem_vpn_public_ip_address" {
description = "The public IP Address of the Jenkins Master."
type = string
}
variable "on_prem_vpn_public_ip_address2" {
description = "The secondpublic IP Address of the Jenkins Master."
type = string
}
variable "router_asn" {
type = number
description = "BGP ASN for cloud routes."
default = "64515"
}
variable "bgp_peer_asn" {
type = number
description = "BGP ASN for peer cloud routes."
default = "64513"
}
variable "tunnel0_bgp_peer_address" {
type = string
description = "BGP peer address for tunnel 0"
}
variable "tunnel0_bgp_session_range" {
type = string
description = "BGP session range for tunnel 0"
}
variable "tunnel1_bgp_peer_address" {
type = string
description = "BGP peer address for tunnel 1"
}
variable "tunnel1_bgp_session_range" {
type = string
description = "BGP session range for tunnel 1"
}
/* ----------------------------------------
Specific to Seed Project
---------------------------------------- */
variable "terraform_service_account" {
description = "Email for terraform service account. It must be supplied by the seed project"
type = string
}
variable "terraform_sa_name" {
description = "Fully-qualified name of the terraform service account. It must be supplied by the seed project"
type = string
}
variable "terraform_state_bucket" {
description = "Default state bucket, used in Cloud Build substitutions. It must be supplied by the seed project"
type = string
}
/******************************************
Optional variables
*******************************************/
variable "project_labels" {
description = "Labels to apply to the project."
type = map(string)
default = {}
}
variable "project_prefix" {
description = "Name prefix to use for projects created."
type = string
default = "prj"
}
variable "activate_apis" {
description = "List of APIs to enable in the CICD project."
type = list(string)
default = [
"serviceusage.googleapis.com",
"servicenetworking.googleapis.com",
"compute.googleapis.com",
"logging.googleapis.com",
"bigquery.googleapis.com", // required to create the BQ log sinks
"cloudresourcemanager.googleapis.com",
"cloudbilling.googleapis.com",
"iam.googleapis.com",
"admin.googleapis.com",
"appengine.googleapis.com",
"storage-api.googleapis.com",
]
}
variable "sa_enable_impersonation" {
description = "Allow org_admins group to impersonate service account & enable APIs required."
type = bool
default = false
}
variable "service_account_prefix" {
description = "Name prefix to use for service accounts."
type = string
default = "sa"
}
variable "storage_bucket_prefix" {
description = "Name prefix to use for storage buckets."
type = string
default = "bkt"
}
variable "storage_bucket_labels" {
description = "Labels to apply to the storage bucket."
type = map(string)
default = {}
}
variable "folder_id" {
description = "The ID of a folder to host this project"
type = string
default = ""
}
variable "terraform_version" {
description = "Default terraform version."
type = string
default = "0.13.7"
}
variable "terraform_version_sha256sum" {
description = "sha256sum for default terraform version."
type = string
default = "4a52886e019b4fdad2439da5ff43388bbcc6cce9784fde32c53dcd0e28ca9957"
}