Skip to content

Commit 3169df6

Browse files
chkp-eddiekchkp-natanelm
authored andcommitted
removing step git reset --hard $CI_COMMIT_SHA
1 parent baac997 commit 3169df6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+2973
-8
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
locals {
2+
disk_type_condition = var.disk_type == "SSD Persistent Disk" ? "pd-ssd" : var.disk_type == "Standard Persistent Disk" ? "pd-standard" : ""
3+
admin_SSH_key_condition = var.admin_SSH_key != "" ? true : false
4+
}
5+
6+
resource "google_compute_address" "member_ip_address" {
7+
name = "${var.member_name}-address"
8+
region = var.region
9+
}
10+
11+
resource "google_compute_instance" "cluster_member" {
12+
name = var.member_name
13+
description = "CloudGuard Highly Available Security Cluster"
14+
zone = var.zone
15+
tags = [
16+
"checkpoint-gateway"]
17+
machine_type = var.machine_type
18+
can_ip_forward = true
19+
20+
boot_disk {
21+
auto_delete = true
22+
device_name = "${var.prefix}-boot"
23+
24+
initialize_params {
25+
size = var.disk_size
26+
type = local.disk_type_condition
27+
image = var.image_name
28+
}
29+
}
30+
31+
network_interface {
32+
network = var.cluster_network[0]
33+
subnetwork = var.cluster_network_subnetwork[0]
34+
}
35+
network_interface {
36+
network = var.mgmt_network[0]
37+
subnetwork = var.mgmt_network_subnetwork[0]
38+
access_config {
39+
nat_ip = google_compute_address.member_ip_address.address
40+
}
41+
}
42+
dynamic "network_interface" {
43+
for_each = var.num_internal_networks >= 1 ? [
44+
1] : []
45+
content {
46+
network = var.internal_network1_network[0]
47+
subnetwork = var.internal_network1_subnetwork[0]
48+
}
49+
}
50+
dynamic "network_interface" {
51+
for_each = var.num_internal_networks >= 2 ? [
52+
1] : []
53+
content {
54+
network = var.internal_network2_network[0]
55+
subnetwork = var.internal_network2_subnetwork[0]
56+
}
57+
}
58+
dynamic "network_interface" {
59+
for_each = var.num_internal_networks >= 3 ? [
60+
1] : []
61+
content {
62+
network = var.internal_network3_network[0]
63+
subnetwork = var.internal_network3_subnetwork[0]
64+
}
65+
}
66+
dynamic "network_interface" {
67+
for_each = var.num_internal_networks >= 4 ? [
68+
1] : []
69+
content {
70+
network = var.internal_network4_network[0]
71+
subnetwork = var.internal_network4_subnetwork[0]
72+
}
73+
}
74+
dynamic "network_interface" {
75+
for_each = var.num_internal_networks >= 5 ? [
76+
1] : []
77+
content {
78+
network = var.internal_network5_network[0]
79+
subnetwork = var.internal_network5_subnetwork[0]
80+
}
81+
}
82+
dynamic "network_interface" {
83+
for_each = var.num_internal_networks == 6 ? [
84+
1] : []
85+
content {
86+
network = var.internal_network6_network[0]
87+
subnetwork = var.internal_network6_subnetwork[0]
88+
}
89+
}
90+
91+
service_account {
92+
93+
scopes = [
94+
"https://www.googleapis.com/auth/monitoring.write",
95+
"https://www.googleapis.com/auth/compute",
96+
"https://www.googleapis.com/auth/cloudruntimeconfig"]
97+
}
98+
99+
metadata = local.admin_SSH_key_condition ? {
100+
instanceSSHKey = var.admin_SSH_key
101+
adminPasswordSourceMetadata = var.generate_password ? var.generated_admin_password : ""
102+
} : { adminPasswordSourceMetadata = var.generate_password ? var.generated_admin_password : "" }
103+
104+
metadata_startup_script = templatefile("${path.module}/../startup-script.sh", {
105+
// script's arguments
106+
generatePassword = var.generate_password
107+
config_url = "https://runtimeconfig.googleapis.com/v1beta1/projects/${var.project}/configs/${var.prefix}-config"
108+
config_path = "projects/${var.project}/configs/${var.prefix}-config"
109+
sicKey = var.sic_key
110+
allowUploadDownload = var.allow_upload_download
111+
templateName = "cluster_tf"
112+
templateVersion = "20230910"
113+
templateType = "terraform"
114+
mgmtNIC = ""
115+
hasInternet = "true"
116+
enableMonitoring = var.enable_monitoring
117+
shell = var.admin_shell
118+
installation_type = "Cluster"
119+
computed_sic_key = ""
120+
managementGUIClientNetwork = ""
121+
primary_cluster_address_name = var.primary_cluster_address_name
122+
secondary_cluster_address_name = var.secondary_cluster_address_name
123+
managementNetwork = var.management_network
124+
numAdditionalNICs = var.num_internal_networks
125+
smart_1_cloud_token = "${var.member_name}" == "${var.prefix}-member-a" ? var.smart_1_cloud_token_a : var.smart_1_cloud_token_b
126+
name = var.member_name
127+
zoneConfig = var.zone
128+
region = var.region
129+
os_version = var.os_version
130+
maintenance_mode_password_hash = var.maintenance_mode_password_hash
131+
})
132+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
output "cluster_member_name" {
2+
value = google_compute_instance.cluster_member.name
3+
}
4+
output "cluster_member_ip_address" {
5+
value = google_compute_address.member_ip_address.address
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
variable "prefix" {
2+
type = string
3+
description = "(Optional) Resources name prefix"
4+
default = "chkp-tf-ha"
5+
}
6+
variable "member_name" {
7+
type = string
8+
}
9+
variable "region" {
10+
type = string
11+
default = "us-central1"
12+
}
13+
variable "zone" {
14+
type = string
15+
default = "us-central1-a"
16+
}
17+
variable "machine_type" {
18+
type = string
19+
description = "Machine types determine the specifications of your machines, such as the amount of memory, virtual cores, and persistent disk limits an instance will have."
20+
default = "n1-standard-4"
21+
}
22+
variable "disk_size" {
23+
type = number
24+
description = "Disk size in GB - Persistent disk performance is tied to the size of the persistent disk volume. You are charged for the actual amount of provisioned disk space."
25+
default = 100
26+
}
27+
variable "disk_type" {
28+
type = string
29+
description = "Storage space is much less expensive for a standard Persistent Disk. An SSD Persistent Disk is better for random IOPS or streaming throughput with low latency."
30+
default = "SSD Persistent Disk"
31+
}
32+
variable "image_name" {
33+
type = string
34+
description = "The High Availability (cluster) image name (e.g. check-point-r8120-gw-byol-cluster-123-456-v12345678). You can choose the desired cluster image value from: https://github.com/CheckPointSW/CloudGuardIaaS/blob/master/gcp/deployment-packages/ha-byol/images.py"
35+
}
36+
variable "os_version" {
37+
type = string
38+
description = "GAIA OS version"
39+
default = "R8120"
40+
}
41+
variable "cluster_network" {
42+
type = list(string)
43+
description = "Cluster external network ID in the chosen zone."
44+
}
45+
variable "cluster_network_subnetwork" {
46+
type = list(string)
47+
description = "Cluster subnet ID in the chosen network."
48+
}
49+
variable "mgmt_network" {
50+
type = list(string)
51+
description = "Management network ID in the chosen zone."
52+
}
53+
variable "mgmt_network_subnetwork" {
54+
type = list(string)
55+
description = "Management subnet ID in the chosen network."
56+
}
57+
variable "num_internal_networks" {
58+
type = number
59+
description = "A number in the range 1 - 6 of internal network interfaces."
60+
default = 1
61+
}
62+
variable "internal_network1_network" {
63+
type = list(string)
64+
description = "1st internal network ID in the chosen zone."
65+
default = []
66+
}
67+
variable "internal_network1_subnetwork" {
68+
type = list(string)
69+
description = "1st internal subnet ID in the chosen network."
70+
default = []
71+
}
72+
variable "internal_network2_network" {
73+
type = list(string)
74+
description = "2nd internal network ID in the chosen zone."
75+
default = []
76+
}
77+
variable "internal_network2_subnetwork" {
78+
type = list(string)
79+
description = "2nd internal subnet ID in the chosen network."
80+
default = []
81+
}
82+
variable "internal_network3_network" {
83+
type = list(string)
84+
description = "3rd internal network ID in the chosen zone."
85+
default = []
86+
}
87+
variable "internal_network3_subnetwork" {
88+
type = list(string)
89+
description = "3rd internal subnet ID in the chosen network."
90+
default = []
91+
}
92+
variable "internal_network4_network" {
93+
type = list(string)
94+
description = "4th internal network ID in the chosen zone."
95+
default = []
96+
}
97+
variable "internal_network4_subnetwork" {
98+
type = list(string)
99+
description = "4th internal subnet ID in the chosen network."
100+
default = []
101+
}
102+
variable "internal_network5_network" {
103+
type = list(string)
104+
description = "5th internal network ID in the chosen zone."
105+
default = []
106+
}
107+
variable "internal_network5_subnetwork" {
108+
type = list(string)
109+
description = "5th internal subnet ID in the chosen network."
110+
default = []
111+
}
112+
variable "internal_network6_network" {
113+
type = list(string)
114+
description = "6th internal network ID in the chosen zone."
115+
default = []
116+
}
117+
variable "internal_network6_subnetwork" {
118+
type = list(string)
119+
description = "6th internal subnet ID in the chosen network."
120+
default = []
121+
}
122+
variable "admin_SSH_key" {
123+
type = string
124+
description = "(Optional) The SSH public key for SSH authentication to the MIG instances. Leave this field blank to use all project-wide pre-configured SSH keys."
125+
default = ""
126+
}
127+
variable "project" {
128+
type = string
129+
description = "Personal project id. The project indicates the default GCP project all of your resources will be created in."
130+
default = ""
131+
}
132+
variable "generate_password" {
133+
type = bool
134+
description = "Automatically generate an administrator password."
135+
default = false
136+
}
137+
variable "sic_key" {
138+
type = string
139+
description = "The Secure Internal Communication one time secret used to set up trust between the cluster object and the management server. At least 8 alpha numeric characters. If SIC is not provided and needed, a key will be automatically generated"
140+
}
141+
variable "allow_upload_download" {
142+
type = bool
143+
description = "Allow download from/upload to Check Point."
144+
default = false
145+
}
146+
variable "enable_monitoring" {
147+
type = bool
148+
description = "Enable Stackdriver monitoring"
149+
default = false
150+
}
151+
variable "admin_shell" {
152+
type = string
153+
description = "Change the admin shell to enable advanced command line configuration."
154+
default = "/etc/cli.sh"
155+
}
156+
variable "smart_1_cloud_token_a" {
157+
type = string
158+
description ="(Optional) Smart-1 cloud token for member A to connect this Gateway to Check Point's Security Management as a Service"
159+
default = ""
160+
}
161+
variable "smart_1_cloud_token_b" {
162+
type = string
163+
description ="(Optional) Smart-1 cloud token for member B to connect this Gateway to Check Point's Security Management as a Service"
164+
default = ""
165+
}
166+
variable "maintenance_mode_password_hash" {
167+
description = "Maintenance mode password hash, relevant only for R81.20 and higher versions"
168+
type = string
169+
default = ""
170+
}
171+
variable "management_network" {
172+
type = string
173+
description = "Security Management Server address - The public address of the Security Management Server, in CIDR notation. If using Smart-1 Cloud management, insert 'S1C'. VPN peers addresses cannot be in this CIDR block, so this value cannot be the zero-address."
174+
}
175+
variable "generated_admin_password" {
176+
type = string
177+
description = "administrator password"
178+
}
179+
variable "primary_cluster_address_name" {
180+
type = string
181+
}
182+
variable "secondary_cluster_address_name" {
183+
type = string
184+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+

deprecated/terraform/gcp/separate-single-and-autoscale/common/common/output.tf

Whitespace-only changes.

0 commit comments

Comments
 (0)