From e6adc2d07961b434954909fc568e8db36668bcd7 Mon Sep 17 00:00:00 2001 From: William Guilherme Date: Wed, 6 Mar 2024 21:32:04 -0800 Subject: [PATCH] (feat): Added import support to several resources (#325) * (feat): Added import support to several resources * (Fix): Updated go.mod to GO v1.21 * (Fix): Fixed Importing in several resources --- .github/workflows/zia-test.yml | 8 +-- CHANGELOG.md | 14 ++++ GNUmakefile | 6 +- docs/guides/release-notes.md | 16 ++++- docs/guides/support.md | 10 ++- docs/index.md | 18 +----- docs/resources/zia_admin_users.md | 21 ++++++ docs/resources/zia_auth_settings_urls.md | 13 ++++ docs/resources/zia_dlp_dictionaries.md | 19 ++++++ docs/resources/zia_dlp_engines.md | 19 ++++++ .../zia_dlp_notification_templates.md | 19 ++++++ docs/resources/zia_dlp_web_rules.md | 19 ++++++ ...a_firewall_filtering_destination_groups.md | 19 ++++++ ...zia_firewall_filtering_ip_source_groups.md | 19 ++++++ ...ll_filtering_network_application_groups.md | 19 ++++++ .../zia_firewall_filtering_network_service.md | 19 ++++++ ...rewall_filtering_network_service_groups.md | 19 ++++++ docs/resources/zia_firewall_filtering_rule.md | 19 ++++++ docs/resources/zia_forwarding_control_rule.md | 21 +++++- .../zia_forwarding_control_zpa_gateway.md | 19 ++++++ docs/resources/zia_location_management.md | 19 ++++++ docs/resources/zia_rule_labels.md | 19 ++++++ .../zia_sandbox_behavioral_analysis.md | 13 ++++ .../resources/zia_security_policy_settings.md | 64 ++++++++++++++----- .../zia_traffic_forwarding_gre_tunnel.md | 19 ++++++ .../zia_traffic_forwarding_static_ip.md | 3 + .../zia_traffic_forwarding_vpn_credentials.md | 11 ++-- docs/resources/zia_url_categories.md | 23 +++++++ docs/resources/zia_url_filtering_rules.md | 19 ++++++ docs/resources/zia_user_management.md | 21 ++++++ examples/zia_security_settings/basic.tf | 35 ++++++++++ go.mod | 4 +- go.sum | 18 ++++++ zia/resource_zia_admin_users_test.go | 9 +++ zia/resource_zia_auth_settings_urls.go | 22 +++++++ zia/resource_zia_auth_settings_urls_test.go | 6 ++ ...source_zia_forwarding_control_rule_test.go | 6 ++ ..._zia_fw_filtering_ip_destination_groups.go | 16 ++--- ...ource_zia_fw_filtering_ip_source_groups.go | 16 ++--- ...fw_filtering_network_application_groups.go | 1 + ...ltering_network_application_groups_test.go | 6 ++ ...ia_fw_filtering_network_services_groups.go | 18 +++--- ..._filtering_network_services_groups_test.go | 6 ++ ...x_behavioral_analysis_advanced_settings.go | 25 ++++++++ ...avioral_analysis_advanced_settings_test.go | 6 ++ zia/resource_zia_security_policy_settings.go | 25 ++++++++ ...ource_zia_security_policy_settings_test.go | 6 ++ ...zia_traffic_forwarding_gre_tunnels_test.go | 6 ++ ..._zia_traffic_forwarding_static_ips_test.go | 6 ++ ..._zia_traffic_forwarding_vpn_credentials.go | 18 +++--- ...traffic_forwarding_vpn_credentials_test.go | 20 +++++- zia/resource_zia_url_categories.go | 20 +++--- zia/resource_zia_url_categories_test.go | 6 ++ ...resource_zia_user_management_users_test.go | 9 +++ 54 files changed, 758 insertions(+), 99 deletions(-) create mode 100644 examples/zia_security_settings/basic.tf diff --git a/.github/workflows/zia-test.yml b/.github/workflows/zia-test.yml index f27311e7..57002d5e 100644 --- a/.github/workflows/zia-test.yml +++ b/.github/workflows/zia-test.yml @@ -24,7 +24,7 @@ jobs: strategy: fail-fast: false matrix: - goVersion: ["1.20"] + goVersion: ["1.21"] steps: - name: Checkout code uses: actions/checkout@v4 @@ -89,7 +89,7 @@ jobs: strategy: fail-fast: false matrix: - goVersion: ["1.20"] + goVersion: ["1.21"] environment: - ZIA_ZSCLOUD - ZIA_ZS0 @@ -160,7 +160,7 @@ jobs: strategy: fail-fast: false matrix: - goVersion: ["1.20"] + goVersion: ["1.21"] environment: - ZIA_ZS1 environment: ${{ matrix.environment }} @@ -229,7 +229,7 @@ jobs: strategy: fail-fast: false matrix: - goVersion: ["1.20"] + goVersion: ["1.21"] environment: - ZIA_ZS2 environment: ${{ matrix.environment }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 3763c859..a2a6d16d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 2.7.33 (March, 6 2024) + +### Notes + +- Release date: **(March, 6 2024)** +- Supported Terraform version: **v1.x** + +### Enhacements + +- [PR #325](https://github.com/zscaler/terraform-provider-zia/pull/325) - Added support to import of the following resources: +- ``zia_auth_settings_urls`` +- ``zia_sandbox_behavioral_analysis`` +- ``zia_security_settings`` + ## 2.7.32 (February, 28 2024) ### Notes diff --git a/GNUmakefile b/GNUmakefile index d4fe9524..0a04e9b5 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -189,14 +189,14 @@ test\:integration\:zscalertwo: 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)/2.7.32/$(GOOS)_$(GOARCH) +build13: DESTINATION=$(APPDATA)/terraform.d/plugins/$(ZIA_PROVIDER_NAMESPACE)/2.7.33/$(GOOS)_$(GOARCH) else -build13: DESTINATION=$(HOME)/.terraform.d/plugins/$(ZIA_PROVIDER_NAMESPACE)/2.7.32/$(GOOS)_$(GOARCH) +build13: DESTINATION=$(HOME)/.terraform.d/plugins/$(ZIA_PROVIDER_NAMESPACE)/2.7.33/$(GOOS)_$(GOARCH) endif build13: fmtcheck @echo "==> Installing plugin to $(DESTINATION)" @mkdir -p $(DESTINATION) - go build -o $(DESTINATION)/terraform-provider-zia_v2.7.32 + go build -o $(DESTINATION)/terraform-provider-zia_v2.7.33 coverage: test @echo "✓ Opening coverage for unit tests ..." diff --git a/docs/guides/release-notes.md b/docs/guides/release-notes.md index 11ef0218..7acb3616 100644 --- a/docs/guides/release-notes.md +++ b/docs/guides/release-notes.md @@ -12,10 +12,24 @@ description: |- Track all ZIA Terraform provider's releases. New resources, features, and bug fixes will be tracked here. --- -``Last updated: v2.7.32`` +``Last updated: v2.7.33`` --- +## 2.7.33 (March, 6 2024) + +### Notes + +- Release date: **(March, 6 2024)** +- Supported Terraform version: **v1.x** + +### Enhacements + +- [PR #325](https://github.com/zscaler/terraform-provider-zia/pull/325) - Added support to import of the following resources: +- ``zia_auth_settings_urls`` +- ``zia_sandbox_behavioral_analysis`` +- ``zia_security_settings`` + ## 2.7.32 (February, 28 2024) ### Notes diff --git a/docs/guides/support.md b/docs/guides/support.md index 8940ec93..3299b985 100644 --- a/docs/guides/support.md +++ b/docs/guides/support.md @@ -7,16 +7,14 @@ page_title: "Support Guide" The ZIA Terraform provider is supported and maintained by the Zscaler Technology Alliances team, and we welcome questions on how to use the provider. Please, refer to our [troubleshooting guide](troubleshooting.md) for guidance on typical problems. -All bug reports and feature requests must be submitted via [GitHub issues](https://github.com/zscaler/terraform-provider-zia/issues). When reporting bugs, please include the Terraform script that demonstrates the bug and the command output. Stack traces will also be helpful. - -⚠️ **IMPORTANT:**:: Please ensure any sensitive information is redacted as Issues and Pull Requests are publicly viewable. - -Notice that we will **NOT**, however, fix bugs upon customer demand, as we have to prioritize all pending bugs and features, as part of the product's backlog and release cycles. - ## Support Ticket Severity Support tickets related to the Terraform providers can be opened with [Zscaler Support](https://help.zscaler.com/login-tickets), however since the provider is just a client of the underlying product API, we will **NOT** be able to treat provider related support requests as a Severity-1 (Immediate time frame). +When reporting bugs, please provide the Terraform script that demonstrates the bug and the command output. Stack traces will also be helpful. + +Notice that we will **NOT**, however, fix bugs upon customer demand, as we have to prioritize all pending bugs and features, as part of the product's backlog and release cycles. + Urgent, production related Terraform issues can be resolved via direct interaction with the underlying API or UI. We will ask customers to resort to these methods to resolve downtime or urgent issues. If you have an urgent escalation, please contact your local Zscaler account team (RSM/SE/CSM/TAM) for assistance. ## Contact diff --git a/docs/index.md b/docs/index.md index 2f08f14e..fa5e8c29 100644 --- a/docs/index.md +++ b/docs/index.md @@ -123,18 +123,6 @@ operations is launches exceeds In order to accomplish this, make sure you set the [parallelism](https://www.terraform.io/cli/commands/apply#parallelism-n) value at or below this limit to prevent performance impacts. -## Support - -This template/solution are released under an as-is, best effort, support -policy. These scripts should be seen as community supported and Zscaler -Business Development Team will contribute our expertise as and when possible. -We do not provide technical support or help in using or troubleshooting the components -of the project through our normal support options such as Zscaler support teams, -or ASC (Authorized Support Centers) partners and backline -support options. The underlying product used (Zscaler Internet Access API) by the -scripts or templates are still supported, but the support is only for the -product functionality and not for help in deploying or using the template or -script itself. Unless explicitly tagged, all projects or work posted in our -GitHub repository at () or sites other -than our official Downloads page on -are provided under the best effort policy. +## General Support Statement + +-> **Disclaimer:** Please refer to our [General Support Statement](guides/support.md) before proceeding with the use of this provider. You can also refer to our [troubleshooting guide](guides/troubleshooting.md) for guidance on typical problems. diff --git a/docs/resources/zia_admin_users.md b/docs/resources/zia_admin_users.md index d3e952d7..edab6607 100644 --- a/docs/resources/zia_admin_users.md +++ b/docs/resources/zia_admin_users.md @@ -158,3 +158,24 @@ The following arguments are supported: * `admin_scope_type` - (Optional) The admin's scope. A scope is required for admins, but not applicable to auditors. This attribute is subject to change. Support values are: `ORGANIZATION`, `DEPARTMENT`, `LOCATION`, `LOCATION_GROUP` * `admin_scope_entities` - (Optional) Based on the admin scope type, the entities can be the ID/name pair of departments, locations, or location groups. * `id` - (Optional) Identifier that uniquely identifies an entity + +## Import + +Zscaler offers a dedicated tool called Zscaler-Terraformer to allow the automated import of ZIA configurations into Terraform-compliant HashiCorp Configuration Language. +[Visit](https://github.com/zscaler/zscaler-terraformer) + +**zia_admin_users** can be imported by using `` or `` as the import ID. + +For example: + +```shell +terraform import zia_admin_users.example +``` + +or + +```shell +terraform import zia_admin_users.example +``` + +⚠️ **NOTE :**: This provider do not import the password attribute value during the importing process. diff --git a/docs/resources/zia_auth_settings_urls.md b/docs/resources/zia_auth_settings_urls.md index 94dde451..4f017672 100644 --- a/docs/resources/zia_auth_settings_urls.md +++ b/docs/resources/zia_auth_settings_urls.md @@ -47,3 +47,16 @@ The following arguments are supported: ### Optional There are no optional parameters supported by this resource. + +## Import + +Zscaler offers a dedicated tool called Zscaler-Terraformer to allow the automated import of ZIA configurations into Terraform-compliant HashiCorp Configuration Language. +[Visit](https://github.com/zscaler/zscaler-terraformer) + +**zia_auth_settings_urls** can be imported by using `all_urls` as the import ID. + +For example: + +```shell +terraform import zia_auth_settings_urls.example all_urls +``` diff --git a/docs/resources/zia_dlp_dictionaries.md b/docs/resources/zia_dlp_dictionaries.md index d2816b9a..a3172d3b 100644 --- a/docs/resources/zia_dlp_dictionaries.md +++ b/docs/resources/zia_dlp_dictionaries.md @@ -110,3 +110,22 @@ The following arguments are supported: * `include_bin_numbers` - (Optional) A true value denotes that the specified Bank Identification Number (BIN) values are included in the Credit Cards dictionary. A false value denotes that the specified BIN values are excluded from the Credit Cards dictionary. Note: This field is applicable only to the predefined Credit Cards dictionary and its clones. * `bin_numbers` - (Optional) The list of Bank Identification Number (BIN) values that are included or excluded from the Credit Cards dictionary. BIN values can be specified only for Diners Club, Mastercard, RuPay, and Visa cards. Up to 512 BIN values can be configured in a dictionary. Note: This field is applicable only to the predefined Credit Cards dictionary and its clones. * `dict_template_id` - (Optional) ID of the predefined dictionary (original source dictionary) that is used for cloning. This field is applicable only to cloned dictionaries. Only a limited set of identification-based predefined dictionaries (e.g., Credit Cards, Social Security Numbers, National Identification Numbers, etc.) can be cloned. Up to 4 clones can be created from a predefined dictionary. + +## Import + +Zscaler offers a dedicated tool called Zscaler-Terraformer to allow the automated import of ZIA configurations into Terraform-compliant HashiCorp Configuration Language. +[Visit](https://github.com/zscaler/zscaler-terraformer) + +**zia_dlp_dictionaries** can be imported by using `` or `` as the import ID. + +For example: + +```shell +terraform import zia_dlp_dictionaries.example +``` + +or + +```shell +terraform import zia_dlp_dictionaries.example +``` diff --git a/docs/resources/zia_dlp_engines.md b/docs/resources/zia_dlp_engines.md index 4b9b19d1..84a3b9d7 100644 --- a/docs/resources/zia_dlp_engines.md +++ b/docs/resources/zia_dlp_engines.md @@ -38,3 +38,22 @@ The following arguments are supported: ### Optional * `description` - (String) The DLP engine's description. + +## Import + +Zscaler offers a dedicated tool called Zscaler-Terraformer to allow the automated import of ZIA configurations into Terraform-compliant HashiCorp Configuration Language. +[Visit](https://github.com/zscaler/zscaler-terraformer) + +**zia_dlp_engines** can be imported by using `` or `` as the import ID. + +For example: + +```shell +terraform import zia_dlp_engines.example +``` + +or + +```shell +terraform import zia_dlp_engines.example +``` diff --git a/docs/resources/zia_dlp_notification_templates.md b/docs/resources/zia_dlp_notification_templates.md index 6b240e2d..f125075f 100644 --- a/docs/resources/zia_dlp_notification_templates.md +++ b/docs/resources/zia_dlp_notification_templates.md @@ -38,3 +38,22 @@ The following arguments are supported: * `subject` - (Optional) The Subject line that is displayed within the DLP notification email. * `attach_content` - (Optional) If set to true, the content that is violation is attached to the DLP notification email. * `tls_enabled` - (Optional) If set to true, the content that is violation is attached to the DLP notification email. + +## Import + +Zscaler offers a dedicated tool called Zscaler-Terraformer to allow the automated import of ZIA configurations into Terraform-compliant HashiCorp Configuration Language. +[Visit](https://github.com/zscaler/zscaler-terraformer) + +**zia_dlp_notification_templates** can be imported by using `