Skip to content

Commit

Permalink
Fix: Added Validation for zia_forwarding_control_rule (#366)
Browse files Browse the repository at this point in the history
* Fix: Added Validation for zia_forwarding_control_rule

* gh: Disabled ZIA_ZS2 and ZIA_ZS3 workflows

* fix: Added new functionality paramenters to datasource zia_traffic_forwarding_gre_vip_recommended_list

* Fix: Fixed Web DLP Rule test
  • Loading branch information
willguibr authored Aug 19, 2024
1 parent bfd3076 commit 986dbb2
Show file tree
Hide file tree
Showing 16 changed files with 315 additions and 156 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/zia-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ jobs:
environment:
# - ZIA_ZSCLOUD
- ZIA_ZS0
- ZIA_ZS1
- ZIA_ZS2
- ZIA_ZS3
# - ZIA_ZS1
# - ZIA_ZS2
# - ZIA_ZS3
environment: ${{ matrix.environment }}
steps:
- name: Checkout code
Expand Down
53 changes: 37 additions & 16 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

## 3.0.2 (August, xx 2024)

### Notes

- Release date: **(August, xx 2024)**
- Supported Terraform version: **v1.x**

### Bug Fixes

- [PR #366](https://github.com/zscaler/terraform-provider-zia/pull/366) - Implemented runtime validation for resource: `zia_forwarding_control_rule`. The provider now validates incompatible attributes during the plan and apply stages at the schema level.
- [PR #366](https://github.com/zscaler/terraform-provider-zia/pull/366) - Fixed the datasource `zia_traffic_forwarding_gre_vip_recommended_list` to allow Geo location information override when needed. The datasource now supports the following optional attributes:
- `routable_ip` - (Boolean) The routable IP address.
- `within_country_only` - (Boolean) Search within country only.
- `include_private_service_edge` - (Boolean) Include ZIA Private Service Edge VIPs.
- `include_current_vips` - (Boolean) Include currently assigned VIPs.
- `latitude` - (Number) The latitude coordinate of the GRE tunnel source.
- `longitude` - (Number) The longitude coordinate of the GRE tunnel source.
- `subcloud` - (String) The longitude coordinate of the GRE tunnel source.

- [PR #366](https://github.com/zscaler/terraform-provider-zia/pull/366) - Added centralized semaphore functionality to manipulate concurrent request limitations.

## 3.0.1 (August, 13 2024)

### Notes
Expand All @@ -9,11 +30,11 @@

### Bug Fixes

- [PR #365](https://github.com/zscaler/terraform-provider-zia/365) - Fixed `ports` attribute in `zia_location_management` resource to support `TypeSet` with elements of `TypeInt`.
- [PR #365](https://github.com/zscaler/terraform-provider-zia/pull/365) - Fixed `ports` attribute in `zia_location_management` resource to support `TypeSet` with elements of `TypeInt`.

### Documentation

- [PR #365](https://github.com/zscaler/terraform-provider-zia/365) - Updated documentation for resources: `zia_location_management` and `zia_cloud_app_control_rule`
- [PR #365](https://github.com/zscaler/terraform-provider-zia/pull/365) - Updated documentation for resources: `zia_location_management` and `zia_cloud_app_control_rule`

## 3.0.0 (August, 12 2024)

Expand All @@ -24,15 +45,15 @@

### Enhancements

- [PR #361](https://github.com/zscaler/terraform-provider-zia/361) - Added new resource and datasource `zia_cloud_app_control_rule` for Cloud Application Control rule management.
- [PR #361](https://github.com/zscaler/terraform-provider-zia/361) - Added new datasource `zia_dlp_dictionary_predefined_identifiers` to retrieve DLP Dictionary Hierarchical Identifiers. The information can be used when configuring DLP Dictionary resource attribute `hierarchical_identifiers` to clone predefined dictionaries.
- [PR #361](https://github.com/zscaler/terraform-provider-zia/361) - Added new attribute `hierarchical_identifiers` to `zia_dlp_dictionaries` resource.
- [PR #361](https://github.com/zscaler/terraform-provider-zia/361) - Enhanced `zia_security_settings` to support maximum number of blacklist urls.
- [PR #361](https://github.com/zscaler/terraform-provider-zia/pull/361) - Added new resource and datasource `zia_cloud_app_control_rule` for Cloud Application Control rule management.
- [PR #361](https://github.com/zscaler/terraform-provider-zia/pull/361) - Added new datasource `zia_dlp_dictionary_predefined_identifiers` to retrieve DLP Dictionary Hierarchical Identifiers. The information can be used when configuring DLP Dictionary resource attribute `hierarchical_identifiers` to clone predefined dictionaries.
- [PR #361](https://github.com/zscaler/terraform-provider-zia/pull/361) - Added new attribute `hierarchical_identifiers` to `zia_dlp_dictionaries` resource.
- [PR #361](https://github.com/zscaler/terraform-provider-zia/pull/361) - Enhanced `zia_security_settings` to support maximum number of blacklist urls.

### Bug Fixes

- [PR #361](https://github.com/zscaler/terraform-provider-zia/361) - Added Semaphore retry logic to resource ``zia_url_categories`` to assist with rate limiting management.
- [PR #361](https://github.com/zscaler/terraform-provider-zia/361) - Fixed `ports` attribute in `zia_location_management` resource to support `TypeList`.
- [PR #361](https://github.com/zscaler/terraform-provider-zia/pull/361) - Added Semaphore retry logic to resource ``zia_url_categories`` to assist with rate limiting management.
- [PR #361](https://github.com/zscaler/terraform-provider-zia/pull/361) - Fixed `ports` attribute in `zia_location_management` resource to support `TypeList`.

## 2.91.4 (July, 3 2024)

Expand All @@ -43,7 +64,7 @@

### Bug Fixes

- [PR #357](https://github.com/zscaler/terraform-provider-zia/357) - Fixed ``zia_url_filtering_rules`` drift due to attribute conversion ``validatidy_start_time`` and ``validity_end_time``.
- [PR #357](https://github.com/zscaler/terraform-provider-zia/pull/357) - Fixed ``zia_url_filtering_rules`` drift due to attribute conversion ``validatidy_start_time`` and ``validity_end_time``.

## 2.91.3 (July, 2 2024)

Expand All @@ -54,8 +75,8 @@

### Bug Fix

- [PR #356](https://github.com/zscaler/terraform-provider-zia/356) - Fixed ``zia_url_filtering_rules`` schema validation to ensure proper validation during plan and apply stages.
- [PR #356](https://github.com/zscaler/terraform-provider-zia/356) - Fixed ``zia_location_management`` drift due to missing `state` attribute in the READ function.
- [PR #356](https://github.com/zscaler/terraform-provider-zia/pull/356) - Fixed ``zia_url_filtering_rules`` schema validation to ensure proper validation during plan and apply stages.
- [PR #356](https://github.com/zscaler/terraform-provider-zia/pull/356) - Fixed ``zia_location_management`` drift due to missing `state` attribute in the READ function.

## 2.91.2 (July, 2 2024)

Expand All @@ -66,7 +87,7 @@

### Bug Fix

- [PR #356](https://github.com/zscaler/terraform-provider-zia/356) - Fixed ``zia_url_filtering_rules`` schema validation to ensure proper validation during plan and apply stages.
- [PR #356](https://github.com/zscaler/terraform-provider-zia/pull/356) - Fixed ``zia_url_filtering_rules`` schema validation to ensure proper validation during plan and apply stages.

## 2.91.1 (June, 29 2024)

Expand All @@ -77,8 +98,8 @@

### Bug Fix

- [PR #354](https://github.com/zscaler/terraform-provider-zia/354) - Fixed go.mod and go.sum
- [PR #354](https://github.com/zscaler/terraform-provider-zia/354) - Fixed computed attributes in the schema
- [PR #354](https://github.com/zscaler/terraform-provider-zia/pull/354) - Fixed go.mod and go.sum
- [PR #354](https://github.com/zscaler/terraform-provider-zia/pull/354) - Fixed computed attributes in the schema

## 2.91.0 (June, 19 2024)

Expand All @@ -89,7 +110,7 @@

### BREAKING CHANGES and ENHACEMENTS

- [PR #350](https://github.com/zscaler/terraform-provider-zia/350)
- [PR #350](https://github.com/zscaler/terraform-provider-zia/pull/350)
- `zia_url_filtering_rules` - The provider now explicitly validates during the plan and apply stages which attributes can be set based on the `action` value.
- `zia_url_filtering_rules` - The provider now allows for the use of `RFC1123` date and time format i.e `Sun, 16 Jun 2024 15:04:05 UTC` when setting the attributes `validity_start_time` and `validity_end_time` instead of the native epoch unix format.

Expand All @@ -104,7 +125,7 @@

### Internal Changes

- [PR #350](https://github.com/zscaler/terraform-provider-zia/350) - Upgraded to [Zscaler-SDK-GO](https://github.com/zscaler/zscaler-sdk-go/releases/tag/v2.61.0). The upgrade supports easier ZIA API Client instantiation for existing and new resources.
- [PR #350](https://github.com/zscaler/terraform-provider-zia/pull/350) - Upgraded to [Zscaler-SDK-GO](https://github.com/zscaler/zscaler-sdk-go/releases/tag/v2.61.0). The upgrade supports easier ZIA API Client instantiation for existing and new resources.
- [PR #350](https://github.com/zscaler/terraform-provider-zpa/pull/350) Upgraded ``releaser.yml`` to [GoReleaser v6](https://github.com/goreleaser/goreleaser-action/releases/tag/v6.0.0)

## 2.9.0 (May, 22 2024) - BREAKING CHANGE
Expand Down
14 changes: 7 additions & 7 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ sweep:

test:
echo $(TEST) | \
xargs -t -n4 go test $(TESTARGS) $(TEST_FILTER) -timeout=30s -parallel=1
xargs -t -n4 go test $(TESTARGS) $(TEST_FILTER) -timeout=30s -parallel=5

testacc:
TF_ACC=1 go test $(TEST) $(TESTARGS) $(TEST_FILTER) -timeout 120m

test\:integration\:zia:
@echo "$(COLOR_ZSCALER)Running zia integration tests...$(COLOR_NONE)"
@TF_ACC=1 go test -v -race -cover -coverprofile=coverage.out -covermode=atomic ./zia -parallel 1 -timeout 120m
@TF_ACC=1 go test -v -race -cover -coverprofile=coverage.out -covermode=atomic ./zia -parallel 5 -timeout 120m
go tool cover -html=coverage.out -o coverage.html

# Default set of integration tests to run for ZscalerOne
Expand Down Expand Up @@ -118,7 +118,7 @@ integration_tests := $(subst $(space),\|,$(INTEGRATION_TESTS))
# Target to run integration tests for ZscalerOne
test\:integration\:zscalerone:
@echo "Running integration tests for ZscalerOne..."
@TF_ACC=1 go test -v -race -cover -coverprofile=coverage.out -covermode=atomic ./zia -parallel 1 -timeout 120m -run ^$(integration_tests)$$
@TF_ACC=1 go test -v -race -cover -coverprofile=coverage.out -covermode=atomic ./zia -parallel 5 -timeout 120m -run ^$(integration_tests)$$
go tool cover -html=coverage.out -o coverage.html

# Default set of integration tests to run for ZscalerOne
Expand Down Expand Up @@ -190,20 +190,20 @@ integration_zs2_tests := $(subst $(space),\|,$(ZS_INTEGRATION_TESTS))
# Target to run integration tests for ZscalerTwo
test\:integration\:zscalertwo:
@echo "Running integration tests for ZscalerTwo..."
@TF_ACC=1 go test -v -race -cover -coverprofile=coverage.out -covermode=atomic ./zia -parallel 1 -timeout 120m -run ^$(integration_zs2_tests)$$
@TF_ACC=1 go test -v -race -cover -coverprofile=coverage.out -covermode=atomic ./zia -parallel 5 -timeout 120m -run ^$(integration_zs2_tests)$$
go tool cover -html=coverage.out -o coverage.html

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/$(ZIA_PROVIDER_NAMESPACE)/3.0.1/$(GOOS)_$(GOARCH)
build13: DESTINATION=$(APPDATA)/terraform.d/plugins/$(ZIA_PROVIDER_NAMESPACE)/3.0.2/$(GOOS)_$(GOARCH)
else
build13: DESTINATION=$(HOME)/.terraform.d/plugins/$(ZIA_PROVIDER_NAMESPACE)/3.0.1/$(GOOS)_$(GOARCH)
build13: DESTINATION=$(HOME)/.terraform.d/plugins/$(ZIA_PROVIDER_NAMESPACE)/3.0.2/$(GOOS)_$(GOARCH)
endif
build13: fmtcheck
@echo "==> Installing plugin to $(DESTINATION)"
@mkdir -p $(DESTINATION)
go build -o $(DESTINATION)/terraform-provider-zia_v3.0.1
go build -o $(DESTINATION)/terraform-provider-zia_v3.0.2

coverage: test
@echo "✓ Opening coverage for unit tests ..."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,18 @@ data "zia_traffic_forwarding_gre_vip_recommended_list" "this"{
source_ip = "1.1.1.1"
required_count = 2
}
```

## Example Usage - With Overridden Geo Coordinates

```hcl
# ZIA Traffic Forwarding - GRE VIP Recommended List
data "zia_traffic_forwarding_gre_vip_recommended_list" "this"{
source_ip = "1.1.1.1"
required_count = 2
latitude = 22.2914
longitude = 114.1445
}
```

## Argument Reference
Expand All @@ -32,9 +43,26 @@ The following arguments are supported:

## Attribute Reference

In addition to all arguments above, the following attributes are exported:
In addition to all arguments above, the following optional attributes can be used to manipulate the recommended list filtering:

* `source_ip` - (String) The public source IP address.
* `virtual_ip` - (String) GRE cluster virtual IP address (VIP)
* `private_service_edge` - (Boolean) Set to true if the virtual IP address (VIP) is a ZIA Private Service Edge
* `datacenter` - (String) Data center information
* `routable_ip` - (Boolean) The routable IP address.
* `within_country_only` - (Boolean) Search within country only.
* `include_private_service_edge` - (Boolean) Include ZIA Private Service Edge VIPs.
* `include_current_vips` - (Boolean) Include currently assigned VIPs.
* `latitude` - (Number) The latitude coordinate of the GRE tunnel source.
* `longitude` - (Number) The longitude coordinate of the GRE tunnel source.
* `subcloud` - (String) The longitude coordinate of the GRE tunnel source.

In addition to all arguments above, the following optional attributes are exported:

* `list` - The list of all recommended returned Virtual IP Addresses (VIPs)
* `id` - (Number) Unique identifer of the GRE virtual IP address (VIP)
* `virtual_ip` - (String) GRE cluster virtual IP address (VIP)
* `private_service_edge` - (Boolean) Set to true if the virtual IP address (VIP) is a ZIA Private Service Edge
* `datacenter` - (String) Data center information
* `city` - (String) Data center city information
* `country_code` - (String) Data center country code information in ISO 3166 Alpha-2
* `region` - (String) Data center region information.
* `latitude` - (Number) The latitude coordinate of the GRE tunnel source.
* `longitude` - (Number) The longitude coordinate of the GRE tunnel source.
Loading

0 comments on commit 986dbb2

Please sign in to comment.