Skip to content

Commit

Permalink
fix: Fixed issue with application segment tcp_port_range and udp_port…
Browse files Browse the repository at this point in the history
…_range (#495)
  • Loading branch information
willguibr authored Oct 1, 2024
1 parent bafcab1 commit 7210f29
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 8 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## 3.33.6 (October, 1 2024)

### Notes

- Release date: **(October, 1 2024)**
- Supported Terraform version: **v1.x**

### Bug Fixes
- [PR #495](https://github.com/zscaler/terraform-provider-zpa/pull/495) - Fixed issue with attribute `tcp_port_range` and `udp_port_range` within the resource `zpa_application_segment`

## 3.33.5 (September, 30 2024)

### Notes
Expand Down
6 changes: 3 additions & 3 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ test\:integration\:zpa:
build13: GOOS=$(shell go env GOOS)
build13: GOARCH=$(shell go env GOARCH)
ifeq ($(OS),Windows_NT) # is Windows_NT on XP, 2000, 7, Vista, 10...
build13: DESTINATION=$(APPDATA)/terraform.d/plugins/$(ZPA_PROVIDER_NAMESPACE)/3.33.5/$(GOOS)_$(GOARCH)
build13: DESTINATION=$(APPDATA)/terraform.d/plugins/$(ZPA_PROVIDER_NAMESPACE)/3.33.6/$(GOOS)_$(GOARCH)
else
build13: DESTINATION=$(HOME)/.terraform.d/plugins/$(ZPA_PROVIDER_NAMESPACE)/3.33.5/$(GOOS)_$(GOARCH)
build13: DESTINATION=$(HOME)/.terraform.d/plugins/$(ZPA_PROVIDER_NAMESPACE)/3.33.6/$(GOOS)_$(GOARCH)
endif
build13: fmtcheck
@echo "==> Installing plugin to $(DESTINATION)"
@mkdir -p $(DESTINATION)
go build -o $(DESTINATION)/terraform-provider-zpa_v3.33.5
go build -o $(DESTINATION)/terraform-provider-zpa_v3.33.6

vet:
@echo "==> Checking source code against go vet and staticcheck"
Expand Down
12 changes: 11 additions & 1 deletion docs/guides/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,20 @@ Track all ZPA Terraform provider's releases. New resources, features, and bug fi

---

``Last updated: v3.33.5``
``Last updated: v3.33.6``

---

## 3.33.6 (October, 1 2024)

### Notes

- Release date: **(October, 1 2024)**
- Supported Terraform version: **v1.x**

### Bug Fixes
- [PR #495](https://github.com/zscaler/terraform-provider-zpa/pull/495) - Fixed issue with attribute `tcp_port_range` and `udp_port_range` within the resource `zpa_application_segment`

## 3.33.5 (September, 30 2024)

### Notes
Expand Down
8 changes: 4 additions & 4 deletions zpa/resource_zpa_application_segment.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ func resourceApplicationSegment() *schema.Resource {

if bypassType, ok := d.GetOk("bypass_type"); ok && bypassType.(string) == "ALWAYS" {
tcpPortRange := d.Get("tcp_port_range").(*schema.Set).List()
tcpPortRanges := d.Get("tcp_port_ranges").([]interface{})
tcpPortRanges := d.Get("tcp_port_ranges").(*schema.Set).List()
udpPortRange := d.Get("udp_port_range").(*schema.Set).List()
udpPortRanges := d.Get("udp_port_ranges").([]interface{})
udpPortRanges := d.Get("udp_port_ranges").(*schema.Set).List()

if len(tcpPortRange) > 0 || len(tcpPortRanges) > 0 || len(udpPortRange) > 0 || len(udpPortRanges) > 0 {
return fmt.Errorf("TCP and UDP port configuration must be disabled as bypass_type is set to ALWAYS. In order to add ports, please change the bypass_type to NEVER or ON_NET")
Expand Down Expand Up @@ -125,15 +125,15 @@ func resourceApplicationSegment() *schema.Resource {
"tcp_port_range": resourceAppSegmentPortRange("tcp port range"),
"udp_port_range": resourceAppSegmentPortRange("udp port range"),
"tcp_port_ranges": {
Type: schema.TypeList,
Type: schema.TypeSet,
Optional: true,
Computed: true,
Description: "TCP port ranges used to access the app.",
Elem: &schema.Schema{Type: schema.TypeString},
},

"udp_port_ranges": {
Type: schema.TypeList,
Type: schema.TypeSet,
Optional: true,
Computed: true,
Description: "UDP port ranges used to access the app.",
Expand Down

0 comments on commit 7210f29

Please sign in to comment.