You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,27 @@
1
+
## 1.2.0 (January 31, 2025)
2
+
3
+
IMPROVEMENTS:
4
+
5
+
* Module `fgt_single`:
6
+
* Changed the default value `licensing->fortiflex_token` from 0 to "" (empty string).
7
+
* Module `fgt_asg_with_function`:
8
+
* Improved the primary FGT reselection logic in function script.
9
+
* The deprecated parameter `cloud_function->print_debug_msg` has been removed, please use `cloud_function->logging_level`.
10
+
* Added a new static route to the FGTs' configuration that routes data destined for `cloud_function.function_ip_range` to port `cloud_function.cloud_func_interface`.
11
+
* Added new variable `autoscaler->scale_in_control_sec`. When the FortiGate group scales down, Google Cloud will delete at most one FGT every 'scale_in_control_sec' seconds.
12
+
* Supported connecting with the Vault server to read secret data. Added 3 new internal variables `VAULT_SERVER`, `VAULT_ROLE`, and `VAULT_PATH` in the Cloud Function.
13
+
* Added `count` to some resources related to the `fgt_password`. Some resources are moved, but the functions remain unchanged. E.g., `google_secret_manager_secret_iam_member.instance_password` has moved to `google_secret_manager_secret_iam_member.instance_password[0]`.
14
+
* Added new variable `special_behavior` for customized functionality. Do not use it unless explicitly instructed by the developer.
15
+
* Example `autoscale_fgt_lb_sandwich`:
16
+
* Supported everything changed in Module `fgt_asg_with_function`.
17
+
* By default, this example does not specify the FortiGate hostname. The new variable `fgt_hostname` can set the hostname of all FGTs in the autoscale group. If this variable is not specified, the hostname of the FGT will be its serial number.
18
+
* Added a new static route to the FGTs' configuration that routes data destined for `cloud_function.function_ip_range` to port1.
19
+
* Example `autoscale_fgt_as_hub`:
20
+
* Supported everything changed in Module `fgt_asg_with_function`.
21
+
* By default, this example does not specify the FortiGate hostname. The new variable `fgt_hostname` can set the hostname of all FGTs in the autoscale group. If this variable is not specified, the hostname of the FGT will be its serial number.
22
+
* To use existing ILB, you can specify the ILB IP without creating a new ILB by specifying `network_interfaces->additional_variables->ilb_ip`. For example: `network_interfaces = [{network_name="example-network", subnet_name="example-subnet", additional_variables={ilb_ip="10.0.0.100"}}]`. This script will configure the FGT's interface to support ILB. You need to manually add the FGT instance group as the backend of the existing ILB in Google Cloud after the deployment of this example project.
Copy file name to clipboardExpand all lines: docs/autoscale_fgt_as_hub.md
+38-16Lines changed: 38 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,6 +71,7 @@ If you want to deploy more than one examples, please make sure the `prefix` of t
71
71
```
72
72
fgt_password = "<YOUR-OWN-VALUE>" # Your own value (at least 8 characters), or this terraform project will create one for you. (Username is admin)
73
73
machine_type = "n1-standard-4" # The Virtual Machine type to deploy FGT.
74
+
# fgt_hostname = "example-hostname" # The hostname of all FGTs in the autoscale group. If not specified, the FGT's hostname will be its serial number.
74
75
75
76
# FortiGate image.
76
77
# You can use "image_type" to deploy the latest public FortiGate image, or use "image_source" to deploy the custom image.
@@ -110,7 +111,7 @@ If `additional_disk` is specified, every FGT will have its own log disk, and the
110
111
#### Network Variables:
111
112
```
112
113
network_interfaces = [
113
-
# Port 1 of your FortiGate. This interface has one internal load balancer (ilb), and a route to the ilb.
114
+
# Port 1 of your FortiGate. For this interface, this prject creates an internal load balancer (ILB) and a route to the ILB.
114
115
{
115
116
network_name = "user1-network" # Name of your network.
116
117
subnet_name = "user1-subnet" # Name of your subnet.
@@ -120,23 +121,22 @@ network_interfaces = [
120
121
# And all traffic to "ip_range_route_to_lb" will be routed to the internal load balancer (ilb) in this subnet.
121
122
}
122
123
},
123
-
# Port 2 of your FortiGate. This interface has one internal load balancer (ilb), and a route to the ilb.
124
+
# Port 2 of your FortiGate. For this interface, this prject creates an internal load balancer (ILB). (No route to the ILB).
124
125
{
125
126
network_name = "user2-network"
126
127
subnet_name = "user2-subnet"
127
-
internal_lb = {
128
-
ip_range_route_to_lb = "10.0.0.0/8"
129
-
}
128
+
internal_lb = {}
130
129
},
131
-
# Port 3 of your FortiGate. This interface has one internal load balancer (ilb), and a route to the ilb.
130
+
# Port 3 of your FortiGate. No ILB and route to ILB will be created. Using existing ILB instead.
131
+
# You need to manually add the FGT instance group as the backend of the existing ILB in Google Cloud after the deployment of this example project.
132
132
{
133
133
network_name = "user3-network"
134
134
subnet_name = "user3-subnet"
135
-
internal_lb = {
136
-
ip_range_route_to_lb = "10.0.0.0/8"
135
+
additional_variables = {
136
+
ilb_ip = "10.2.0.100"
137
137
}
138
138
},
139
-
# Port 4 of your FortiGate. This interface doesn't specify "internal_lb", so no ilb and route to ilb will be created.
139
+
# Port 4 of your FortiGate. This interface doesn't specify "internal_lb", so no ILB and route to ILB will be created.
140
140
{
141
141
network_name = "user4-network"
142
142
subnet_name = "user4-subnet"
@@ -158,6 +158,8 @@ ha_sync_interface = "port4" # Please make sure you at least have
158
158
159
159
`network_interfaces[N].internal_lb.ip_range_route_to_lb` helps you to create a route. If it is specified, a route will be created in the subnet `subnet_name` . All traffic to `ip_range_route_to_lb` will be routed to the internal load balancer (ilb) in this subnet.
160
160
161
+
`network_interfaces[N].additional_variables.ilb_ip`. If you want to use an existing ILB, you can specify this variable without creating a new ILB. This variable will configure the FGT's interface to support ILB. **This variable does not connect the FGT instance group to your existing ILB. You need to manually add the FGT instance group as the backend of the existing ILB in Google Cloud after the deployment of this example project.**
162
+
161
163
`network_tags` is a list of network tags attached to FortiGates. GCP firewall rules have "target tags", and these firewall rules only apply to instances with the same tag. You can specify the tags here.
162
164
163
165
`ha_sync_interface` is the port used to sync data between FortiGates. Example values: "port1", "port2", "port3"... If you specified 8 interfaces in `network_interfaces`, then the first interface is "port1", the second one is "port2", the last one is "port8".
@@ -167,8 +169,8 @@ ha_sync_interface = "port4" # Please make sure you at least have
167
169
cloud_function = {
168
170
cloud_func_interface = "port1" # To communicate with FGTs, the Cloud Function must be connected to the VPC where FGTs also exist.
169
171
# By default, this project assumes the Cloud Function connects to the first VPC you specified in "network_interfaces", and configure your FGTs through port1.
170
-
# You can also set it to "port2", "port3", ..., "port8" to force the Cloud Function to connect to other VPC and communicate with your FortiGates through that port.
171
-
# But you need to specify the corresponding route of FGTs in "config_script" or "config_file" so FGTs can reply to the Cloud Function requests from "cloud_function.function_ip_range".
172
+
# You can also set it to "port2", "port3", ..., "port8" to force the Cloud Function to connect to other VPC and communicate with your FortiGates through that port,
173
+
# but you need to specify the corresponding route of FGTs in "config_script" or "config_file" so FGTs can reply to the Cloud Function requests from "cloud_function.function_ip_range".
172
174
function_ip_range = "192.168.8.0/28" # Cloud function needs to have its own CIDR ip range ending with "/28", which cannot be used by other resources.
173
175
license_source = "file" # The source of license if your image_type is "fortigate-xx-byol".
174
176
# Possible value: "none", "fortiflex", "file", "file_fortiflex"
@@ -201,7 +203,26 @@ cloud_function = {
201
203
Cloud function is used to manage FGT synchronization and inject license into FGT.
202
204
203
205
`cloud_func_interface` is the interface of the FortiGates communicate with the Cloud Function. The default value is "port1".
204
-
By default, this project assumes the Cloud Function connects to the first VPC you specified in `network_interfaces`, and configure your FGTs through "port1". You can also set it to "port2", "port3", ..., "port8" to force the Cloud Function to connect to other VPC and communicate with your FortiGates through that port. If this value is not "port1", you need to specify the corresponding route of FGTs in "config_script" or "config_file" so FGTs can reply to the Cloud Function requests from "cloud_function.function_ip_range".
206
+
By default, this project assumes the Cloud Function connects to the first VPC you specified in `network_interfaces`, and configure your FGTs through "port1". You can also set it to "port2", "port3", ..., "port8" to force the Cloud Function to connect to other VPC and communicate with your FortiGates through that port.
207
+
If you set `cloud_func_interface = portX` and "portX" is not the default value "port1", you need to specify
208
+
```
209
+
config_script = <<EOF
210
+
# Using following scripts to let FortiGates respond Cloud Function
211
+
# "set allowaccess https" is required for interface <portX>.
212
+
config system interface
213
+
edit <portX>
214
+
set allowaccess ping https ssh fgfm probe-response
215
+
next
216
+
end
217
+
config router static
218
+
edit 0
219
+
set dst <vault of cloud_function.function_ip_range>
220
+
set device <portX>
221
+
set gateway <gateway of portX>
222
+
next
223
+
end
224
+
EOF
225
+
```
205
226
206
227
`function_ip_range` is used by cloud function. This IP range needs to end with "/28" and cannot be used by any other resources.
207
228
@@ -224,8 +245,8 @@ You also need to provide a FortiGate configuration `config` (A digital number).
224
245
225
246
`additional_variables` specifies additional variables used by Cloud Function. Some variables are too trivial or **not recommended to be changed**. You can specify them here to overwrite the behavior of the Cloud Function for more customization.
226
247
227
-
- "HA_SYNC_INTERFACE": (default: "port2") The port used for HA synchronization.
228
-
- "CLOUD_FUNC_INTERFACE": (default: "port1") Cloud function uses this port to communicate with FortiGates. If CLOUD_FUNC_INTERFACE is not "port1", please also add corresponding route rules in `config_script` (or `config_file`) so FortiGate can respond to the Cloud Function requests.
248
+
To get advice on how to specify `additional_variables` to suit your custom needs, please create an GitHub issue at https://github.com/fortinetdev/terraform-google-cloud-modules
249
+
229
250
- "FIRESTORE_DATABASE": (default: "(default)") The Firestore database that Cloud Function used to store data.
230
251
231
252
```
@@ -234,8 +255,6 @@ cloud_function = {
234
255
235
256
# Only set additional_variables when needed.
236
257
additional_variables = {
237
-
# HA_SYNC_INTERFACE = "port2"
238
-
# CLOUD_FUNC_INTERFACE = "port1"
239
258
# FIRESTORE_DATABASE = "YOUR-EXISTING-DATABASE-NAME" # Default value is "(default)"
240
259
}
241
260
}
@@ -254,6 +273,7 @@ autoscaler = {
254
273
# check_interval_sec = 30 # How often (in seconds) to send a health check.
255
274
# unhealthy_threshold = 10 # A so-far healthy instance will be marked unhealthy after this many consecutive failures.
256
275
}
276
+
scale_in_control_sec = 300 # When the group scales down, Google Cloud will delete at most one FGT every 'scale_in_control_sec' seconds.
257
277
}
258
278
```
259
279
Autoscaler is used to control when to autoscale and control the number of FortiGate instances.
@@ -268,6 +288,8 @@ Autoscaler is used to control when to autoscale and control the number of FortiG
268
288
269
289
`autohealing.health_check_port` is the port used for health checks by autohealing and health checks by load balancers.
270
290
291
+
`scale_in_control_sec` can prevent the aggressive scale down. If `scale_in_control_sec` is not 0, when the group scales down, Google Cloud will delete at most one FGT every 'scale_in_control_sec' seconds. By default, its value is 300.
292
+
271
293
#### Additional FGT configuration script.
272
294
273
295
**NOTE: After deploying this terraform project, changing the variable `config_script` (and contents in `config_file`) will not change the FortiGate configuration.**
Copy file name to clipboardExpand all lines: docs/autoscale_fgt_lb_sandwich.md
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,6 +70,7 @@ If you want to deploy more than one examples, please make sure the `prefix` of t
70
70
fgt_password = "<YOUR-OWN-VALUE>" # Your own value (at least 8 characters), or this terraform project will create one for you. (Username is admin)
71
71
machine_type = "n1-standard-4" # The Virtual Machine type to deploy FGT.
72
72
fgt_has_public_ip = false # If set to true, port1 of all FGTs will have a public IP.
73
+
# fgt_hostname = "example-hostname" # The hostname of all FGTs in the autoscale group. If not specified, the FGT's hostname will be its serial number.
73
74
74
75
# FortiGate image.
75
76
# You can use "image_type" to deploy the latest public FortiGate image, or use "image_source" to deploy the custom image.
@@ -177,6 +178,7 @@ cloud_function = {
177
178
Cloud function is used to manage FGT synchronization and inject license into FGT.
178
179
179
180
`function_ip_range` is used by cloud function. This IP range needs to end with "/28" and cannot be used by any other resources.
181
+
A static route will be created in the FGT that routes data destined for `cloud_function.function_ip_range` to port1.
180
182
181
183
`license_source` is the source of your license. If your `image_type` ends with "byol" (bring your own license), you need to specify your license source here. Possible values are
182
184
- "none": Don't inject licenses to FGTs.
@@ -187,7 +189,7 @@ Cloud function is used to manage FGT synchronization and inject license into FGT
187
189
`autoscale_psksecret` is the secret key used to synchronize information between FortiGates. If not set, this project will randomly generate a 16-character secret key. You can find it in the output.
188
190
189
191
`logging_level` is used to control the verbosity of logs. Possible values include "NONE", "ERROR", "WARN", "INFO", "DEBUG", and "TRACE". Logs can be viewed in the Google Cloud Logs Explorer. If you set logging_level to "INFO", all logs of "INFO" severity or higher ("INFO", "WARN", "ERROR") will be recorded.
190
-
(The previous variable `"print_debug_msg"` has been deprecated, and will be removed in the future.)
192
+
(The previous variable `"print_debug_msg"` has been deprecated and removed.)
191
193
192
194
`fortiflex` is required if your `license_source` is "fortiflex".
193
195
The cloud function will retrieve your existing unused FortiFlex entitlements and use them to inject licenses into FortiGates.
@@ -198,6 +200,8 @@ You also need to provide a FortiGate configuration `config` (A digital number).
198
200
199
201
`additional_variables` specifies additional variables used by Cloud Function. Some variables are too trivial or **not recommended to be changed**. You can specify them here to overwrite the behavior of the Cloud Function for more customization.
200
202
203
+
To get advice on how to specify `additional_variables` to suit your custom needs, please create an GitHub issue at https://github.com/fortinetdev/terraform-google-cloud-modules
204
+
201
205
- "HA_SYNC_INTERFACE": (default: "port2") The port used for HA synchronization.
202
206
- "CLOUD_FUNC_INTERFACE": (default: "port1") Cloud function uses this port to communicate with FortiGates. If CLOUD_FUNC_INTERFACE is not "port1", please also add corresponding route rules in `config_script` (or `config_file`) so FortiGate can respond to the Cloud Function requests.
203
207
- "FIRESTORE_DATABASE": (default: "(default)") The Firestore database that Cloud Function used to store data.
@@ -229,6 +233,7 @@ autoscaler = {
229
233
# check_interval_sec = 30 # How often (in seconds) to send a health check.
230
234
# unhealthy_threshold = 10 # A so-far healthy instance will be marked unhealthy after this many consecutive failures.
231
235
}
236
+
scale_in_control_sec = 300 # When the group scales down, Google Cloud will delete at most one FGT every 'scale_in_control_sec' seconds.
232
237
}
233
238
```
234
239
Autoscaler is used to control when to autoscale and control the number of FortiGate instances.
@@ -241,8 +246,9 @@ Autoscaler is used to control when to autoscale and control the number of FortiG
241
246
242
247
`cpu_utilization` is the autoscaling signal. If CPU utilization is above this value, Google Cloud will create new FGT instances. Google Cloud will also delete idle FGT instances if CPU utilization is low for a long time.
243
248
244
-
`autohealing.health_check_port` is the port used for health checks by autohealing. Autohealing recreates VM instances if your application cannot be reached by the health check. Set it to 0 to disable autohealing. `load_balancer.health_check_port` is used for the load balancer and it can't be disabled. Normally, `autoscaler.autohealing.health_check_port` and `load_balancer.health_check_port` should have the same port number, and its default is 8008 for FortiGates.
249
+
`autohealing.health_check_port` is the port used for health checks by autohealing. Autohealing recreates VM instances if your application cannot be reached by the health check. Set it to 0 to disable autohealing. `load_balancer.health_check_port` is used for the load balancer and it can't be disabled. Normally, `autoscaler.autohealing.health_check_port` and `load_balancer.health_check_port` should have the same port number, and its default is 8008 for FortiGates.
245
250
251
+
`scale_in_control_sec` can prevent the aggressive scale down. If `scale_in_control_sec` is not 0, when the group scales down, Google Cloud will delete at most one FGT every 'scale_in_control_sec' seconds. By default, its value is 300.
0 commit comments