### Manual Installation of zscaler-terraformer - Linux (Shell) Source: https://github.com/zscaler/zscaler-terraformer/blob/master/README.md These shell commands provide a manual installation process for `zscaler-terraformer` on Linux. It involves fetching the latest release from GitHub, extracting the binary, making it executable, and moving it to a common executable path. ```shell LATEST_TAG=$(curl -s https://api.github.com/repos/zscaler/zscaler-terraformer/releases/latest | grep '"tag_name":' | cut -d '"' -f 4) LATEST_VERSION=$(echo "$LATEST_TAG" | sed 's/v//') ZIP_FILE="zscaler-terraformer_${LATEST_VERSION}_linux_amd64.zip" curl -LO "https://github.com/zscaler/zscaler-terraformer/releases/download/${LATEST_TAG}/${ZIP_FILE}" unzip "$ZIP_FILE" chmod +x zscaler-terraformer sudo mv zscaler-terraformer /usr/local/bin ``` -------------------------------- ### Installing zscaler-terraformer via Chocolatey - Windows (PowerShell) Source: https://github.com/zscaler/zscaler-terraformer/blob/master/README.md This command installs `zscaler-terraformer` on Windows using the Chocolatey package manager. It's a straightforward way to get the utility installed on Windows systems. ```pwsh choco install zscaler-terraformer ``` -------------------------------- ### Installing zscaler-terraformer via Homebrew Tap - MacOS (Bash) Source: https://github.com/zscaler/zscaler-terraformer/blob/master/README.md These commands install `zscaler-terraformer` on MacOS using Homebrew. The first command taps the official Zscaler Homebrew repository, and the second command installs the utility from that tap. ```bash brew tap zscaler/tap brew install zscaler/tap/zscaler-terraformer ``` -------------------------------- ### Installing zscaler-terraformer as Cask via Homebrew - MacOS (Bash) Source: https://github.com/zscaler/zscaler-terraformer/blob/master/README.md This alternative Homebrew installation method for MacOS first taps the Zscaler repository and then installs `zscaler-terraformer` as a Cask, which is typically used for GUI applications but can also apply to command-line tools distributed as packages. ```bash brew tap zscaler/tap brew install --cask zscaler/tap/zscaler-terraformer ``` -------------------------------- ### Displaying Zscaler Terraformer CLI General Usage and Flags Source: https://github.com/zscaler/zscaler-terraformer/blob/master/README.md This snippet shows the general usage syntax for the `zscaler-terraformer` command, listing all available subcommands and their respective flags. It details various authentication parameters (OneAPI, legacy ZIA/ZPA), resource filtering options, and installation path configurations, providing a comprehensive overview of the CLI's capabilities. ```bash Usage: zscaler-terraformer [command] Available Commands: completion Generate the autocompletion script for the specified shell generate Fetch resources from the ZPA and ZIA API and generate the respective Terraform stanzas help Help about any command import Output `terraform import` compatible commands in order to import resources into state version Print the version number of zscaler-terraformer Flags: --client_id string OneAPI client_id (required in V3 mode) --client_secret string OneAPI client_secret (required in V3 mode) --customer_id string OneAPI optional customer_id --exclude string Which resources you wish to exclude -h, --help Show help for zscaler-terraformer --microtenant_id string OneAPI optional microtenant_id --resource-type string Which resource you wish to generate --resources string Which resources you wish to import --supported-resources string List supported resources for ZPA or ZIA --terraform-install-path string Path to the default Terraform installation (default ".") --use_legacy_client Enable Legacy Mode (true/false) --vanity_domain string OneAPI vanity_domain (required in V3 mode) -v, --verbose Enable verbose debug output --version Display the release version --zia-provider-namespace string Custom namespace for the ZIA provider --zia-terraform-install-path string Path to the ZIA Terraform installation (default ".") --zia_api_key string ZIA legacy api_key (required) --zia_cloud string ZIA Cloud environment (required for ZIA legacy, e.g. zscalerthree) --zia_password string ZIA legacy password (required) --zia_username string ZIA legacy username (required if using legacy mode for ZIA resources) --zpa-provider-namespace string Custom namespace for the ZPA provider --zpa-terraform-install-path string Path to the ZPA Terraform installation (default ".") --zpa_client_id string ZPA legacy client ID (required if using legacy mode for ZPA resources) --zpa_client_secret string ZPA legacy client secret --zpa_cloud string ZPA Cloud (``BETA``, ``GOV``, ``GOVUS``, ``PRODUCTION``, ``ZPATWO``) --zpa_customer_id string ZPA legacy customer ID --zpa_microtenant_id string ZPA legacy microtenant_id (optional) --zscaler_cloud string OneAPI optional zscaler_cloud (e.g. PRODUCTION) ``` -------------------------------- ### Displaying Supported ZIA Resources with zscaler-terraformer (Shell) Source: https://github.com/zscaler/zscaler-terraformer/blob/master/README.md This command-line snippet uses the `zscaler-terraformer` tool to display a table of all currently supported Zscaler Internet Access (ZIA) resources. It requires the `zscaler-terraformer` tool to be installed and accessible in the system's PATH. The output is a formatted table similar to the one presented in the document. ```shell zscaler-terraformer --supported-resources="zia" ``` -------------------------------- ### Importing All ZIA Configuration with Zscaler Terraformer CLI Source: https://github.com/zscaler/zscaler-terraformer/blob/master/README.md This command imports all Zscaler Internet Access (ZIA) resources into Terraform state. It uses the `import` subcommand with the `--resources` flag set to `zia` to fetch and prepare the entire ZIA configuration for management by Terraform. ```bash zscaler-terraformer import --resources="zia" ``` -------------------------------- ### Authenticating ZPA OneAPI Client Secret Inline with zscaler-terraformer (Bash) Source: https://github.com/zscaler/zscaler-terraformer/blob/master/README.md This example demonstrates authenticating `zscaler-terraformer` for ZPA OneAPI by passing client secret credentials directly as command-line arguments. It specifies the `resources` as "zpa" and includes `client_id`, `client_secret`, `vanity_domain`, `customer_id`, and the optional `zscaler_cloud` parameter. ```bash zscaler-terraformer import \ --resources="zpa" \ --client_id="xxxxxxxxxxxxxxxx" \ --client_secret="xxxxxxxxxxxxxxxx" \ --vanity_domain="xxxxxxxxxxxxxxxx" \ --customer_id="xxxxxxxxxxxxxxxx" \ --zscaler_cloud="beta" ## Optional for alternative clouds ``` -------------------------------- ### Setting Install Path and Generating ZIA Firewall Rules - zscaler-terraformer (Bash) Source: https://github.com/zscaler/zscaler-terraformer/blob/master/README.md This snippet shows how to set the `ZSCALER_ZIA_TERRAFORM_INSTALL_PATH` environment variable to specify a custom directory for storing generated configurations. It then uses `zscaler-terraformer generate` to create HCL for ZIA firewall filtering rules, directing the output to the specified path. ```bash export ZSCALER_ZIA_TERRAFORM_INSTALL_PATH="$HOME/Desktop/zia_configuration" zscaler-terraformer generate \ --resource-type "zia_firewall_filtering_rule" ``` -------------------------------- ### Generating Specific ZPA Resource with Custom Terraform Install Path Source: https://github.com/zscaler/zscaler-terraformer/blob/master/README.md This snippet demonstrates how to generate a specific ZPA resource (`zpa_application_segment`) while specifying a custom installation path for the Terraform configuration. It sets the `ZSCALER_ZPA_TERRAFORM_INSTALL_PATH` environment variable to direct where the generated configuration files will be stored, then uses the `generate` command with `--resource-type`. ```bash $ export ZSCALER_ZPA_TERRAFORM_INSTALL_PATH="$HOME/Desktop/zpa_configuration" $ zscaler-terraformer generate \ --resource-type "zpa_application_segment" ``` -------------------------------- ### Authenticating ZIA OneAPI Client Secret Inline with zscaler-terraformer (Bash) Source: https://github.com/zscaler/zscaler-terraformer/blob/master/README.md This example demonstrates authenticating `zscaler-terraformer` for ZIA OneAPI by passing client secret credentials directly as command-line arguments. It specifies the `resources` as "zia" and includes `client_id`, `client_secret`, `vanity_domain`, and the optional `zscaler_cloud` parameter. ```bash zscaler-terraformer import \ --resources="zia" \ --client_id="xxxxxxxxxxxxxxxx" \ --client_secret="xxxxxxxxxxxxxxxx" \ --vanity_domain="xxxxxxxxxxxxxxxx" \ --zscaler_cloud="beta" ## Optional for alternative clouds ``` -------------------------------- ### Setting Zscaler Beta Environment Variables (Shell) Source: https://github.com/zscaler/zscaler-terraformer/blob/master/README.md This snippet provides a specific example of how to configure environment variables to authenticate to a Zscaler Beta cloud environment. It sets the `ZSCALER_VANITY_DOMAIN` to "acme" and `ZSCALER_CLOUD` to "beta", which are crucial for connecting to non-production Zscaler instances. ```sh export ZSCALER_VANITY_DOMAIN="acme" export ZSCALER_CLOUD="beta" ``` -------------------------------- ### Importing All ZPA Configuration with Zscaler Terraformer CLI Source: https://github.com/zscaler/zscaler-terraformer/blob/master/README.md This command imports all Zscaler Private Access (ZPA) resources into Terraform state. It uses the `import` subcommand with the `--resources` flag set to `zpa` to fetch and prepare the entire ZPA configuration for management by Terraform. ```bash zscaler-terraformer import --resources="zpa" ``` -------------------------------- ### Performing ZIA Inline Authentication with Terraformer (Bash) Source: https://github.com/zscaler/zscaler-terraformer/blob/master/README.md This command-line snippet demonstrates how to authenticate ZIA directly using `zscaler-terraformer import` arguments. It provides the ZIA username, password, API key, cloud environment, and enables the `use_legacy_client` flag for legacy API compatibility. ```bash zscaler-terraformer import --resources="zia" \ --zia_username="xxxxxxxxxxxxxxxx" \ --zia_password="xxxxxxxxxxxxxxxx" \ --zia_api_key="xxxxxxxxxxxxxxxx" \ --zia_cloud=(i.e zscalerthree) \ --use_legacy_client=true ``` -------------------------------- ### Performing ZPA Inline Authentication with Terraformer (Bash) Source: https://github.com/zscaler/zscaler-terraformer/blob/master/README.md This command-line snippet shows how to perform ZPA authentication directly via `zscaler-terraformer import` arguments. It specifies the ZPA client credentials, customer ID, cloud environment, and explicitly enables the `use_legacy_client` flag for backwards compatibility. ```bash zscaler-terraformer import --resources="zpa" \ --zpa_client_id="xxxxxxxxxxxxxxxx" \ --zpa_client_secret="xxxxxxxxxxxxxxxx" \ --zpa_customer_id="xxxxxxxxxxxxxxxx" \ --zpa_cloud="BETA", "GOV", "GOVUS", "PRODUCTION" or "ZPATWO" \ --use_legacy_client=true ``` -------------------------------- ### Setting ZIA Environment Variables for Legacy API (Bash) Source: https://github.com/zscaler/zscaler-terraformer/blob/master/README.md This snippet illustrates how to configure environment variables for Zscaler Internet Access (ZIA) authentication using the legacy API. It includes `ZIA_USERNAME`, `ZIA_PASSWORD`, `ZIA_API_KEY`, `ZIA_CLOUD`, and the mandatory `ZSCALER_USE_LEGACY_CLIENT` for non-OneAPI authentication. ```bash export ZIA_USERNAME = "xxxxxxxxxxxxxxxx" export ZIA_PASSWORD = "xxxxxxxxxxxxxxxx" export ZIA_API_KEY = "xxxxxxxxxxxxxxxx" export ZIA_CLOUD = "xxxxxxxxxxxxxxxx" (i.e zscalerthree) export ZSCALER_USE_LEGACY_CLIENT=true ``` -------------------------------- ### Importing Specific ZIA Resource with Zscaler Terraformer CLI Source: https://github.com/zscaler/zscaler-terraformer/blob/master/README.md This command imports a specific Zscaler Internet Access (ZIA) resource, `zia_firewall_filtering_rule`, into Terraform state. It leverages the `import` subcommand and the `--resources` flag to target a single resource type for selective import. ```bash zscaler-terraformer import --resources="zia_firewall_filtering_rule" ``` -------------------------------- ### Importing ZPA App Connector Group with Terraform State - zscaler-terraformer (Bash) Source: https://github.com/zscaler/zscaler-terraformer/blob/master/README.md This command initiates the import of `zpa_app_connector_group` resources using `zscaler-terraformer`. It's part of a two-step process where `generate` is typically run first, and this command then outputs Terraform import compatible commands for state management. ```bash zscaler-terraformer import \ --resource-type "zpa_app_connector_group" ``` -------------------------------- ### Viewing Supported ZPA Resources with Zscaler Terraformer (Shell) Source: https://github.com/zscaler/zscaler-terraformer/blob/master/README.md This shell command is used to display a comprehensive table of all Zscaler Private Access (ZPA) resources that are currently supported by the zscaler-terraformer tool. It helps users quickly identify which ZPA resources can be managed (generated or imported) using the tool, providing a clear overview of its capabilities. ```shell zscaler-terraformer --supported-resources="zpa" ``` -------------------------------- ### Importing Specific ZPA Resource with Zscaler Terraformer CLI Source: https://github.com/zscaler/zscaler-terraformer/blob/master/README.md This command imports a specific Zscaler Private Access (ZPA) resource, `zpa_application_segment`, into Terraform state. It leverages the `import` subcommand and the `--resources` flag to target a single resource type for selective import. ```bash zscaler-terraformer import --resources="zpa_application_segment" ``` -------------------------------- ### Excluding Specific ZIA Resources from Import - zscaler-terraformer (Bash) Source: https://github.com/zscaler/zscaler-terraformer/blob/master/README.md This command demonstrates how to use `zscaler-terraformer` to import ZIA resources while explicitly excluding certain resource types, such as forwarding control rules and user management, from the import process. This is useful for selective configuration management. ```bash zscaler-terraformer import --resources="zia" --exclude='zia_forwarding_control_rule,zia_forwarding_control_zpa_gateway,zia_user_management' ``` -------------------------------- ### Setting ZPA Environment Variables for Legacy API (Bash) Source: https://github.com/zscaler/zscaler-terraformer/blob/master/README.md This snippet demonstrates how to set environment variables for Zscaler Private Access (ZPA) authentication using the legacy API framework. It includes `ZPA_CLIENT_ID`, `ZPA_CLIENT_SECRET`, `ZPA_CUSTOMER_ID`, `ZPA_CLOUD`, and `ZSCALER_USE_LEGACY_CLIENT`, which is mandatory for non-OneAPI authentication. ```bash export ZPA_CLIENT_ID = "xxxxxxxxxxxxxxxx" export ZPA_CLIENT_SECRET = "xxxxxxxxxxxxxxxx" export ZPA_CUSTOMER_ID = "xxxxxxxxxxxxxxxx" export ZPA_CLOUD = "BETA", "GOV", "GOVUS", "PRODUCTION" or "ZPATWO" export ZSCALER_USE_LEGACY_CLIENT=true ``` -------------------------------- ### Configuring ZPA OneAPI Client Secret via Environment Variables (Bash) Source: https://github.com/zscaler/zscaler-terraformer/blob/master/README.md This snippet shows how to set the necessary environment variables for ZPA OneAPI client secret authentication. It includes `ZSCALER_CLIENT_ID`, `ZSCALER_CLIENT_SECRET`, `ZSCALER_VANITY_DOMAIN`, `ZPA_CUSTOMER_ID`, and the optional `ZSCALER_CLOUD` for alternative environments. These variables are used by `zscaler-terraformer` for authentication. ```bash export ZSCALER_CLIENT_ID = "xxxxxxxxxxxxxxxx" export ZSCALER_CLIENT_SECRET = "xxxxxxxxxxxxxxxx" export ZSCALER_VANITY_DOMAIN = "xxxxxxxxxxxxxxxx" export ZPA_CUSTOMER_ID = "xxxxxxxxxxxxxxxx" export ZSCALER_CLOUD = "beta" ## Optional for alternative clouds ``` -------------------------------- ### Generating HCL Configuration for ZIA Firewall Rules - zscaler-terraformer (Bash) Source: https://github.com/zscaler/zscaler-terraformer/blob/master/README.md This command uses `zscaler-terraformer generate` to create HCL configuration for ZIA firewall filtering rules. It specifies the output directory using `--zia-terraform-install-path` and is intended for generating HCL without performing a Terraform import or creating a state file. ```bash zscaler-terraformer generate \ --zia-terraform-install-path $HOME/Desktop/zia_configuration \ --resource-type "zia_firewall_filtering_rule" ``` -------------------------------- ### Configuring ZIA OneAPI Client Secret via Environment Variables (Bash) Source: https://github.com/zscaler/zscaler-terraformer/blob/master/README.md This snippet illustrates how to set environment variables for ZIA OneAPI client secret authentication. It includes `ZSCALER_CLIENT_ID`, `ZSCALER_CLIENT_SECRET`, `ZSCALER_VANITY_DOMAIN`, and the optional `ZSCALER_CLOUD` for specifying an alternative cloud environment. These variables are used by `zscaler-terraformer`. ```bash export ZSCALER_CLIENT_ID = "xxxxxxxxxxxxxxxx" export ZSCALER_CLIENT_SECRET = "xxxxxxxxxxxxxxxx" export ZSCALER_VANITY_DOMAIN = "xxxxxxxxxxxxxxxx" export ZSCALER_CLOUD = "beta" ## Optional for alternative clouds ``` -------------------------------- ### Excluding Specific ZPA Resources During Import with Zscaler Terraformer CLI Source: https://github.com/zscaler/zscaler-terraformer/blob/master/README.md This command imports all Zscaler Private Access (ZPA) resources while explicitly excluding `zpa_segment_group` and `zpa_server_group`. It uses the `import` subcommand with the `--resources` flag for ZPA and the `--exclude` flag to specify a comma-separated list of resource types to omit from the import process. ```bash zscaler-terraformer import --resources="zpa" --exclude='zpa_segment_group, zpa_server_group' ``` -------------------------------- ### Displaying Zscaler Terraformer CLI Version (Shell) Source: https://github.com/zscaler/zscaler-terraformer/blob/master/docs/guides/release-notes.md This command is used to retrieve and display detailed version information for the Zscaler Terraformer command-line interface. The output includes the CLI's own version, the supported Terraform version, and the latest available version of the tool. ```Shell zscaler-terraformer version ``` -------------------------------- ### Setting ZPA Provider Namespace for Local Testing (Shell) Source: https://github.com/zscaler/zscaler-terraformer/blob/master/docs/guides/release-notes.md This shell command sets the `ZPA_PROVIDER_NAMESPACE` environment variable. When set, the Zscaler Terraformer tool will use a local Terraform ZPA provider binary for testing and development, bypassing the default download from the Terraform registry. ```Shell export ZPA_PROVIDER_NAMESPACE=zscaler.com/zpa/zpa ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.