-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ✨ Added New Forward Control Rule Resource (#294)
* feat: Added Forwarding Control Rule datasource * feat: Added Forwarding Control ZPA Gateway * feat: Added zpa gateway * fix: fixed zpa_app_segments attribute * fix: Removed ZPA Gateway resource * feat: Added Forwarding Control Policy * fix forwarding control test * (doc) Updated Forward Control Rule documentation examples * fix: Fix variable conflict with master * fix: Fix deprecated schema functions * feat: Fixed multiple validators and deprecated functions * fix: Fixed forwarding control rule flattening function * Fixed: GNUmakefile
- Loading branch information
Showing
27 changed files
with
2,116 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,9 @@ default: build | |
|
||
dep: # Download required dependencies | ||
|
||
docs: | ||
go generate | ||
|
||
build: fmtcheck | ||
go install | ||
|
||
|
@@ -37,11 +40,12 @@ sweep: | |
|
||
test: | ||
echo $(TEST) | \ | ||
xargs -t -n4 go test $(TESTARGS) $(TEST_FILTER) -timeout=30s -parallel=4 | ||
xargs -t -n4 go test $(TESTARGS) $(TEST_FILTER) -timeout=30s -parallel=10 | ||
|
||
testacc: | ||
TF_ACC=1 go test $(TEST) $(TESTARGS) $(TEST_FILTER) -timeout 120m | ||
|
||
|
||
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... | ||
|
@@ -54,6 +58,10 @@ build13: fmtcheck | |
@mkdir -p $(DESTINATION) | ||
go build -o $(DESTINATION)/terraform-provider-zia_v2.7.0 | ||
|
||
coverage: test | ||
@echo "✓ Opening coverage for unit tests ..." | ||
@go tool cover -html=coverage.txt | ||
|
||
vet: | ||
@echo "==> Checking source code against go vet and staticcheck" | ||
@go vet ./... | ||
|
@@ -72,15 +80,9 @@ fmtcheck: | |
errcheck: | ||
@sh -c "'$(CURDIR)/scripts/errcheck.sh'" | ||
|
||
tools: | ||
@which $(GOFMT) || go install mvdan.cc/[email protected] | ||
@which $(TFPROVIDERLINT) || go install github.com/bflad/tfproviderlint/cmd/[email protected] | ||
@which $(STATICCHECK) || go install honnef.co/go/tools/cmd/[email protected] | ||
|
||
tools-update: | ||
@go install mvdan.cc/[email protected] | ||
@go install github.com/bflad/tfproviderlint/cmd/[email protected] | ||
@go install honnef.co/go/tools/cmd/[email protected] | ||
fmt-docs: | ||
@echo "✓ Formatting code samples in documentation" | ||
@terrafmt fmt -p '*.md' . | ||
|
||
vendor-status: | ||
@govendor status | ||
|
@@ -93,6 +95,41 @@ test-compile: | |
fi | ||
go test -c $(TEST) $(TESTARGS) | ||
|
||
lint: | ||
@echo "==> Checking source code against linters..." | ||
@$(TFPROVIDERLINT) \ | ||
-c 1 \ | ||
-AT001 \ | ||
-R004 \ | ||
-S001 \ | ||
-S002 \ | ||
-S003 \ | ||
-S004 \ | ||
-S005 \ | ||
-S007 \ | ||
-S008 \ | ||
-S009 \ | ||
-S010 \ | ||
-S011 \ | ||
-S012 \ | ||
-S013 \ | ||
-S014 \ | ||
-S015 \ | ||
-S016 \ | ||
-S017 \ | ||
-S019 \ | ||
./$(PKG_NAME) | ||
|
||
tools: | ||
@which $(GOFMT) || go install mvdan.cc/[email protected] | ||
@which $(TFPROVIDERLINT) || go install github.com/bflad/tfproviderlint/cmd/[email protected] | ||
@which $(STATICCHECK) || go install honnef.co/go/tools/cmd/[email protected] | ||
|
||
tools-update: | ||
@go install mvdan.cc/[email protected] | ||
@go install github.com/bflad/tfproviderlint/cmd/[email protected] | ||
@go install honnef.co/go/tools/cmd/[email protected] | ||
|
||
ziaActivator: GOOS=$(shell go env GOOS) | ||
ziaActivator: GOARCH=$(shell go env GOARCH) | ||
ifeq ($(OS),Windows_NT) # is Windows_NT on XP, 2000, 7, Vista, 10... | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
--- | ||
subcategory: "Forwarding Control Policy" | ||
layout: "zscaler" | ||
page_title: "ZIA): forwarding_control_rule" | ||
description: |- | ||
Get information about forwarding control rule. | ||
--- | ||
# Data Source: forwarding_control_rule | ||
|
||
Use the **forwarding_control_rule** data source to get information about a forwarding control rule which is used to forward selective Zscaler traffic to specific destinations based on your needs.For example, if you want to forward specific web traffic to a third-party proxy service or if you want to forward source IP anchored application traffic to a specific Zscaler Private Access (ZPA) App Connector or internal application traffic through ZIA threat and data protection engines, use forwarding control by configuring appropriate rules. | ||
|
||
## Example Usage | ||
|
||
```hcl | ||
# ZIA Forwarding Control - ZPA Gateway | ||
data "zia_forwarding_control_rule" "this" { | ||
name = "FWD_RULE01" | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
||
* `name` - (Required) The name of the forwarding rule. | ||
* `id` - (Optional) A unique identifier assigned to the forwarding rule. | ||
|
||
## Attribute Reference | ||
|
||
In addition to all arguments above, the following attributes are exported: | ||
|
||
* `description` - (string) - Additional information about the forwarding rule | ||
* `type` - (string) - The rule type selected from the available options | ||
* `forward_method` - (string) - The type of traffic forwarding method selected from the available options. | ||
* `state` - (string) - Indicates whether the forwarding rule is enabled or disabled. | ||
* `order` - (string) - The order of execution for the forwarding rule order. | ||
|
||
`Who, Where and When` supports the following attributes: | ||
|
||
* `locations` - (Optional) You can manually select up to `8` locations. When not used it implies `Any` to apply the rule to all groups. | ||
- `id` - (String) Identifier that uniquely identifies an entity | ||
- `name` - (String) The configured name of the entity | ||
* `location_groups` - (Optional) You can manually select up to `32` location groups. When not used it implies `Any` to apply the rule to all location groups. | ||
- `id` - (String) Identifier that uniquely identifies an entity | ||
- `name` - (String) The configured name of the entity | ||
|
||
* `ec_groups` - (list) - Name-ID pairs of the Zscaler Cloud Connector groups to which the forwarding rule applies | ||
- `id` - (String) Identifier that uniquely identifies an entity | ||
- `name` - (String) The configured name of the entity | ||
* `departments` - (list) Apply to any number of departments When not used it implies `Any` to apply the rule to all departments. | ||
- `id` - (String) Identifier that uniquely identifies an entity | ||
- `name` - (String) The configured name of the entity | ||
* `groups` - (list) You can manually select up to `8` groups. When not used it implies `Any` to apply the rule to all groups. | ||
- `id` - (String) Identifier that uniquely identifies an entity | ||
- `name` - (String) The configured name of the entity | ||
* `users` - (list) You can manually select up to `4` general and/or special users. When not used it implies `Any` to apply the rule to all users. | ||
- `id` - (String) Identifier that uniquely identifies an entity | ||
- `name` - (String) The configured name of the entity | ||
|
||
`network services` supports the following attributes: | ||
|
||
* `nw_service_groups` - (list) Any number of predefined or custom network service groups to which the rule applies. | ||
* `nw_services`- (list) When not used it applies the rule to all network services or you can select specific network services. The Zscaler firewall has predefined services and you can configure up to `1,024` additional custom services. | ||
|
||
`network applications` supports the following attributes: | ||
|
||
* `nw_application_groups` - (list) Any number of application groups that you want to control with this rule. The service provides predefined applications that you can group, but not modify | ||
* `nw_applications` - (Optional) When not used it applies the rule to all applications. The service provides predefined applications, which you can group, but not modify. | ||
|
||
`source ip addresses` supports the following attributes: | ||
|
||
* `src_ip_groups` - (list) Any number of source IP address groups that you want to control with this rule. | ||
- `id` - (String) Identifier that uniquely identifies an entity | ||
- `name` - (String) The configured name of the entity | ||
* `src_ips` - (Optional) You can enter individual IP addresses, subnets, or address ranges. | ||
|
||
`destinations` supports the following attributes: | ||
|
||
* `dest_addresses`** - (list) - IP addresses and fully qualified domain names (FQDNs), if the domain has multiple destination IP addresses or if its IP addresses may change. For IP addresses, you can enter individual IP addresses, subnets, or address ranges. If adding multiple items, hit Enter after each entry. | ||
* `dest_countries`** - (list) estination countries for which the rule is applicable. If not set, the rule is not restricted to specific destination countries. Provide a 2 letter [ISO3166 Alpha2 Country code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes). | ||
* `res_categories`** - (list) List of destination domain categories to which the rule applies. | ||
* `dest_ip_categories`** - (list) identify destinations based on the URL category of the domain, select Any to apply the rule to all categories or select the specific categories you want to control. | ||
- `id` - (String) Identifier that uniquely identifies an entity | ||
- `name` - (String) The configured name of the entity | ||
* `dest_ip_groups`** - (list) Any number of destination IP address groups that you want to control with this rule. | ||
- `id` - (String) Identifier that uniquely identifies an entity | ||
- `name` - (String) The configured name of the entity | ||
|
||
* `app_service_groups` (list) - Application service groups on which this rule is applied | ||
- `id` - (String) Identifier that uniquely identifies an entity | ||
- `name` - (String) The configured name of the entity | ||
|
||
* `app_services` (list) - Application services on which this rule is applied | ||
- `id` - (String) Identifier that uniquely identifies an entity | ||
- `name` - (String) The configured name of the entity | ||
|
||
* `labels` (list) Labels that are applicable to the rule. | ||
- `id` - (String) Identifier that uniquely identifies an entity | ||
- `name` - (String) The configured name of the entity. | ||
* `devices` (list) Name-ID pairs of devices for which the rule must be applied. Specifies devices that are managed using Zscaler Client Connector. If no value is set, this field is ignored during the policy evaluation. | ||
- `id` - (int) Identifier that uniquely identifies an entity | ||
|
||
* `device_groups` (list) Name-ID pairs of device groups for which the rule must be applied. This field is applicable for devices that are managed using Zscaler Client Connector. If no value is set, this field is ignored during the policy evaluation. | ||
- `id` - (int) Identifier that uniquely identifies an entity | ||
|
||
* `zpa_gateway` (set) The ZPA Gateway for which this rule is applicable. This field is applicable only for the `ZPA` forwarding method. | ||
- `id` - (int) Identifier that uniquely identifies an entity | ||
- `name` - (string) The configured name of the entity | ||
|
||
* `zpa_app_segments` (set) The list of ZPA Application Segments for which this rule is applicable. This field is applicable only for the `ZPA` Gateway forwarding method. | ||
- `name` - (string) The configured name of the entity | ||
- `external_id` - (int) Identifier that uniquely identifies an entity | ||
|
||
* `proxy_gateway` (set) The proxy gateway for which the rule is applicable. This field is applicable only for the `PROXYCHAIN` forwarding method. | ||
- `id` - (int) Identifier that uniquely identifies an entity | ||
- `name` - (string) The configured name of the entity. | ||
|
||
* `zpa_application_segments` (set) List of ZPA Application Segments for which this rule is applicable. This field is applicable only for the `ECZPA` forwarding method (used for Zscaler Cloud Connector). | ||
- `name` - (string) The configured name of the entity | ||
- `external_id` - (int) Identifier that uniquely identifies an entity | ||
|
||
* `zpa_application_segment_groups` (set) List of ZPA Application Segment Groups for which this rule is applicable. This field is applicable only for the `ECZPA` forwarding method (used for Zscaler Cloud Connector). | ||
- `name` - (string) The configured name of the entity | ||
- `external_id` - (int) Identifier that uniquely identifies an entity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.