Skip to content

Commit 7745511

Browse files
committed
init/updateGCPTerraformModules: 1.4.1
Signed-off-by: FTNT-HQCM <hq-devops-admin@fortinet.com>
1 parent e50b95d commit 7745511

File tree

19 files changed

+236
-42
lines changed

19 files changed

+236
-42
lines changed

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
## 1.4.1 (June, 11, 2025)
2+
3+
IMPROVEMENTS:
4+
5+
* Module `modules/fortinet/generic_vm_standalone`:
6+
* Added the latest versions for every Fortinet product.
7+
* Module `modules/fortigate/fgt_asg_with_function`:
8+
* Supported health check in UMS mode.
9+
* Modified default value and description of `cloud_function->service_config->max_instance_request_concurrency`.
10+
* Improved concurrency logic.
11+
* The cloud function can read the value of `autohealing->health_check_port` and change the probe port of FGT to this value.
12+
* "HEALTHCHECK_PORT" configuration will only be uploaded to the primary FGT. The secondary FGTs could only get this information by syncing with the primary FGT.
13+
* Example `autoscale_fgt_as_hub`:
14+
* Supported everything changed in Module `fgt_asg_with_function`.
15+
* The resource `google_compute_region_health_check` will not be created if no LB is created by this example.
16+
* Example `examples/autoscale_fgt_lb_sandwich`:
17+
* Supported everything changed in Module `fgt_asg_with_function`.
18+
* Document:
19+
* Added new file `/docs/guide_upgrade_fgt_asg.md`.
20+
21+
122
## 1.4.0 (May, 16, 2025)
223

324
FEATURES:

docs/autoscale_fgt_as_hub.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,8 @@ cloud_function = {
197197
# This parameter controls the instance that runs the cloud function. For simplicity, it is recommended to use the default value.
198198
service_config = {
199199
max_instance_count = 1 # The limit on the maximum number of function instances that may coexist at a given time.
200-
max_instance_request_concurrency = 3 # Sets the maximum number of concurrent requests that one cloud function can handle at the same time.
200+
max_instance_request_concurrency = 10 # Sets the maximum number of concurrent requests that one cloud function can handle at the same time.
201+
# Recommended to set it to no less than the maximum number of FGT instances (variable "autoscaler.max_instances").
201202
available_cpu = "1" # The number of CPUs used in a single container instance.
202203
available_memory = "1G" # The amount of memory available for a function.
203204
timeout_seconds = 420 # The function execution timeout.
@@ -254,7 +255,7 @@ The cloud function will retrieve your existing unused FortiFlex entitlements and
254255
You need to provide your FortiFlex `username` and `password`.
255256
You also need to provide a FortiGate configuration `config` (A digital number). You can use our fortiflexvm Terraform to [create a FortiGate configuration](https://registry.terraform.io/providers/fortinetdev/fortiflexvm/latest/docs/resources/fortiflexvm_config) and get its config ID. You need to [use this config ID to create entitlements](https://registry.terraform.io/providers/fortinetdev/fortiflexvm/latest/docs/resources/fortiflexvm_entitlements_vm) in advance.
256257

257-
`service_config` is a variable that controls the instance on which the cloud function runs. You can increase `max_instance_request_concurrency` to allow multiple injection license requests to run simultaneously. You need to increase `available_memory` if your `max_instance_request_concurrency` is high and running out of existing memory.
258+
`service_config` is a variable that controls the instance on which the cloud function runs. You can increase `max_instance_request_concurrency` to allow multiple cloud function requests to run simultaneously. You need to increase `available_memory` if your `max_instance_request_concurrency` is high and running out of existing memory.
258259

259260
`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.
260261

docs/autoscale_fgt_lb_sandwich.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ cloud_function = {
173173
# This parameter controls the instance that runs the cloud function. For simplicity, it is recommended to use the default value.
174174
service_config = {
175175
max_instance_count = 1 # The limit on the maximum number of function instances that may coexist at a given time.
176-
max_instance_request_concurrency = 3 # Sets the maximum number of concurrent requests that one cloud function can handle at the same time.
176+
max_instance_request_concurrency = 10 # Sets the maximum number of concurrent requests that one cloud function can handle at the same time.
177+
# Recommended to set it to no less than the maximum number of FGT instances (variable "autoscaler.max_instances").
177178
available_cpu = "1" # The number of CPUs used in a single container instance.
178179
available_memory = "1G" # The amount of memory available for a function.
179180
timeout_seconds = 420 # The function execution timeout.
@@ -209,7 +210,7 @@ The cloud function will retrieve your existing unused FortiFlex entitlements and
209210
You need to provide your FortiFlex `username` and `password`.
210211
You also need to provide a FortiGate configuration `config` (A digital number). You can use our fortiflexvm Terraform to [create a FortiGate configuration](https://registry.terraform.io/providers/fortinetdev/fortiflexvm/latest/docs/resources/fortiflexvm_config) and get its config ID. You need to [use this config ID to create entitlements](https://registry.terraform.io/providers/fortinetdev/fortiflexvm/latest/docs/resources/fortiflexvm_entitlements_vm) in advance.
211212

212-
`service_config` is a variable that controls the instance on which the cloud function runs. You can increase `max_instance_request_concurrency` to allow multiple injection license requests to run simultaneously. You need to increase `available_memory` if your `max_instance_request_concurrency` is high and running out of existing memory.
213+
`service_config` is a variable that controls the instance on which the cloud function runs. You can increase `max_instance_request_concurrency` to allow multiple cloud function requests to run simultaneously. You need to increase `available_memory` if your `max_instance_request_concurrency` is high and running out of existing memory.
213214

214215
`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.
215216

@@ -259,7 +260,7 @@ Autoscaler is used to control when to autoscale and control the number of FortiG
259260

260261
`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.
261262

262-
`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.
263+
`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.
263264

264265
`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.
265266

docs/guide_upgrade_fgt_asg.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Guide: Upgrading FortiGate AutoScale Group
2+
3+
After deploying the examples `autoscale_fgt_as_hub`, `autoscale_fgt_lb_sandwich`, or the module `fortigate/fgt_asg_with_function`, you can upgrade the FortiGate (FGT) image version and the [Cloud Function](https://github.com/fortinetdev/terraform-google-cloud-modules/blob/main/docs/guide_function.md) code.
4+
5+
### Upgrading the FortiGate Image Version
6+
7+
The upgrade process depends on how the FGT image is specified in your Terraform configuration:
8+
9+
- Using `image_type`:
10+
11+
If you specify the image via the variable `image_type`, Terraform will automatically retrieve the latest available image. Simply run the command `terraform apply` and confirm the changes.
12+
13+
- Using `image_type`:
14+
15+
If the FGT image is set via the variable `image_source`, update this variable with the new image reference. Then, run the command `terraform apply` and confirm the changes.
16+
17+
### Upgrading the Cloud Function (Available in version >= 1.4.1)
18+
19+
The [Cloud Function](https://github.com/fortinetdev/terraform-google-cloud-modules/blob/main/docs/guide_function.md) is continuously updated to support new features and improvements. To benefit from these updates, you can upgrade the Cloud Function code using one of the following methods:
20+
21+
#### 1. If you are using a local copy of the project
22+
23+
If you have cloned or downloaded the source code locally (using `terraform.tfvars` file to deploy), you can manually update the Cloud Function code:
24+
25+
1. Download the latest [`cloud function code file`](https://github.com/fortinetdev/terraform-google-cloud-modules/blob/main/modules/fortigate/fgt_asg_with_function/cloud_function.zip)
26+
2. Replace the existing file at `/modules/fortigate/fgt_asg_with_function/cloud_function.zip`.
27+
3. Re-run `terraform apply` to deploy the updated function.
28+
29+
30+
#### 2. If you are using the project as a module (recommended for version ≥ 1.4.1)
31+
32+
If you're using this project as a module, for example, by creating your own `main.tf` file and including the following block:
33+
34+
**Example (initial use without version pinning):**
35+
```
36+
module "autoscale_fgt_lb_sandwich" {
37+
source = "fortinetdev/cloud-modules/google//examples/autoscale_fgt_lb_sandwich"
38+
39+
# other parameters
40+
}
41+
```
42+
Terraform will fetch the latest available version at the time of the first `terraform init`. However, this version is **locked** in your `.terraform.lock.hcl` file and will not automatically update, even if newer versions become available later.
43+
44+
To ensure you're using a specific version, or to upgrade to a newer one, you should explicitly specify the version attribute in your module block.
45+
46+
**To upgrade to a newer version:**
47+
48+
Update the `version` field to the desired version number. For example:
49+
50+
```
51+
module "autoscale_fgt_lb_sandwich" {
52+
source = "fortinetdev/cloud-modules/google//examples/autoscale_fgt_lb_sandwich"
53+
version = "1.4.1" # <-- Update this to a new version
54+
55+
# other parameters
56+
}
57+
```
58+
59+
Then run the following commands to upgrade and apply the changes:
60+
```
61+
terraform init -upgrade
62+
terraform apply
63+
```

0 commit comments

Comments
 (0)