Skip to content

Commit

Permalink
Fix: Fixed Loop Conditions during Resource import zpa_inspection_cust…
Browse files Browse the repository at this point in the history
…om_controls (#232)
  • Loading branch information
willguibr authored Nov 5, 2024
1 parent 96ee408 commit 018e783
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 10 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 1.3.4 (November, 4 2024)

### Notes

- Release date: **(November, 4 2024)**
- Supported Terraform version: **v1.x.x**

### Bug Fixes
- [PR #232](https://github.com/zscaler/zscaler-terraformer/pull/232). Fixed loop condition during resource import `zpa_inspection_custom_controls`

### Internal Changes
- [PR #232](https://github.com/zscaler/zscaler-terraformer/pull/232). Upgraded to [Zscaler-SDK-GO v2.732.0](https://github.com/zscaler/zscaler-sdk-go/releases/tag/v2.732.0)

## 1.3.3 (September, 26 2024)

### Notes
Expand Down
8 changes: 4 additions & 4 deletions cmd/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ import (
"github.com/zscaler/zscaler-sdk-go/v2/zia/services/user_authentication_settings"
"github.com/zscaler/zscaler-sdk-go/v2/zpa/services/appconnectorgroup"
"github.com/zscaler/zscaler-sdk-go/v2/zpa/services/applicationsegment"
"github.com/zscaler/zscaler-sdk-go/v2/zpa/services/applicationsegmentbrowseraccess"
"github.com/zscaler/zscaler-sdk-go/v2/zpa/services/applicationsegmentinspection"
"github.com/zscaler/zscaler-sdk-go/v2/zpa/services/applicationsegmentpra"
"github.com/zscaler/zscaler-sdk-go/v2/zpa/services/appservercontroller"
"github.com/zscaler/zscaler-sdk-go/v2/zpa/services/browseraccess"
"github.com/zscaler/zscaler-sdk-go/v2/zpa/services/cloudbrowserisolation/cbibannercontroller"
"github.com/zscaler/zscaler-sdk-go/v2/zpa/services/cloudbrowserisolation/cbicertificatecontroller"
"github.com/zscaler/zscaler-sdk-go/v2/zpa/services/cloudbrowserisolation/cbiprofilecontroller"
Expand Down Expand Up @@ -466,7 +466,7 @@ func generate(cmd *cobra.Command, writer io.Writer, resourceType string) {
log.Fatal("ZPA client is not initialized")
}
zpaClient := api.ZPA.BrowserAccess
jsonPayload, _, err := browseraccess.GetAll(zpaClient)
jsonPayload, _, err := applicationsegmentbrowseraccess.GetAll(zpaClient)
if err != nil {
log.Fatal(err)
}
Expand Down Expand Up @@ -1381,14 +1381,14 @@ func generate(cmd *cobra.Command, writer io.Writer, resourceType string) {
output += " rules {\n"
for key, value := range rule {
if key == "conditions" {
output += " conditions {\n"
for _, condition := range value.([]interface{}) {
output += " conditions {\n"
conditionMap := condition.(map[string]interface{})
for condKey, condValue := range conditionMap {
output += nesting.WriteAttrLine(condKey, condValue, false)
}
output += " }\n" // Close each individual conditions block
}
output += " }\n"
} else {
output += nesting.WriteAttrLine(key, value, false)
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ import (
"github.com/zscaler/zscaler-sdk-go/v2/zia/services/user_authentication_settings"
"github.com/zscaler/zscaler-sdk-go/v2/zpa/services/appconnectorgroup"
"github.com/zscaler/zscaler-sdk-go/v2/zpa/services/applicationsegment"
"github.com/zscaler/zscaler-sdk-go/v2/zpa/services/applicationsegmentbrowseraccess"
"github.com/zscaler/zscaler-sdk-go/v2/zpa/services/applicationsegmentinspection"
"github.com/zscaler/zscaler-sdk-go/v2/zpa/services/applicationsegmentpra"
"github.com/zscaler/zscaler-sdk-go/v2/zpa/services/appservercontroller"
"github.com/zscaler/zscaler-sdk-go/v2/zpa/services/browseraccess"
"github.com/zscaler/zscaler-sdk-go/v2/zpa/services/cloudbrowserisolation/cbibannercontroller"
"github.com/zscaler/zscaler-sdk-go/v2/zpa/services/cloudbrowserisolation/cbicertificatecontroller"
"github.com/zscaler/zscaler-sdk-go/v2/zpa/services/cloudbrowserisolation/cbiprofilecontroller"
Expand Down Expand Up @@ -279,7 +279,7 @@ func importResource(cmd *cobra.Command, writer io.Writer, resourceType string, m
log.Fatal("ZPA client is not initialized")
}
zpaClient := api.ZPA.BrowserAccess
jsonPayload, _, err := browseraccess.GetAll(zpaClient)
jsonPayload, _, err := applicationsegmentbrowseraccess.GetAll(zpaClient)
if err != nil {
log.Fatal(err)
}
Expand Down
15 changes: 14 additions & 1 deletion docs/guides/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,23 @@ Track all Zscaler Terraformer Tool releases. New resources, features, and bug fi

---

``Last updated: v1.3.3``
``Last updated: v1.3.4``

---

## 1.3.4 (November, 4 2024)

### Notes

- Release date: **(November, 4 2024)**
- Supported Terraform version: **v1.x.x**

### Bug Fixes
- [PR #232](https://github.com/zscaler/zscaler-terraformer/pull/232). Fixed loop condition during resource import `zpa_inspection_custom_controls`

### Internal Changes
- [PR #232](https://github.com/zscaler/zscaler-terraformer/pull/232). Upgraded to [Zscaler-SDK-GO v2.732.0](https://github.com/zscaler/zscaler-sdk-go/releases/tag/v2.732.0)

## 1.3.3 (September, 26 2024)

### Notes
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
github.com/spf13/cobra v1.8.1
github.com/spf13/viper v1.19.0
github.com/zclconf/go-cty v1.15.0
github.com/zscaler/zscaler-sdk-go/v2 v2.72.5
github.com/zscaler/zscaler-sdk-go/v2 v2.732.0
)

require (
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM
github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw=
github.com/zclconf/go-cty v1.15.0 h1:tTCRWxsexYUmtt/wVxgDClUe+uQusuI443uL6e+5sXQ=
github.com/zclconf/go-cty v1.15.0/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE=
github.com/zscaler/zscaler-sdk-go/v2 v2.72.5 h1:IL9eFbcvDEoS6x17ipy/kThgubdiknIeXtA37hn7SQY=
github.com/zscaler/zscaler-sdk-go/v2 v2.72.5/go.mod h1:ugDudbyESUrANGw74moJypgVnWuOyLm8NyIJgfUzNNo=
github.com/zscaler/zscaler-sdk-go/v2 v2.732.0 h1:oyESzPJJswG9dTSH0VcCeZH1ebYUmhIOKeTQg0sLu+w=
github.com/zscaler/zscaler-sdk-go/v2 v2.732.0/go.mod h1:ugDudbyESUrANGw74moJypgVnWuOyLm8NyIJgfUzNNo=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
Expand Down

0 comments on commit 018e783

Please sign in to comment.