Skip to content

Commit 0b08aae

Browse files
committed
init/updateFlexVMTerraform: 2.3.4
Signed-off-by: FTNT-HQCM <hq-devops-admin@fortinet.com>
1 parent 7842442 commit 0b08aae

7 files changed

Lines changed: 152 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
## 2.4.0 (Unreleased)
22

3+
4+
## 2.3.4 (December 11, 2024)
5+
6+
IMPROVEMENTS:
7+
8+
* Supported 1 new configuration: `FortiRecon`.
9+
10+
311
## 2.3.3 (October 7, 2024)
412

513
IMPROVEMENTS:
614

7-
* Supported 1 new configurations: `FortiSIEM Cloud` (`siem_cloud`)
15+
* Supported 1 new configuration: `FortiSIEM Cloud` (`siem_cloud`)
816
* Added `additional_compute_region` to `fortisase` configuration.
917
* Improved SDK logic.
1018

fortiflexvm/config.go

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111

1212
var PRODUCT_TYPES = []string{"fgt_vm_bundle", "fmg_vm", "fwb_vm", "fgt_vm_lcs", "fc_ems_op", "faz_vm",
1313
"fpc_vm", "fad_vm", "fgt_hw", "fap_hw", "fsw_hw", "fwbc_private", "fwbc_public", "fc_ems_cloud",
14-
"fortisase", "fortiedr"}
14+
"fortisase", "fortiedr", "fortirecon"}
1515

1616
func fortiAPIPatch(t interface{}) bool {
1717
if t == nil {
@@ -61,6 +61,8 @@ func convProductTypeName2Id(p_type string) int {
6161
return 205
6262
case "FORTIEDR":
6363
return 206
64+
case "FORTIRECON":
65+
return 208
6466
case "SIEM_CLOUD":
6567
return 209
6668
default:
@@ -102,6 +104,8 @@ func convProductTypeId2Name(p_id int) string {
102104
return "FORTISASE"
103105
case 206:
104106
return "FORTIEDR"
107+
case 208:
108+
return "FORTIRECON"
105109
case 209:
106110
return "SIEM_CLOUD"
107111
default:
@@ -219,6 +223,16 @@ func convConfParsId2NameList(p_id int) (string, string, string) {
219223
return "faz_vm", "addons", "list"
220224
case 59:
221225
return "fortisase", "additional_compute_region", "int"
226+
case 61:
227+
return "fortirecon", "service_pkg", "string"
228+
case 62:
229+
return "fortirecon", "asset_num", "int"
230+
case 63:
231+
return "fortirecon", "network_num", "int"
232+
case 64:
233+
return "fortirecon", "executive_num", "int"
234+
case 65:
235+
return "fortirecon", "vendor_num", "int"
222236
case 66:
223237
return "siem_cloud", "compute_units", "int"
224238
case 67:
@@ -418,6 +432,21 @@ func convConfParsNameList2Id(p_type, c_name string) int {
418432
default:
419433
return 0
420434
}
435+
case "fortirecon":
436+
switch c_name {
437+
case "service_pkg":
438+
return 61
439+
case "asset_num":
440+
return 62
441+
case "network_num":
442+
return 63
443+
case "executive_num":
444+
return 64
445+
case "vendor_num":
446+
return 65
447+
default:
448+
return 0
449+
}
421450
case "siem_cloud":
422451
switch c_name {
423452
case "compute_units":

fortiflexvm/data_source_configs_list.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,34 @@ func dataSourceConfigsList() *schema.Resource {
406406
},
407407
},
408408
},
409+
"fortirecon": &schema.Schema{
410+
Type: schema.TypeList,
411+
Computed: true,
412+
Elem: &schema.Resource{
413+
Schema: map[string]*schema.Schema{
414+
"service_pkg": &schema.Schema{
415+
Type: schema.TypeString,
416+
Computed: true,
417+
},
418+
"asset_num": &schema.Schema{
419+
Type: schema.TypeInt,
420+
Computed: true,
421+
},
422+
"network_num": &schema.Schema{
423+
Type: schema.TypeInt,
424+
Computed: true,
425+
},
426+
"executive_num": &schema.Schema{
427+
Type: schema.TypeInt,
428+
Computed: true,
429+
},
430+
"vendor_num": &schema.Schema{
431+
Type: schema.TypeInt,
432+
Computed: true,
433+
},
434+
},
435+
},
436+
},
409437
"siem_cloud": &schema.Schema{
410438
Type: schema.TypeList,
411439
Optional: true,

fortiflexvm/resource_config.go

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,11 @@ func resourceConfig() *schema.Resource {
6767
FC_EMS_CLOUD: FortiClient EMS Cloud;
6868
SIEM_CLOUD: FortiSIEM Cloud;
6969
FORTISASE: FortiSASE;
70-
FORTIEDR: FortiEDR.`,
70+
FORTIEDR: FortiEDR;
71+
FORTIRECOND: FortiRecon.`,
7172
ValidateDiagFunc: checkInputValidString("product_type", []string{"FGT_VM_Bundle", "FMG_VM", "FWB_VM", "FGT_VM_LCS",
7273
"FC_EMS_OP", "FC_EMS_CLOUD", "FAZ_VM", "FPC_VM", "FAD_VM", "FGT_HW", "FAP_HW", "FSW_HW",
73-
"FWBC_PRIVATE", "FWBC_PUBLIC", "FORTISASE", "FORTIEDR", "SIEM_CLOUD"}),
74+
"FWBC_PRIVATE", "FWBC_PUBLIC", "FORTISASE", "FORTIEDR", "FORTIRECON", "SIEM_CLOUD"}),
7475
},
7576
"status": &schema.Schema{
7677
Type: schema.TypeString,
@@ -499,6 +500,40 @@ func resourceConfig() *schema.Resource {
499500
},
500501
},
501502
},
503+
"fortirecon": &schema.Schema{
504+
Type: schema.TypeList,
505+
Optional: true,
506+
Computed: true,
507+
Elem: &schema.Resource{
508+
Schema: map[string]*schema.Schema{
509+
"service_pkg": &schema.Schema{
510+
Type: schema.TypeString,
511+
Optional: true,
512+
Computed: true,
513+
},
514+
"asset_num": &schema.Schema{
515+
Type: schema.TypeInt,
516+
Optional: true,
517+
Computed: true,
518+
},
519+
"network_num": &schema.Schema{
520+
Type: schema.TypeInt,
521+
Optional: true,
522+
Computed: true,
523+
},
524+
"executive_num": &schema.Schema{
525+
Type: schema.TypeInt,
526+
Optional: true,
527+
Computed: true,
528+
},
529+
"vendor_num": &schema.Schema{
530+
Type: schema.TypeInt,
531+
Optional: true,
532+
Computed: true,
533+
},
534+
},
535+
},
536+
},
502537
"siem_cloud": &schema.Schema{
503538
Type: schema.TypeList,
504539
Optional: true,
@@ -898,7 +933,7 @@ func expandConfigProductType(d *schema.ResourceData, v interface{}, pre string)
898933
typeId := convProductTypeName2Id(v.(string))
899934
if typeId == 0 {
900935
err := fmt.Errorf("product_type invalid: %v, should be one of [%v]", v.(string),
901-
"FGT_VM_Bundle, FMG_VM, FWB_VM, FGT_VM_LCS, FC_EMS_OP, FAZ_VM, FPC_VM, FAD_VM, FGT_HW, FWBC_PRIVATE, FWBC_PUBLIC, FC_EMS_CLOUD, FORTISASE, FORTIEDR")
936+
"FGT_VM_Bundle, FMG_VM, FWB_VM, FGT_VM_LCS, FC_EMS_OP, FAZ_VM, FPC_VM, FAD_VM, FGT_HW, FWBC_PRIVATE, FWBC_PUBLIC, FC_EMS_CLOUD, FORTISASE, FORTIEDR, FORTIRECON")
902937
return typeId, err
903938
}
904939
return typeId, nil

sdk/sdkcore/forticlient.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ func fortiAPIErrorFormat(result map[string]interface{}, body string) (err error)
118118
func replaceMessage(result map[string]interface{}) map[string]interface{} {
119119
if result["message"] != nil {
120120
message := fmt.Sprintf("%v", result["message"])
121-
re, compile_err := regexp.Compile(`Parameter id (\d+)`)
121+
re, compile_err := regexp.Compile(`(?i)Parameter id (\d+)`)
122122
if compile_err != nil {
123123
return result
124124
}
@@ -249,6 +249,16 @@ func paramID2Name(p_id int) (string, string, string) {
249249
return "faz_vm", "addons", "list"
250250
case 59:
251251
return "fortisase", "additional_compute_region", "int"
252+
case 61:
253+
return "fortirecon", "service_pkg", "string"
254+
case 62:
255+
return "fortirecon", "asset_num", "int"
256+
case 63:
257+
return "fortirecon", "network_num", "int"
258+
case 64:
259+
return "fortirecon", "executive_num", "int"
260+
case 65:
261+
return "fortirecon", "vendor_num", "int"
252262
case 66:
253263
return "siem_cloud", "compute_units", "int"
254264
case 67:

website/docs/d/fortiflexvm_configs_list.html.markdown

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ The `configs` block contains:
5555
* `fwbc_public` - (List of Object) FortiWeb Cloud - Public. The structure of [`configs.fwbc_public` block](#nestedobjatt--configs--fwbc_public) is documented below.
5656
* `fortisase` - (List of Object) FortiSASE. The structure of [`configs.fortisase` block](#nestedobjatt--configs--fortisase) is documented below.
5757
* `fortiedr` - (List of Object) FortiEDR. The structure of [`configs.fortiedr` block](#nestedobjatt--configs--fortiedr) is documented below.
58+
* `fortirecon` - (List of Object) FortiRecon. The structure of [`configs.fortirecon` block](#nestedobjatt--configs--fortirecon) is documented below.
5859
* `siem_cloud` - (List of Object) FortiSIEM Cloud. The structure of [`configs.siem_cloud` block](#nestedobjatt--configs--siem_cloud) is documented below.
5960
* `account_id` - (Optional/Number) Account ID.
6061
* `id` - (Number) The unqiue number of the configuration.
@@ -76,6 +77,7 @@ The `configs` block contains:
7677
* `FWBC_PUBLIC`: FortiWeb Cloud - Public
7778
* `FORTISASE`: FortiSASE
7879
* `FORTIEDR`: FortiEDR
80+
* `FORTIREDON`: FortiRecon
7981
* `SIEM_CLOUD`: FortiSIEM Cloud
8082
* `program_serial_number` - (String) The unique serial number of the FortiFlex Program this configuration belongs to.
8183
* `status` - (String) The status of this configuration. `ACTIVATE` or `DISABLED`.
@@ -379,6 +381,15 @@ The `configs.fortiedr` block contains:
379381
* `endpoints` - (Number) Number of endpoints. Read only.
380382
* `addons` - (List of String) The default value is an empty list. Options: `"FEDRXDR"` (XDR).
381383

384+
<a id="nestedobjatt--configs--fortirecon"></a>
385+
The `configs.fortirecon` block contains:
386+
387+
* `service_pkg` - (String) `"FRNEASM"` (External Attack Surface Monitoring), `"FRNEASMBP"` (External Attack Surface Monitoring & Brand Protect), `"FRNEASMBPACI"` (External Attack Surface Monitoring & Brand Protect & Adversary Centric Intelligence)
388+
* `asset_num` - (Number) Number of Monitored Assets. Number between 200 and 1,000,000 (inclusive). Value should be divisible by 50.
389+
* `network_num` - (Number) Internal Attack Surface Monitoring. Number between 0 and 100 (inclusive)
390+
* `executive_num` - (Number) Executive Monitoring. Number between 0 and 1,000 (inclusive). This value can only be set to 0 if `service_pkg` is `"FRNEASM"` or `"FRNEASMBP"`.
391+
* `vendor_num` - (Number) Vendor Monitoring. Number between 0 and 1,000 (inclusive) This value can only be set to 0 if `service_pkg` is `"FRNEASM"` or `"FRNEASMBP"`.
392+
382393
<a id="nestedobjatt--configs--siem_cloud"></a>
383394
The `configs.siem_cloud` block contains:
384395

website/docs/r/fortiflexvm_config.html.markdown

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,18 @@ resource "fortiflexvm_config" "example16" {
272272
}
273273
}
274274
275+
resource "fortiflexvm_config" "example17" {
276+
product_type = "FORTIRECON"
277+
program_serial_number = "ELAVMS00000XXXXX"
278+
name = "FORTIRECON_example"
279+
fortirecon {
280+
service_pkg = "FRNEASM" # "FRNEASM", "FRNEASMBP" or "FRNEASMBPACI"
281+
asset_num = 200 # Number of Monitored Assets. Number between 200 and 1,000,000 (inclusive). Value should be divisible by 50.
282+
network_num = 0 # Internal Attack Surface Monitoring. Number between 0 and 100 (inclusive)
283+
executive_num = 0 # Executive Monitoring. Number between 0 and 1,000 (inclusive). This value can only be set to 0 if `service_pkg` is `"FRNEASM"` or `"FRNEASMBP"`.
284+
vendor_num = 0 # Vendor Monitoring. Number between 0 and 1,000 (inclusive) This value can only be set to 0 if `service_pkg` is `"FRNEASM"` or `"FRNEASMBP"`.
285+
}
286+
}
275287
```
276288

277289
## Argument Reference
@@ -297,6 +309,7 @@ The following arguments are supported:
297309
* `FWBC_PUBLIC`: FortiWeb Cloud - Public
298310
* `FORTISASE`: FortiSASE
299311
* `FORTIEDR`: FortiEDR
312+
* `FORTIRECON`: FortiRecon
300313
* `SIEM_CLOUD`: FortiSIEM Cloud
301314
* `program_serial_number` - (Required/String) The serial number of your FortiFlex Program. This serial number should start with `"ELAVMR"`.
302315
* `name` - (Required unless you only update the status/String) The name of your configuration.
@@ -319,6 +332,7 @@ The following arguments are supported:
319332
* `fwbc_public` - (Block List) You must fill in this block if your `product_type` is `"FWBC_PUBLIC"`. The structure of [`fwbc_public` block](#nestedblock--fwbc_public) is documented below.
320333
* `fortisase` - (Block List) You must fill in this block if your `product_type` is `"FORTISASE"`. The structure of [`fortisase` block](#nestedblock--fortisase) is documented below.
321334
* `fortiedr` - (Block List) You must fill in this block if your `product_type` is `"FORTIEDR"`. The structure of [`fortiedr` block](#nestedblock--fortiedr) is documented below.
335+
* `fortirecon` - (Block List) You must fill in this block if your `product_type` is `"FORTIRECON"`. The structure of [`fortirecon` block](#nestedblock--fortirecon) is documented below.
322336
* `siem_cloud` - (Block List) You must fill in this block if your `product_type` is `"SIEM_CLOUD"`. The structure of [`siem_cloud` block](#nestedblock--siem_cloud) is documented below.
323337

324338
<a id="nestedblock--fad_vm"></a>
@@ -616,6 +630,17 @@ The `fortisase` block contains:
616630
* `endpoints` - (Read only/Number) Number of endpoints. Read only.
617631
* `addons` - (Optional/List of String) The default value is an empty list. Options: `"FEDRXDR"` (XDR).
618632

633+
<a id="nestedblock--fortirecon"></a>
634+
The `fortisase` block contains:
635+
636+
* `service_pkg` - (Required if `product_type = "FORTITRECON"`/String) Possible values are:
637+
* `"FRNEASM"` (External Attack Surface Monitoring)
638+
* `"FRNEASMBP"` (External Attack Surface Monitoring & Brand Protect)
639+
* `"FRNEASMBPACI"` (External Attack Surface Monitoring & Brand Protect & Adversary Centric Intelligence)
640+
* `asset_num` - (Required if `product_type = "FORTITRECON"`/Number) Number of Monitored Assets. Number between 200 and 1,000,000 (inclusive). Value should be divisible by 50.
641+
* `network_num` - (Optional/Number) Internal Attack Surface Monitoring. Number between 0 and 100 (inclusive)
642+
* `executive_num` - (Optional/Number) Executive Monitoring. Number between 0 and 1,000 (inclusive). This value can only be set to 0 if `service_pkg` is `"FRNEASM"` or `"FRNEASMBP"`.
643+
* `vendor_num` - (Optional/Number) Vendor Monitoring. Number between 0 and 1,000 (inclusive) This value can only be set to 0 if `service_pkg` is `"FRNEASM"` or `"FRNEASMBP"`.
619644

620645
<a id="nestedblock--siem_cloud"></a>
621646
The `siem_cloud` block contains:

0 commit comments

Comments
 (0)