diff --git a/.gitignore b/.gitignore index ce8dfb6..d6ac377 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,7 @@ override.tf override.tf.json *_override.tf *_override.tf.json +terraform.log # Include override files you do wish to add to version control using negated pattern # diff --git a/examples/base/outputs.tf b/examples/base/outputs.tf index 1f87b90..bff5aa1 100755 --- a/examples/base/outputs.tf +++ b/examples/base/outputs.tf @@ -3,10 +3,10 @@ locals { testbedconfig = < [null](#requirement\_null) | ~> 3.2.0 | | [random](#requirement\_random) | ~> 3.6.0 | | [tls](#requirement\_tls) | ~> 4.0.0 | -| [zpa](#requirement\_zpa) | ~> 3.31.0 | +| [zpa](#requirement\_zpa) | ~> 3 | ## Providers @@ -112,7 +112,7 @@ From base_pse directory execute: | [pse\_subnets](#input\_pse\_subnets) | Private Service Edge Subnets to create in VNet. This is only required if you want to override the default subnets that this code creates via network\_address\_space variable. | `list(string)` | `null` | no | | [psevm\_image\_offer](#input\_psevm\_image\_offer) | Azure Marketplace RHEL Image Offer | `string` | `"rh-rhel"` | no | | [psevm\_image\_publisher](#input\_psevm\_image\_publisher) | Red Hat Inc | `string` | `"redhat"` | no | -| [psevm\_image\_sku](#input\_psevm\_image\_sku) | Azure Marketplace RHEL Image SKU | `string` | `"rh-rhel9-gen1"` | no | +| [psevm\_image\_sku](#input\_psevm\_image\_sku) | Azure Marketplace RHEL Image SKU | `string` | `"rh-rhel9"` | no | | [psevm\_image\_version](#input\_psevm\_image\_version) | Azure Marketplace RHEL Image Version | `string` | `"latest"` | no | | [psevm\_instance\_type](#input\_psevm\_instance\_type) | Private Service Edge Image size | `string` | `"Standard_D2s_v3"` | no | | [public\_subnets](#input\_public\_subnets) | Public/Bastion Subnets to create in VNet. This is only required if you want to override the default subnets that this code creates via network\_address\_space variable. | `list(string)` | `null` | no | diff --git a/examples/base_pse/outputs.tf b/examples/base_pse/outputs.tf index ce35978..2f17f30 100755 --- a/examples/base_pse/outputs.tf +++ b/examples/base_pse/outputs.tf @@ -3,13 +3,13 @@ locals { testbedconfig = < zones. ## E.g. pse_count set to 4 and 2 zones set ['1","2"] will create 2x ACs in AZ1 and 2x ACs in AZ2 -#pse_count = 1 +pse_count = 1 ## 8. By default, no zones are specified in any resource creation meaning they are either auto-assigned by Azure ## (Virtual Machines and NAT Gateways) or Zone-Redundant (Public IP) based on whatever default configuration is. diff --git a/examples/base_pse/variables.tf b/examples/base_pse/variables.tf index 3a4b3f3..261ba9c 100755 --- a/examples/base_pse/variables.tf +++ b/examples/base_pse/variables.tf @@ -78,7 +78,7 @@ variable "psevm_image_offer" { variable "psevm_image_sku" { type = string description = "Azure Marketplace RHEL Image SKU" - default = "rh-rhel9-gen1" + default = "rh-rhel9" } variable "psevm_image_version" { diff --git a/examples/base_pse/versions.tf b/examples/base_pse/versions.tf index b9f24f3..af20981 100755 --- a/examples/base_pse/versions.tf +++ b/examples/base_pse/versions.tf @@ -22,7 +22,7 @@ terraform { } zpa = { source = "zscaler/zpa" - version = "~> 3.31.0" + version = "~> 3" } } required_version = ">= 0.13.7, < 2.0.0" diff --git a/examples/pse/versions.tf b/examples/pse/versions.tf index b9f24f3..af20981 100755 --- a/examples/pse/versions.tf +++ b/examples/pse/versions.tf @@ -22,7 +22,7 @@ terraform { } zpa = { source = "zscaler/zpa" - version = "~> 3.31.0" + version = "~> 3" } } required_version = ">= 0.13.7, < 2.0.0" diff --git a/modules/terraform-zpa-provisioning-key/README.md b/modules/terraform-zpa-provisioning-key/README.md index 5e6e279..52d486a 100644 --- a/modules/terraform-zpa-provisioning-key/README.md +++ b/modules/terraform-zpa-provisioning-key/README.md @@ -10,13 +10,13 @@ There is a "BYO" option where you can conditionally create new or reference an e | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 0.13.7, < 2.0.0 | -| [zpa](#requirement\_zpa) | ~> 3.31.0 | +| [zpa](#requirement\_zpa) | ~> 3 | ## Providers | Name | Version | |------|---------| -| [zpa](#provider\_zpa) | ~> 3.31.0 | +| [zpa](#provider\_zpa) | ~> 3 | ## Modules diff --git a/modules/terraform-zpa-provisioning-key/versions.tf b/modules/terraform-zpa-provisioning-key/versions.tf index 07f0e32..f0df7b7 100755 --- a/modules/terraform-zpa-provisioning-key/versions.tf +++ b/modules/terraform-zpa-provisioning-key/versions.tf @@ -2,7 +2,7 @@ terraform { required_providers { zpa = { source = "zscaler/zpa" - version = "~> 3.31.0" + version = "~> 3" } } required_version = ">= 0.13.7, < 2.0.0" diff --git a/modules/terraform-zpa-service-edge-group/README.md b/modules/terraform-zpa-service-edge-group/README.md index 1a84b74..336c2f4 100644 --- a/modules/terraform-zpa-service-edge-group/README.md +++ b/modules/terraform-zpa-service-edge-group/README.md @@ -8,13 +8,13 @@ This module provides the resources necessary to create a new ZPA Service Edge Gr | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 0.13.7, < 2.0.0 | -| [zpa](#requirement\_zpa) | ~> 3.31.0 | +| [zpa](#requirement\_zpa) | ~> 3 | ## Providers | Name | Version | |------|---------| -| [zpa](#provider\_zpa) | ~> 3.31.0 | +| [zpa](#provider\_zpa) | ~> 3 | ## Modules diff --git a/modules/terraform-zpa-service-edge-group/versions.tf b/modules/terraform-zpa-service-edge-group/versions.tf index 07f0e32..f0df7b7 100755 --- a/modules/terraform-zpa-service-edge-group/versions.tf +++ b/modules/terraform-zpa-service-edge-group/versions.tf @@ -2,7 +2,7 @@ terraform { required_providers { zpa = { source = "zscaler/zpa" - version = "~> 3.31.0" + version = "~> 3" } } required_version = ">= 0.13.7, < 2.0.0" diff --git a/modules/terraform-zpse-vm-azure/README.md b/modules/terraform-zpse-vm-azure/README.md index cc86d59..5c3a53e 100644 --- a/modules/terraform-zpse-vm-azure/README.md +++ b/modules/terraform-zpse-vm-azure/README.md @@ -38,6 +38,7 @@ No modules. |------|------| | [azurerm_availability_set.pse_availability_set](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/availability_set) | resource | | [azurerm_linux_virtual_machine.pse_vm](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/linux_virtual_machine) | resource | +| [azurerm_marketplace_agreement.zs_image_agreement](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/marketplace_agreement) | resource | | [azurerm_network_interface.pse_nic](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/network_interface) | resource | | [azurerm_network_interface_security_group_association.pse_nic_association](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/network_interface_security_group_association) | resource | @@ -53,8 +54,8 @@ No modules. | [pse\_subnet\_id](#input\_pse\_subnet\_id) | Private Service Edge subnet id | `list(string)` | n/a | yes | | [pse\_username](#input\_pse\_username) | Default Private Service Edge admin/root username | `string` | `"zpse-admin"` | no | | [psevm\_image\_offer](#input\_psevm\_image\_offer) | Azure Marketplace RHEL Image Offer | `string` | `"rh-rhel"` | no | -| [psevm\_image\_publisher](#input\_psevm\_image\_publisher) | Red Hat Inc | `string` | `"redhat"` | no | -| [psevm\_image\_sku](#input\_psevm\_image\_sku) | Azure Marketplace RHEL Image SKU | `string` | `"rh-rhel9-gen1"` | no | +| [psevm\_image\_publisher](#input\_psevm\_image\_publisher) | Red Hat Inc | `string` | `"RedHat"` | no | +| [psevm\_image\_sku](#input\_psevm\_image\_sku) | Azure Marketplace RHEL Image SKU | `string` | `"rh-rhel9"` | no | | [psevm\_image\_version](#input\_psevm\_image\_version) | Azure Marketplace RHEL Image Version | `string` | `"latest"` | no | | [psevm\_instance\_type](#input\_psevm\_instance\_type) | Private Service Edge Image size | `string` | `"Standard_D2s_v3"` | no | | [resource\_group](#input\_resource\_group) | Main Resource Group Name | `string` | n/a | yes | diff --git a/modules/terraform-zpse-vm-azure/main.tf b/modules/terraform-zpse-vm-azure/main.tf index 022df38..4d8d538 100755 --- a/modules/terraform-zpse-vm-azure/main.tf +++ b/modules/terraform-zpse-vm-azure/main.tf @@ -30,6 +30,15 @@ resource "azurerm_network_interface_security_group_association" "pse_nic_associa depends_on = [azurerm_network_interface.pse_nic] } +################################################################################ +# Make sure that ZPA App Connector image terms have been accepted +################################################################################ +resource "azurerm_marketplace_agreement" "zs_image_agreement" { + offer = var.psevm_image_offer + plan = var.psevm_image_sku + publisher = var.psevm_image_publisher +} + ################################################################################ # Create App Connector VM @@ -77,7 +86,8 @@ resource "azurerm_linux_virtual_machine" "pse_vm" { tags = var.global_tags depends_on = [ - azurerm_network_interface_security_group_association.pse_nic_association + azurerm_network_interface_security_group_association.pse_nic_association, + azurerm_marketplace_agreement.zs_image_agreement ] } diff --git a/modules/terraform-zpse-vm-azure/variables.tf b/modules/terraform-zpse-vm-azure/variables.tf index d7553c2..fcc902f 100755 --- a/modules/terraform-zpse-vm-azure/variables.tf +++ b/modules/terraform-zpse-vm-azure/variables.tf @@ -63,7 +63,7 @@ variable "user_data" { variable "psevm_image_publisher" { type = string description = "Red Hat Inc" - default = "redhat" + default = "RedHat" } variable "psevm_image_offer" { @@ -75,7 +75,7 @@ variable "psevm_image_offer" { variable "psevm_image_sku" { type = string description = "Azure Marketplace RHEL Image SKU" - default = "rh-rhel9-gen1" + default = "rh-rhel9" } variable "psevm_image_version" {