Skip to content

Commit 6d3dc29

Browse files
committed
init/updateFortiSwitchTerraform: 1.1.6
Signed-off-by: FTNT-HQCM <hq-devops-admin@fortinet.com>
1 parent cfab917 commit 6d3dc29

26 files changed

Lines changed: 615 additions & 102 deletions

.go-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.21.1
1+
1.25.0

.goreleaser.yml

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,35 @@ before:
66
- go mod tidy
77
project_name: terraform-provider-fortiswitch
88
builds:
9-
- env:
10-
# goreleaser does not work with CGO, it could also complicate
11-
# usage by users in CI/CD systems like Terraform Cloud where
12-
# they are unable to install libraries.
13-
- CGO_ENABLED=0
14-
mod_timestamp: '{{ .CommitTimestamp }}'
15-
flags:
16-
- -trimpath
17-
ldflags:
18-
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}'
19-
goos:
20-
- freebsd
21-
- windows
22-
- linux
23-
- darwin
24-
goarch:
25-
- amd64
26-
- '386'
27-
- arm
28-
- arm64
29-
ignore:
30-
- goos: darwin
31-
goarch: '386'
32-
binary: '{{ .ProjectName }}_v{{ .Version }}'
9+
- env:
10+
# goreleaser does not work with CGO, it could also complicate
11+
# usage by users in CI/CD systems like Terraform Cloud where
12+
# they are unable to install libraries.
13+
- CGO_ENABLED=0
14+
mod_timestamp: "{{ .CommitTimestamp }}"
15+
flags:
16+
- -trimpath
17+
ldflags:
18+
- "-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}"
19+
goos:
20+
- freebsd
21+
- windows
22+
- linux
23+
- darwin
24+
goarch:
25+
- amd64
26+
- "386"
27+
- arm
28+
- arm64
29+
ignore:
30+
- goos: darwin
31+
goarch: "386"
32+
binary: "{{ .ProjectName }}_v{{ .Version }}"
3333
archives:
34-
- format: zip
35-
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
34+
- format: zip
35+
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
3636
checksum:
37-
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
37+
name_template: "{{ .ProjectName }}_{{ .Version }}_SHA256SUMS"
3838
algorithm: sha256
3939
signs:
4040
- artifacts: checksum
@@ -52,4 +52,4 @@ release:
5252
# Visit your project's GitHub Releases page to publish this release.
5353
draft: true
5454
changelog:
55-
skip: true
55+
disable: true

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
## 1.1.6 (Unreleased)
1+
## 1.1.7 (Unreleased)
2+
3+
## 1.1.6 (Sep 10, 2025)
4+
5+
IMPROVEMENTS:
6+
7+
* Support new version 7.6.3 and 7.6.4.
8+
* Upgrade the Go version and all associated dependencies.
29

310
## 1.1.5 (June 20, 2025)
411

fortiswitch/data_source_router_accesslist.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func dataSourceRouterAccessListRead(d *schema.ResourceData, m interface{}) error
9090

9191
if o == nil {
9292
d.SetId("")
93-
return fmt.Errorf("Error describing RouterAccessList: resource not found")
93+
return nil
9494
}
9595

9696
err = dataSourceRefreshObjectRouterAccessList(d, o)

fortiswitch/data_source_router_accesslist6.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func dataSourceRouterAccessList6Read(d *schema.ResourceData, m interface{}) erro
8686

8787
if o == nil {
8888
d.SetId("")
89-
return fmt.Errorf("Error describing RouterAccessList6: resource not found")
89+
return nil
9090
}
9191

9292
err = dataSourceRefreshObjectRouterAccessList6(d, o)

fortiswitch/data_source_system_global.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,10 @@ func dataSourceSystemGlobal() *schema.Resource {
260260
Type: schema.TypeInt,
261261
Computed: true,
262262
},
263+
"radsec_coa_port": &schema.Schema{
264+
Type: schema.TypeInt,
265+
Computed: true,
266+
},
263267
"dst": &schema.Schema{
264268
Type: schema.TypeString,
265269
Computed: true,
@@ -578,6 +582,10 @@ func dataSourceFlattenSystemGlobalRadiusCoaPort(v interface{}, d *schema.Resourc
578582
return v
579583
}
580584

585+
func dataSourceFlattenSystemGlobalRadsecCoaPort(v interface{}, d *schema.ResourceData, pre string) interface{} {
586+
return v
587+
}
588+
581589
func dataSourceFlattenSystemGlobalDst(v interface{}, d *schema.ResourceData, pre string) interface{} {
582590
return v
583591
}
@@ -987,6 +995,12 @@ func dataSourceRefreshObjectSystemGlobal(d *schema.ResourceData, o map[string]in
987995
}
988996
}
989997

998+
if err = d.Set("radsec_coa_port", dataSourceFlattenSystemGlobalRadsecCoaPort(o["radsec-coa-port"], d, "radsec_coa_port")); err != nil {
999+
if !fortiAPIPatch(o["radsec-coa-port"]) {
1000+
return fmt.Errorf("Error reading radsec_coa_port: %v", err)
1001+
}
1002+
}
1003+
9901004
if err = d.Set("dst", dataSourceFlattenSystemGlobalDst(o["dst"], d, "dst")); err != nil {
9911005
if !fortiAPIPatch(o["dst"]) {
9921006
return fmt.Errorf("Error reading dst: %v", err)

fortiswitch/resource_router_isis.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2231,7 +2231,7 @@ func expandRouterIsisLogNeighbourChanges(d *schema.ResourceData, v interface{},
22312231
func getObjectRouterIsis(d *schema.ResourceData, setArgNil bool, sv string) (*map[string]interface{}, error) {
22322232
obj := make(map[string]interface{})
22332233

2234-
if v, ok := d.GetOk("default_information_metric6"); ok {
2234+
if v, ok := d.GetOkExists("default_information_metric6"); ok {
22352235
if setArgNil {
22362236
obj["default-information-metric6"] = nil
22372237
} else {
@@ -2539,7 +2539,7 @@ func getObjectRouterIsis(d *schema.ResourceData, setArgNil bool, sv string) (*ma
25392539
}
25402540
}
25412541

2542-
if v, ok := d.GetOk("default_information_metric"); ok {
2542+
if v, ok := d.GetOkExists("default_information_metric"); ok {
25432543
if setArgNil {
25442544
obj["default-information-metric"] = nil
25452545
} else {

fortiswitch/resource_router_policy.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121

2222
func resourceRouterPolicy() *schema.Resource {
2323
return &schema.Resource{
24-
Create: resourceRouterPolicyUpdate,
24+
Create: resourceRouterPolicyCreate,
2525
Read: resourceRouterPolicyRead,
2626
Update: resourceRouterPolicyUpdate,
2727
Delete: resourceRouterPolicyDelete,
@@ -266,7 +266,7 @@ func resourceRouterPolicyUpdate(d *schema.ResourceData, m interface{}) error {
266266

267267
log.Printf(strconv.Itoa(c.Retries))
268268
if o["mkey"] != nil && o["mkey"] != "" {
269-
d.SetId(o["mkey"].(string))
269+
d.SetId(strconv.Itoa(int(o["mkey"].(float64))))
270270
} else {
271271
d.SetId("RouterPolicy")
272272
}

fortiswitch/resource_switchacl_egress.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,12 @@ func resourceSwitchAclEgress() *schema.Resource {
166166
Optional: true,
167167
Computed: true,
168168
},
169+
"remark_cos": &schema.Schema{
170+
Type: schema.TypeInt,
171+
ValidateFunc: validation.IntBetween(0, 7),
172+
Optional: true,
173+
Computed: true,
174+
},
169175
},
170176
},
171177
},
@@ -514,6 +520,12 @@ func flattenSwitchAclEgressAction(v interface{}, d *schema.ResourceData, pre str
514520
result["outer_vlan_tag"] = flattenSwitchAclEgressActionOuterVlanTag(i["outer-vlan-tag"], d, pre_append, sv)
515521
}
516522

523+
pre_append = pre + ".0." + "remark_cos"
524+
if _, ok := i["remark-cos"]; ok {
525+
526+
result["remark_cos"] = flattenSwitchAclEgressActionRemarkCos(i["remark-cos"], d, pre_append, sv)
527+
}
528+
517529
lastresult := []map[string]interface{}{result}
518530
return lastresult
519531
}
@@ -553,6 +565,13 @@ func flattenSwitchAclEgressActionOuterVlanTag(v interface{}, d *schema.ResourceD
553565
return v
554566
}
555567

568+
func flattenSwitchAclEgressActionRemarkCos(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} {
569+
if v == "" || v == "none" || reflect.DeepEqual(v, []interface{}{}) {
570+
return nil
571+
}
572+
return v
573+
}
574+
556575
func flattenSwitchAclEgressInterface(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} {
557576
return v
558577
}
@@ -840,6 +859,11 @@ func expandSwitchAclEgressAction(d *schema.ResourceData, v interface{}, pre stri
840859

841860
result["outer-vlan-tag"], _ = expandSwitchAclEgressActionOuterVlanTag(d, i["outer_vlan_tag"], pre_append, sv)
842861
}
862+
pre_append = pre + ".0." + "remark_cos"
863+
if _, ok := d.GetOk(pre_append); ok {
864+
865+
result["remark-cos"], _ = expandSwitchAclEgressActionRemarkCos(d, i["remark_cos"], pre_append, sv)
866+
}
843867

844868
return result, nil
845869
}
@@ -876,6 +900,10 @@ func expandSwitchAclEgressActionOuterVlanTag(d *schema.ResourceData, v interface
876900
return v, nil
877901
}
878902

903+
func expandSwitchAclEgressActionRemarkCos(d *schema.ResourceData, v interface{}, pre string, sv string) (interface{}, error) {
904+
return v, nil
905+
}
906+
879907
func expandSwitchAclEgressInterface(d *schema.ResourceData, v interface{}, pre string, sv string) (interface{}, error) {
880908
return v, nil
881909
}

fortiswitch/resource_system_automationaction.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ func resourceSystemAutomationAction() *schema.Resource {
3535
Type: schema.TypeString,
3636
ValidateFunc: validation.StringLenBetween(0, 123),
3737
Optional: true,
38-
Sensitive: true,
3938
},
4039
"alicloud_account_id": &schema.Schema{
4140
Type: schema.TypeString,
@@ -84,7 +83,6 @@ func resourceSystemAutomationAction() *schema.Resource {
8483
Type: schema.TypeString,
8584
ValidateFunc: validation.StringLenBetween(0, 123),
8685
Optional: true,
87-
Sensitive: true,
8886
},
8987
"port": &schema.Schema{
9088
Type: schema.TypeInt,
@@ -216,7 +214,6 @@ func resourceSystemAutomationAction() *schema.Resource {
216214
Type: schema.TypeString,
217215
ValidateFunc: validation.StringLenBetween(0, 59),
218216
Optional: true,
219-
Sensitive: true,
220217
},
221218
"name": &schema.Schema{
222219
Type: schema.TypeString,

0 commit comments

Comments
 (0)