Skip to content

Commit e17f3a9

Browse files
authored
fix bugs and add resources (#134)
* Fix bugs in vpn,exception group and threat exception resources * change fields from type bool to string in VPN resources
1 parent 0831588 commit e17f3a9

4 files changed

+87
-87
lines changed

checkpoint/data_source_checkpoint_management_vpn_community_meshed.go

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func dataSourceManagementVpnCommunityMeshed() *schema.Resource {
6363
Description: "The encryption algorithm to be used.",
6464
},
6565
"ike_p1_rekey_time": {
66-
Type: schema.TypeInt,
66+
Type: schema.TypeString,
6767
Computed: true,
6868
Description: "Indicates the time interval for IKE phase 1 renegotiation.",
6969
},
@@ -87,7 +87,7 @@ func dataSourceManagementVpnCommunityMeshed() *schema.Resource {
8787
Description: "The encryption algorithm to be used.",
8888
},
8989
"ike_p2_use_pfs": {
90-
Type: schema.TypeBool,
90+
Type: schema.TypeString,
9191
Computed: true,
9292
Description: "Indicates whether Perfect Forward Secrecy (PFS) is being used for IKE phase 2.",
9393
},
@@ -97,7 +97,7 @@ func dataSourceManagementVpnCommunityMeshed() *schema.Resource {
9797
Description: "The Diffie-Hellman group to be used.",
9898
},
9999
"ike_p2_rekey_time": {
100-
Type: schema.TypeInt,
100+
Type: schema.TypeString,
101101
Computed: true,
102102
Description: "Indicates the time interval for IKE phase 2 renegotiation.",
103103
},
@@ -156,7 +156,7 @@ func dataSourceManagementVpnCommunityMeshed() *schema.Resource {
156156
Schema: map[string]*schema.Schema{
157157
"internal_gateway": {
158158
Type: schema.TypeString,
159-
Computed: true,
159+
Computed: true,
160160
Description: "Internally managed Check Point gateway identified by name or UID, or 'Any' for all internal-gateways participants in this community.",
161161
},
162162
"external_gateway": {
@@ -196,7 +196,7 @@ func dataSourceManagementVpnCommunityMeshed() *schema.Resource {
196196
Description: "The encryption algorithm to be used.",
197197
},
198198
"ike_p1_rekey_time": {
199-
Type: schema.TypeInt,
199+
Type: schema.TypeString,
200200
Computed: true,
201201
Description: "Indicates the time interval for IKE phase 1 renegotiation.",
202202
},
@@ -221,7 +221,7 @@ func dataSourceManagementVpnCommunityMeshed() *schema.Resource {
221221
Description: "The encryption algorithm to be used.",
222222
},
223223
"ike_p2_use_pfs": {
224-
Type: schema.TypeBool,
224+
Type: schema.TypeString,
225225
Computed: true,
226226
Description: "Indicates whether Perfect Forward Secrecy (PFS) is being used for IKE phase 2.",
227227
},
@@ -231,7 +231,7 @@ func dataSourceManagementVpnCommunityMeshed() *schema.Resource {
231231
Description: "The Diffie-Hellman group to be used.",
232232
},
233233
"ike_p2_rekey_time": {
234-
Type: schema.TypeInt,
234+
Type: schema.TypeString,
235235
Computed: true,
236236
Description: "Indicates the time interval for IKE phase 2 renegotiation.",
237237
},
@@ -344,7 +344,7 @@ func dataSourceManagementVpnCommunityMeshedRead(d *schema.ResourceData, m interf
344344
ikePhase1MapToReturn["encryption_algorithm"] = v
345345
}
346346
if v := ikePhase1Map["ike-p1-rekey-time"]; v != nil {
347-
ikePhase1MapToReturn["ike_p1_rekey_time"] = v
347+
ikePhase1MapToReturn["ike_p1_rekey_time"] = strconv.Itoa(int(v.(float64)))
348348
}
349349
_, ikePhase1InConf := d.GetOk("ike_phase_1")
350350
defaultIkePhase1 := map[string]interface{}{"encryption_algorithm": "aes-256", "diffie_hellman_group": "group-2", "data_integrity": "sha1"}
@@ -371,13 +371,13 @@ func dataSourceManagementVpnCommunityMeshedRead(d *schema.ResourceData, m interf
371371
ikePhase2MapToReturn["encryption_algorithm"] = v
372372
}
373373
if v := ikePhase2Map["ike-p2-use-pfs"]; v != nil {
374-
ikePhase2MapToReturn["ike_p2_use_pfs"] = v
374+
ikePhase2MapToReturn["ike_p2_use_pfs"] = strconv.FormatBool(v.(bool))
375375
}
376376
if v := ikePhase2Map["ike-p2-pfs-dh-grp"]; v != nil {
377377
ikePhase2MapToReturn["ike_p2_pfs_dh_grp"] = v
378378
}
379379
if v := ikePhase2Map["ike-p2-rekey-time"]; v != nil {
380-
ikePhase2MapToReturn["ike_p2_rekey_time"] = v
380+
ikePhase2MapToReturn["ike_p2_rekey_time"] = strconv.Itoa(int(v.(float64)))
381381
}
382382
_, ikePhase2InConf := d.GetOk("ike_phase_2")
383383
defaultIkePhase2 := map[string]interface{}{"encryption_algorithm": "aes-128", "data_integrity": "sha1"}
@@ -411,7 +411,7 @@ func dataSourceManagementVpnCommunityMeshedRead(d *schema.ResourceData, m interf
411411
}
412412
}
413413
_ = d.Set("override_vpn_domains", overrideVpnDomainsListToReturn)
414-
}else{
414+
} else {
415415
_ = d.Set("override_vpn_domains", nil)
416416
}
417417

@@ -448,7 +448,7 @@ func dataSourceManagementVpnCommunityMeshedRead(d *schema.ResourceData, m interf
448448
}
449449
}
450450
_ = d.Set("shared_secrets", sharedSecretsListToReturn)
451-
}else{
451+
} else {
452452
_ = d.Set("shared_secrets", nil)
453453
}
454454

@@ -471,7 +471,7 @@ func dataSourceManagementVpnCommunityMeshedRead(d *schema.ResourceData, m interf
471471
if obj["name"] != nil {
472472
internalGatewayName = obj["name"].(string)
473473
}
474-
}else if val, ok := v.(string); ok {
474+
} else if val, ok := v.(string); ok {
475475
internalGatewayName = val
476476
}
477477
granularEncryptionState["internal_gateway"] = internalGatewayName
@@ -484,7 +484,7 @@ func dataSourceManagementVpnCommunityMeshedRead(d *schema.ResourceData, m interf
484484
if obj["name"] != nil {
485485
externalGatewayName = obj["name"].(string)
486486
}
487-
}else if val, ok := v.(string); ok {
487+
} else if val, ok := v.(string); ok {
488488
externalGatewayName = val
489489
}
490490
granularEncryptionState["external_gateway"] = externalGatewayName
@@ -511,7 +511,7 @@ func dataSourceManagementVpnCommunityMeshedRead(d *schema.ResourceData, m interf
511511
ikePhase1State["diffie_hellman_group"] = v
512512
}
513513
if v := ikePhase1Show["ike-p1-rekey-time"]; v != nil {
514-
ikePhase1State["ike_p1_rekey_time"] = v
514+
ikePhase1State["ike_p1_rekey_time"] = strconv.Itoa(int(v.(float64)))
515515
}
516516
granularEncryptionState["ike_phase_1"] = ikePhase1State
517517
}
@@ -526,20 +526,20 @@ func dataSourceManagementVpnCommunityMeshedRead(d *schema.ResourceData, m interf
526526
ikePhase2State["data_integrity"] = v
527527
}
528528
if v := ikePhase2Show["ike-p2-use-pfs"]; v != nil {
529-
ikePhase2State["ike_p2_use_pfs"] = v
529+
ikePhase2State["ike_p2_use_pfs"] = strconv.FormatBool(v.(bool))
530530
}
531531
if v := ikePhase2Show["ike-p2-pfs-dh-grp"]; v != nil {
532532
ikePhase2State["ike_p2_pfs_dh_grp"] = v
533533
}
534534
if v := ikePhase2Show["ike-p2-rekey-time"]; v != nil {
535-
ikePhase2State["ike_p2_rekey_time"] = v
535+
ikePhase2State["ike_p2_rekey_time"] = strconv.Itoa(int(v.(float64)))
536536
}
537537
granularEncryptionState["ike_phase_2"] = ikePhase2State
538538
}
539539
granularEncryptionsState = append(granularEncryptionsState, granularEncryptionState)
540540
}
541541
_ = d.Set("granular_encryptions", granularEncryptionsState)
542-
}else{
542+
} else {
543543
_ = d.Set("granular_encryptions", nil)
544544
}
545545
}

checkpoint/data_source_checkpoint_management_vpn_community_star.go

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func dataSourceManagementVpnCommunityStar() *schema.Resource {
6363
Description: "The encryption algorithm to be used.",
6464
},
6565
"ike_p1_rekey_time": {
66-
Type: schema.TypeInt,
66+
Type: schema.TypeString,
6767
Computed: true,
6868
Description: "Indicates the time interval for IKE phase 1 renegotiation.",
6969
},
@@ -87,7 +87,7 @@ func dataSourceManagementVpnCommunityStar() *schema.Resource {
8787
Description: "The encryption algorithm to be used.",
8888
},
8989
"ike_p2_use_pfs": {
90-
Type: schema.TypeBool,
90+
Type: schema.TypeString,
9191
Computed: true,
9292
Description: "Indicates whether Perfect Forward Secrecy (PFS) is being used for IKE phase 2.",
9393
},
@@ -97,7 +97,7 @@ func dataSourceManagementVpnCommunityStar() *schema.Resource {
9797
Description: "The Diffie-Hellman group to be used.",
9898
},
9999
"ike_p2_rekey_time": {
100-
Type: schema.TypeInt,
100+
Type: schema.TypeString,
101101
Computed: true,
102102
Description: "Indicates the time interval for IKE phase 2 renegotiation.",
103103
},
@@ -169,7 +169,7 @@ func dataSourceManagementVpnCommunityStar() *schema.Resource {
169169
Schema: map[string]*schema.Schema{
170170
"internal_gateway": {
171171
Type: schema.TypeString,
172-
Computed: true,
172+
Computed: true,
173173
Description: "Internally managed Check Point gateway identified by name or UID, or 'Any' for all internal-gateways participants in this community.",
174174
},
175175
"external_gateway": {
@@ -209,7 +209,7 @@ func dataSourceManagementVpnCommunityStar() *schema.Resource {
209209
Description: "The encryption algorithm to be used.",
210210
},
211211
"ike_p1_rekey_time": {
212-
Type: schema.TypeInt,
212+
Type: schema.TypeString,
213213
Computed: true,
214214
Description: "Indicates the time interval for IKE phase 1 renegotiation.",
215215
},
@@ -233,7 +233,7 @@ func dataSourceManagementVpnCommunityStar() *schema.Resource {
233233
Description: "The encryption algorithm to be used.",
234234
},
235235
"ike_p2_use_pfs": {
236-
Type: schema.TypeBool,
236+
Type: schema.TypeString,
237237
Computed: true,
238238
Description: "Indicates whether Perfect Forward Secrecy (PFS) is being used for IKE phase 2.",
239239
},
@@ -243,7 +243,7 @@ func dataSourceManagementVpnCommunityStar() *schema.Resource {
243243
Description: "The Diffie-Hellman group to be used.",
244244
},
245245
"ike_p2_rekey_time": {
246-
Type: schema.TypeInt,
246+
Type: schema.TypeString,
247247
Computed: true,
248248
Description: "Indicates the time interval for IKE phase 2 renegotiation.",
249249
},
@@ -355,7 +355,7 @@ func dataSourceManagementVpnCommunityStarRead(d *schema.ResourceData, m interfac
355355
ikePhase1MapToReturn["encryption_algorithm"] = v
356356
}
357357
if v := ikePhase1Map["ike-p1-rekey-time"]; v != nil {
358-
ikePhase1MapToReturn["ike_p1_rekey_time"] = v
358+
ikePhase1MapToReturn["ike_p1_rekey_time"] = strconv.Itoa(int(v.(float64)))
359359
}
360360
_, ikePhase1InConf := d.GetOk("ike_phase_1")
361361
defaultIkePhase1 := map[string]interface{}{"encryption_algorithm": "aes-256", "diffie_hellman_group": "group-2", "data_integrity": "sha1"}
@@ -382,13 +382,13 @@ func dataSourceManagementVpnCommunityStarRead(d *schema.ResourceData, m interfac
382382
ikePhase2MapToReturn["encryption_algorithm"] = v
383383
}
384384
if v := ikePhase2Map["ike-p2-use-pfs"]; v != nil {
385-
ikePhase2MapToReturn["ike_p2_use_pfs"] = v
385+
ikePhase2MapToReturn["ike_p2_use_pfs"] = strconv.FormatBool(v.(bool))
386386
}
387387
if v := ikePhase2Map["ike-p2-pfs-dh-grp"]; v != nil {
388388
ikePhase2MapToReturn["ike_p2_pfs_dh_grp"] = v
389389
}
390390
if v := ikePhase2Map["ike-p2-rekey-time"]; v != nil {
391-
ikePhase2MapToReturn["ike_p2_rekey_time"] = v
391+
ikePhase2MapToReturn["ike_p2_rekey_time"] = strconv.Itoa(int(v.(float64)))
392392
}
393393
_, ikePhase2InConf := d.GetOk("ike_phase_2")
394394
defaultIkePhase2 := map[string]interface{}{"encryption_algorithm": "aes-128", "data_integrity": "sha1"}
@@ -426,7 +426,7 @@ func dataSourceManagementVpnCommunityStarRead(d *schema.ResourceData, m interfac
426426
}
427427
}
428428
_ = d.Set("override_vpn_domains", overrideVpnDomainsListToReturn)
429-
}else{
429+
} else {
430430
_ = d.Set("override_vpn_domains", nil)
431431
}
432432

@@ -479,7 +479,7 @@ func dataSourceManagementVpnCommunityStarRead(d *schema.ResourceData, m interfac
479479
}
480480
}
481481
_ = d.Set("shared_secrets", sharedSecretsListToReturn)
482-
}else{
482+
} else {
483483
_ = d.Set("shared_secrets", nil)
484484
}
485485

@@ -502,7 +502,7 @@ func dataSourceManagementVpnCommunityStarRead(d *schema.ResourceData, m interfac
502502
if obj["name"] != nil {
503503
internalGatewayName = obj["name"].(string)
504504
}
505-
}else if val, ok := v.(string); ok {
505+
} else if val, ok := v.(string); ok {
506506
internalGatewayName = val
507507
}
508508
granularEncryptionState["internal_gateway"] = internalGatewayName
@@ -515,7 +515,7 @@ func dataSourceManagementVpnCommunityStarRead(d *schema.ResourceData, m interfac
515515
if obj["name"] != nil {
516516
externalGatewayName = obj["name"].(string)
517517
}
518-
}else if val, ok := v.(string); ok {
518+
} else if val, ok := v.(string); ok {
519519
externalGatewayName = val
520520
}
521521
granularEncryptionState["external_gateway"] = externalGatewayName
@@ -542,7 +542,7 @@ func dataSourceManagementVpnCommunityStarRead(d *schema.ResourceData, m interfac
542542
ikePhase1State["diffie_hellman_group"] = v
543543
}
544544
if v := ikePhase1Show["ike-p1-rekey-time"]; v != nil {
545-
ikePhase1State["ike_p1_rekey_time"] = v
545+
ikePhase1State["ike_p1_rekey_time"] = strconv.Itoa(int(v.(float64)))
546546
}
547547
granularEncryptionState["ike_phase_1"] = ikePhase1State
548548
}
@@ -557,20 +557,20 @@ func dataSourceManagementVpnCommunityStarRead(d *schema.ResourceData, m interfac
557557
ikePhase2State["data_integrity"] = v
558558
}
559559
if v := ikePhase2Show["ike-p2-use-pfs"]; v != nil {
560-
ikePhase2State["ike_p2_use_pfs"] = v
560+
ikePhase2State["ike_p2_use_pfs"] = strconv.FormatBool(v.(bool))
561561
}
562562
if v := ikePhase2Show["ike-p2-pfs-dh-grp"]; v != nil {
563563
ikePhase2State["ike_p2_pfs_dh_grp"] = v
564564
}
565565
if v := ikePhase2Show["ike-p2-rekey-time"]; v != nil {
566-
ikePhase2State["ike_p2_rekey_time"] = v
566+
ikePhase2State["ike_p2_rekey_time"] = strconv.Itoa(int(v.(float64)))
567567
}
568568
granularEncryptionState["ike_phase_2"] = ikePhase2State
569569
}
570570
granularEncryptionsState = append(granularEncryptionsState, granularEncryptionState)
571571
}
572572
_ = d.Set("granular_encryptions", granularEncryptionsState)
573-
}else{
573+
} else {
574574
_ = d.Set("granular_encryptions", nil)
575575
}
576576
}

0 commit comments

Comments
 (0)