Skip to content

Commit

Permalink
(feat): Added import support to several resources (#325)
Browse files Browse the repository at this point in the history
* (feat): Added import support to several resources

* (Fix): Updated go.mod to GO v1.21

* (Fix): Fixed Importing in several resources
  • Loading branch information
willguibr authored Mar 7, 2024
1 parent 67e4396 commit e6adc2d
Show file tree
Hide file tree
Showing 54 changed files with 758 additions and 99 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/zia-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
strategy:
fail-fast: false
matrix:
goVersion: ["1.20"]
goVersion: ["1.21"]
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
strategy:
fail-fast: false
matrix:
goVersion: ["1.20"]
goVersion: ["1.21"]
environment:
- ZIA_ZSCLOUD
- ZIA_ZS0
Expand Down Expand Up @@ -160,7 +160,7 @@ jobs:
strategy:
fail-fast: false
matrix:
goVersion: ["1.20"]
goVersion: ["1.21"]
environment:
- ZIA_ZS1
environment: ${{ matrix.environment }}
Expand Down Expand Up @@ -229,7 +229,7 @@ jobs:
strategy:
fail-fast: false
matrix:
goVersion: ["1.20"]
goVersion: ["1.21"]
environment:
- ZIA_ZS2
environment: ${{ matrix.environment }}
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 ..."
Expand Down
16 changes: 15 additions & 1 deletion docs/guides/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 4 additions & 6 deletions docs/guides/support.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 3 additions & 15 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 (<https://github.com/zscaler>) or sites other
than our official Downloads page on <https://support.zscaler.com>
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.
21 changes: 21 additions & 0 deletions docs/resources/zia_admin_users.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<ADMIN ID>` or `<LOGIN NAME>` as the import ID.

For example:

```shell
terraform import zia_admin_users.example <admin_id>
```

or

```shell
terraform import zia_admin_users.example <login_name>
```

⚠️ **NOTE :**: This provider do not import the password attribute value during the importing process.
13 changes: 13 additions & 0 deletions docs/resources/zia_auth_settings_urls.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
19 changes: 19 additions & 0 deletions docs/resources/zia_dlp_dictionaries.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<DICTIONARY ID>` or `<DICTIONARY_NAME>` as the import ID.

For example:

```shell
terraform import zia_dlp_dictionaries.example <dictionary_id>
```

or

```shell
terraform import zia_dlp_dictionaries.example <dictionary_name>
```
19 changes: 19 additions & 0 deletions docs/resources/zia_dlp_engines.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<ENGINE_ID>` or `<ENGINE_NAME>` as the import ID.

For example:

```shell
terraform import zia_dlp_engines.example <engine_id>
```

or

```shell
terraform import zia_dlp_engines.example <engine_name>
```
19 changes: 19 additions & 0 deletions docs/resources/zia_dlp_notification_templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<TEMPLATE ID>` or `<TEMPLATE NAME>` as the import ID.

For example:

```shell
terraform import zia_dlp_notification_templates.example <template_id>
```

or

```shell
terraform import zia_dlp_notification_templates.example <template_name>
```
19 changes: 19 additions & 0 deletions docs/resources/zia_dlp_web_rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,22 @@ The following arguments are supported:
* `workload_groups` (Optional) The list of preconfigured workload groups to which the policy must be applied
* `id` - (Optional) A unique identifier assigned to the workload group
* `name` - (Optional) The name of the workload group

## 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_web_rules** can be imported by using `<RULE ID>` or `<RULE NAME>` as the import ID.

For example:

```shell
terraform import zia_dlp_web_rules.example <rule_id>
```

or

```shell
terraform import zia_dlp_web_rules.example <rule_name>
```
19 changes: 19 additions & 0 deletions docs/resources/zia_firewall_filtering_destination_groups.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,22 @@ The following arguments are supported:
* `description` (Optional) Additional information about the destination IP group
* `ip_categories` (Optional) Destination IP address URL categories. You can identify destinations based on the URL category of the domain. See list of all IP Categories [Here](https://help.zscaler.com/zia/firewall-policies#/ipDestinationGroups-get)
* !> **WARNING:** The `ip_categories` attribute only accepts custom URL categories.

## 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_firewall_filtering_destination_groups** can be imported by using `<GROUP_ID>` or `<GROUP_NAME>` as the import ID.

For example:

```shell
terraform import zia_firewall_filtering_destination_groups.example <group_id>
```

or

```shell
terraform import zia_firewall_filtering_destination_groups.example <group_name>
```
19 changes: 19 additions & 0 deletions docs/resources/zia_firewall_filtering_ip_source_groups.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,22 @@ The following arguments are supported:
### Optional

* `description` (Optional) - Description of the source IP group

## 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_firewall_filtering_ip_source_groups** can be imported by using `<GROUP_ID>` or `<GROUP_NAME>` as the import ID.

For example:

```shell
terraform import zia_firewall_filtering_ip_source_groups.example <group_id>
```

or

```shell
terraform import zia_firewall_filtering_ip_source_groups.example <group_name>
```
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,22 @@ The following arguments are supported:
### Optional

* `description` (Optional) - Description of the network application group

## 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_firewall_filtering_network_application_groups** can be imported by using `<GROUP_ID>` or `<GROUP_NAME>` as the import ID.

For example:

```shell
terraform import zia_firewall_filtering_network_application_groups.example <group_id>
```

or

```shell
terraform import zia_firewall_filtering_network_application_groups.example <group_name>
```
19 changes: 19 additions & 0 deletions docs/resources/zia_firewall_filtering_network_service.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,22 @@ The following arguments are supported:
* `description` - (Optional) Description of the service
* `is_name_l10n_tag` - (Optional
* `tag` - (Optional) The following values are supported: `"ICMP_ANY`, `"UDP_ANY"`, `"TCP_ANY"`, `"OTHER_NETWORK_SERVICE"`, `"DNS"`, `"NETBIOS"`, `"FTP"`, `"GNUTELLA"`, `"H_323"`, `"HTTP"`, `"HTTPS"`, `"IKE"`, `"IMAP"`, `"ILS"`, `"IKE_NAT"`, `"IRC"`, `"LDAP"`, `"QUIC"`, `"TDS"`, `"NETMEETING"`, `"NFS"`, `"NTP"`, `"SIP"`, `"SNMP"`, `"SMB"`, `"SMTP"`, `"SSH"`, `"SYSLOG"`, `"TELNET"`, `"TRACEROUTE"`, `"POP3"`, `"PPTP"`, `"RADIUS"`, `"REAL_MEDIA"`, `"RTSP"`, `"VNC"`, `"WHOIS"`, `"KERBEROS_SEC"`, `"TACACS"`, `"SNMPTRAP"`, `"NMAP"`, `"RSYNC"`, `"L2TP"`, `"HTTP_PROXY"`, `"PC_ANYWHERE"`, `"MSN"`, `"ECHO"`, `"AIM"`, `"IDENT"`, `"YMSG"`, `"SCCP"`, `"MGCP_UA"`, `"MGCP_CA"`, `"VDO_LIVE"`, `"OPENVPN"`, `"TFTP"`, `"FTPS_IMPLICIT"`, `"ZSCALER_PROXY_NW_SERVICES"`, `"GRE_PROTOCOL"`, `"ESP_PROTOCOL"`, `"DHCP"`

## 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_firewall_filtering_network_service** can be imported by using `<SERVICE_ID>` or `<SERVICE_NAME>` as the import ID.

For example:

```shell
terraform import zia_firewall_filtering_network_service.example <service_id>
```

or

```shell
terraform import zia_firewall_filtering_network_service.example <service_name>
```
19 changes: 19 additions & 0 deletions docs/resources/zia_firewall_filtering_network_service_groups.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,22 @@ The following arguments are supported:
### Optional

* `description` (Optional) - Description of the network services group

## 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)

**firewall_filtering_network_service_groups** can be imported by using `<GROUP_ID>` or `<GROUP_NAME>` as the import ID.

For example:

```shell
terraform import firewall_filtering_network_service_groups.example <group_id>
```

or

```shell
terraform import firewall_filtering_network_service_groups.example <group_name>
```
Loading

0 comments on commit e6adc2d

Please sign in to comment.