-> Disclaimer: Please refer to our General Support Statement before proceeding with the use of this provider.
This repository contains various modules and deployment configurations that can be used to deploy Zscaler App Connector appliances to securely connect to workloads within Microsoft Azure via the Zscaler Zero Trust Exchange. The examples directory contains complete automation scripts for both greenfield/POV and brownfield/production use.
These deployment templates are intended to be fully functional and self service for both greenfield/pov as well as production use. All modules may also be utilized as design recommendations based on Zscaler's Official Zero Trust Access to Private Apps in Azure with ZPA.
~> IMPORTANT As of version 1.1.0 of this module, all App Connectors are deployed using the new Red Hat Enterprise Linux 9
Our Deployment scripts are leveraging Terraform v1.1.9 that includes full binary and provider support for MacOS M1 chips, but any Terraform version 0.13.7 should be generally supported.
- provider registry.terraform.io/hashicorp/azurerm v4.56.x
- provider registry.terraform.io/hashicorp/random v3.6.x
- provider registry.terraform.io/hashicorp/local v2.5.x
- provider registry.terraform.io/hashicorp/null v3.2.x
- provider registry.terraform.io/providers/hashicorp/tls v4.0.x
- provider registry.terraform.io/providers/zscaler/zpa v4.x
- Azure Subscription Id link to Azure subscriptions
- Have/Create a Service Principal. See. Then Collect:
- Application (client) ID
- Directory (tenant) ID
- Client Secret Value
- Azure Region (e.g. westus2) where App Connector resources are to be deployed
This module leverages the Zscaler Private Access ZPA Terraform Provider for the automated onboarding process. Before proceeding make sure you have the following pre-requistes ready.
- A valid Zscaler Private Access subscription and portal access
- Zscaler ZPA API Keys. Details on how to find and generate ZPA API keys can be located here
zpa_client_idzpa_client_secretzpa_customer_idzpa_cloud- This authentication parameter is optional and only required if authenticating to a non-production cloud i.eBETA,GOV,GOVUS,ZPATWOuse_legacy_client- This parameter MUST be set totrueif your tenant is NOT migrated to Zidentity.
provider "zpa" {
zpa_client_id = "zpa_client_id" # pragma: allowlist secret
zpa_client_secret = "zpa_client_secret" # pragma: allowlist secret
zpa_customer_id = "zpa_client_secret" # pragma: allowlist secret
zpa_cloud = "zpa_cloud" # pragma: allowlist secret
use_legacy_client = "true" # pragma: allowlist secret
}- (Optional) An existing App Connector Group and Provisioning Key. Otherwise, you can follow the prompts in the examples terraform.tfvars to create a new Connector Group and Provisioning Key
See: Zscaler App Connector Azure Deployment Guide for additional prerequisite provisioning steps.
- A valid Zscaler Private Access subscription and portal access
- Zscaler tenant MUST be migrated to Zidentity platform.
- Details on how to authenticate to ZPA via Zidentity/OneAPI are located here here
client_idclient_secretzpa_customer_idvanity_domainzscaler_cloud- This authentication parameter is optional and only required if authenticating to a non-production cloud i.ebeta
provider "zpa" {
client_id = "client_id" # pragma: allowlist secret
client_secret = "client_secret" # pragma: allowlist secret
zpa_customer_id = "client_secret" # pragma: allowlist secret
vanity_domain = "vanity_domain" # pragma: allowlist secret
zscaler_cloud = "zscaler_cloud" # pragma: allowlist secret
}-> Attention Government customers. OneAPI and Zidentity now support the government (FedRAMP) clouds. These are FedRAMP-isolated environments served by a dedicated Zidentity identity provider and API gateway. To authenticate, set the zscaler_cloud attribute (or ZSCALER_CLOUD environment variable) to one of the supported government values gov or govus:
| Argument | Description | Environment Variable |
|---|---|---|
vanity_domain |
(String) Refers to the domain name used by your organization | ZSCALER_VANITY_DOMAIN |
zscaler_cloud |
(String) Supported Zidentity Gov Cloud gov or govus |
ZSCALER_CLOUD |
NOTE: The FedRAMP cloud is only supported when using a compatible provider version. Ensure you are on a ZPA provider version that supports the unified gov / govus cloud values.
For example, authenticating to the GOV environment:
export ZSCALER_VANITY_DOMAIN="acme"
export ZSCALER_CLOUD="gov"- (Optional) An existing App Connector Group and Provisioning Key. Otherwise, you can follow the prompts in the examples terraform.tfvars to create a new Connector Group and Provisioning Key
See: Zscaler App Connector Azure Deployment Guide for additional prerequisite provisioning steps.
This module supports both App Connector onboarding methods, selectable per deployment via the onboarding_method variable in your terraform.tfvars:
onboarding_method |
Description |
|---|---|
oauth (default) |
Enrolls App Connectors using OAuth2 user codes. Each connector reads its user code from /etc/issue at boot, publishes it to an Azure Key Vault secret via the VM's user-assigned Managed Identity, and Terraform reads it back to create the App Connector Group. This is the modern, more secure enrollment flow. |
provisioning_key |
Enrolls App Connectors using the traditional provisioning key. The key is generated via the zpa_provisioning_key resource (or supplied via byo_provisioning_key / byo_provisioning_key_name) and baked into the VM user_data; the connector self-enrolls at boot. No Key Vault interaction is required. |
Both methods are supported and can be used interchangeably. The default is oauth.
-> Recommended: If your Zscaler tenant has been migrated to support the OAuth2 onboarding method, that should be your preferred method as Zscaler is encouraging customers to move away from the provisioning key approach. If your tenant has not yet been migrated, use onboarding_method = "provisioning_key".
Example terraform.tfvars snippets:
# Default: OAuth2 user code onboarding (recommended for migrated tenants)
onboarding_method = "oauth"# Legacy provisioning key onboarding
onboarding_method = "provisioning_key"
# Optionally bring your own existing provisioning key instead of creating one
# byo_provisioning_key = true
# byo_provisioning_key_name = "my-existing-key"Provisioning templates are available for customer use/reference to successfully deploy fully operational App Connector appliances once the prerequisites have been completed. Please follow the instructions located in examples.
This repository follows the Hashicorp Standard Modules Structure:
modules- All module resources utilized by and customized specifically for ZPA App Connector deployments. The intent is these modules are resusable and functional for any deployment type referencing for both production or lab/testing purposes.examples- Zscaler provides fully functional deployment templates utilizing a combination of some or all of the modules published. These can utilized in there entirety or as reference templates for more advanced customers or custom deployments. For novice Terraform users, we also provide a bash script (zsec) that can be run from any Linux/Mac OS or CSP Cloud Shell that walks through all provisioning requirements as well as downloading/running an isolated teraform process. This allows ZPA App Connector deployments from any supported client without having to even have Terraform installed or know how the language/syntax for running it.
These modules follow recommended release tagging in Semantic Versioning. You can find each new release, along with the changelog, on the GitHub Releases page.
Copyright (c) 2022 Zscaler, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.