Skip to content

Commit 88dad7c

Browse files
authored
fix: Fixed App Connector Group lss_app_connector_group (#590)
1 parent a42c61a commit 88dad7c

File tree

6 files changed

+43
-22
lines changed

6 files changed

+43
-22
lines changed

CHANGELOG.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@
44

55
### Notes
66

7-
- Release date: **(August, 222025)**
7+
- Release date: **(August, 2025)**
88
- Supported Terraform version: **v1.x**
99

1010
### NEW - RESOURCES AND DATA SOURCES
1111

1212
The following new resources have been introduced:
1313

14-
- [PR #588](https://github.com/zscaler/terraform-provider-zia/pull/588) - Added and resource``zpa_c2c_ip_ranges`` - Added C2C IP Ranges
15-
- [PR #588](https://github.com/zscaler/terraform-provider-zia/pull/588) - Added and resource``zpa_private_cloud_group`` - Added Private Cloud Group
16-
- [PR #588](https://github.com/zscaler/terraform-provider-zia/pull/588) - Added and resource``zpa_user_portal_controller`` - Added User Portal Controller
17-
- [PR #588](https://github.com/zscaler/terraform-provider-zia/pull/588) - Added and resource``zpa_user_portal_link`` - Added User Portal Link
14+
- [PR #588](https://github.com/zscaler/terraform-provider-zpa/pull/588) - Added and resource``zpa_c2c_ip_ranges`` - Added C2C IP Ranges
15+
- [PR #588](https://github.com/zscaler/terraform-provider-zpa/pull/588) - Added and resource``zpa_private_cloud_group`` - Added Private Cloud Group
16+
- [PR #588](https://github.com/zscaler/terraform-provider-zpa/pull/588) - Added and resource``zpa_user_portal_controller`` - Added User Portal Controller
17+
- [PR #588](https://github.com/zscaler/terraform-provider-zpa/pull/588) - Added and resource``zpa_user_portal_link`` - Added User Portal Link
1818

1919
### NEW - DATA SOURCES
2020

2121
The following new data sources have been introduced:
2222

23-
- [PR #452](https://github.com/zscaler/terraform-provider-zia/pull/452) - Added and datasource``zpa_private_cloud_controller`` - Retrieves private cloud controller.
23+
- [PR #452](https://github.com/zscaler/terraform-provider-zpa/pull/452) - Added and datasource``zpa_private_cloud_controller`` - Retrieves private cloud controller.
2424

2525
## 4.1.14 (July, 14 2025)
2626

GNUmakefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ test\:integration\:zpa:
5555
build13: GOOS=$(shell go env GOOS)
5656
build13: GOARCH=$(shell go env GOARCH)
5757
ifeq ($(OS),Windows_NT) # is Windows_NT on XP, 2000, 7, Vista, 10...
58-
build13: DESTINATION=$(APPDATA)/terraform.d/plugins/$(ZPA_PROVIDER_NAMESPACE)/4.2.0/$(GOOS)_$(GOARCH)
58+
build13: DESTINATION=$(APPDATA)/terraform.d/plugins/$(ZPA_PROVIDER_NAMESPACE)/4.2.1/$(GOOS)_$(GOARCH)
5959
else
60-
build13: DESTINATION=$(HOME)/.terraform.d/plugins/$(ZPA_PROVIDER_NAMESPACE)/4.2.0/$(GOOS)_$(GOARCH)
60+
build13: DESTINATION=$(HOME)/.terraform.d/plugins/$(ZPA_PROVIDER_NAMESPACE)/4.2.1/$(GOOS)_$(GOARCH)
6161
endif
6262
build13: fmtcheck
6363
@echo "==> Installing plugin to $(DESTINATION)"
6464
@mkdir -p $(DESTINATION)
65-
go build -o $(DESTINATION)/terraform-provider-zpa_v4.2.0
65+
go build -o $(DESTINATION)/terraform-provider-zpa_v4.2.1
6666

6767
vet:
6868
@echo "==> Checking source code against go vet and staticcheck"

docs/guides/release-notes.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,20 @@ Track all ZPA Terraform provider's releases. New resources, features, and bug fi
1212

1313
---
1414

15-
``Last updated: v4.2.0``
15+
``Last updated: v4.2.1``
1616

1717
---
1818

19+
## 4.2.1 (September, 5 2025)
20+
21+
### Notes
22+
23+
- Release date: **(September, 5 2025)**
24+
- Supported Terraform version: **v1.x**
25+
26+
### Bug Fixes
27+
[PR #590](https://github.com/zscaler/terraform-provider-zpa/pull/590) - Fixed `zpa_app_connector_group` resource attribute `lss_app_connector_group` due to API issues.
28+
1929
## 4.2.0 (August, 22 2025)
2030

2131
### Notes

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
github.com/hashicorp/terraform-plugin-docs v0.21.0
1212
github.com/hashicorp/terraform-plugin-sdk v1.17.2
1313
github.com/hashicorp/terraform-plugin-sdk/v2 v2.37.0
14-
github.com/zscaler/zscaler-sdk-go/v3 v3.6.1
14+
github.com/zscaler/zscaler-sdk-go/v3 v3.6.4
1515
)
1616

1717
require (

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,8 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5
410410
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
411411
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
412412
github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=
413-
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
414-
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
413+
github.com/stretchr/testify v1.11.0 h1:ib4sjIrwZKxE5u/Japgo/7SJV3PvgjGiRNAvTVGqQl8=
414+
github.com/stretchr/testify v1.11.0/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
415415
github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
416416
github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
417417
github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI=
@@ -445,8 +445,8 @@ github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRK
445445
github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940 h1:4r45xpDWB6ZMSMNJFMOjqrGHynW3DIBuR2H9j0ug+Mo=
446446
github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940/go.mod h1:CmBdvvj3nqzfzJ6nTCIwDTPZ56aVGvDrmztiO5g3qrM=
447447
github.com/zclconf/go-cty-yaml v1.0.2/go.mod h1:IP3Ylp0wQpYm50IHK8OZWKMu6sPJIUgKa8XhiVHura0=
448-
github.com/zscaler/zscaler-sdk-go/v3 v3.6.1 h1:7xSBe0n9Ibk5nLTPZxfVg2wiXfzD1VRWq+2Rd2CjQHc=
449-
github.com/zscaler/zscaler-sdk-go/v3 v3.6.1/go.mod h1:8WW/Mj/gT57JqmsmxXaJwm/p0FMqeD76Z374oiw5z54=
448+
github.com/zscaler/zscaler-sdk-go/v3 v3.6.4 h1:i0XKbeDtDrMcaSw86j3ouE1xt4bepRrXRXiCfVNh4CU=
449+
github.com/zscaler/zscaler-sdk-go/v3 v3.6.4/go.mod h1:q6Zma3E3la4VD3DrMz8mUMeTI/OFMJ63GGxcYMVrMNE=
450450
go.abhg.dev/goldmark/frontmatter v0.2.0 h1:P8kPG0YkL12+aYk2yU3xHv4tcXzeVnN+gU0tJ5JnxRw=
451451
go.abhg.dev/goldmark/frontmatter v0.2.0/go.mod h1:XqrEkZuM57djk7zrlRUB02x8I5J0px76YjkOzhB4YlU=
452452
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=

zpa/resource_zpa_app_connector_group.go

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ func resourceAppConnectorGroup() *schema.Resource {
114114
"lss_app_connector_group": {
115115
Type: schema.TypeBool,
116116
Optional: true,
117-
Computed: true,
118117
Description: "Whether or not the App Connector Group is configured for the Log Streaming Service (LSS)",
119118
},
120119
"tcp_quick_ack_app": {
@@ -237,16 +236,28 @@ func resourceAppConnectorGroupRead(ctx context.Context, d *schema.ResourceData,
237236
service = service.WithMicroTenant(microTenantID)
238237
}
239238

240-
resp, _, err := appconnectorgroup.Get(ctx, service, d.Id())
239+
// Use GetAll to get the complete list and find the resource by ID
240+
// This avoids the individual Get API call which returns incorrect lssAppConnectorGroup values
241+
list, _, err := appconnectorgroup.GetAll(ctx, service)
241242
if err != nil {
242-
if errResp, ok := err.(*errorx.ErrorResponse); ok && errResp.IsObjectNotFound() {
243-
log.Printf("[WARN] Removing app connector group %s from state because it no longer exists in ZPA", d.Id())
244-
d.SetId("")
245-
return nil
246-
}
247243
return diag.FromErr(err)
248244
}
249245

246+
// Find the specific resource by ID in the list
247+
var resp *appconnectorgroup.AppConnectorGroup
248+
for _, item := range list {
249+
if item.ID == d.Id() {
250+
resp = &item
251+
break
252+
}
253+
}
254+
255+
if resp == nil {
256+
log.Printf("[WARN] Removing app connector group %s from state because it no longer exists in ZPA", d.Id())
257+
d.SetId("")
258+
return nil
259+
}
260+
250261
log.Printf("[INFO] Getting app connector group:\n%+v\n", resp)
251262
_ = d.Set("name", resp.Name)
252263
_ = d.Set("city_country", resp.CityCountry)

0 commit comments

Comments
 (0)