Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions modules/common/common/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,15 @@ variable "vm_os_sku" {
type = string

validation {
# The '-gen2' SKUs are the value composed internally when hyper_v_generation = "V2";
# users pass the base SKU, so they are intentionally omitted from the error message.
condition = contains([
"sg-byol",
"sg-ngtp",
"sg-ngtx",
"sg-byol-gen2",
"sg-ngtp-gen2",
"sg-ngtx-gen2",
"mgmt-byol",
"mgmt-25"
], var.vm_os_sku)
Expand Down
1 change: 1 addition & 0 deletions modules/common/custom-image/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resource "azurerm_image" "custom_image" {
name = "custom-image"
location = var.location
resource_group_name = var.resource_group_name
hyper_v_generation = var.hyper_v_generation

os_disk {
os_type = "Linux"
Expand Down
10 changes: 10 additions & 0 deletions modules/common/custom-image/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,13 @@ variable "storage_type" {
error_message = "Variable [storage_type] must be one of 'Standard_LRS', 'Premium_LRS'."
}
}

variable "hyper_v_generation" {
description = "The Hyper-V generation of the custom image. Select V2 to create a Generation 2 image. Only applies when a custom image URI is provided. Changing this value forces a new image to be created."
type = string
default = "V1"
validation {
condition = contains(["V1", "V2"], var.hyper_v_generation)
error_message = "Variable [hyper_v_generation] must be one of 'V1', 'V2'."
}
}
1 change: 1 addition & 0 deletions modules/high-availability/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ Usage: `storage_account_deployment_mode = "None"`<br/>
| **os_version** | GAIA OS version. | string | "R8110";<br />"R8120";<br />"R82";<br />"R8210"; | N/A | Yes |
| **vm_os_sku** | A SKU of the image to be deployed. | string | "sg-byol" - BYOL license;<br />"sg-ngtp" - NGTP PAYG license;<br />"sg-ngtx" - NGTX PAYG license; | N/A | Yes |
| **vm_os_offer** | The name of the image offer to be deployed. | string | "check-point-cg-r8110";<br />"check-point-cg-r8120";<br />"check-point-cg-r82";<br />"check-point-cg-r8210"; | N/A | Yes |
| **hyper_v_generation** | The Hyper-V generation of the virtual machine. Set to 'V2' to deploy a Generation 2 VM, or 'V1' for Generation 1. 'V2' is supported on Gaia version R82.10 or later. | string | "V1";<br />"V2"; | "V1" | No |
| **allow_upload_download** | Automatically download Blade Contracts and other important data. Improve product experience by sending data to Check Point. | boolean | true;<br />false; | N/A | Yes |
| **admin_shell** | Enables selecting different admin shells. | string | /etc/cli.sh;<br />/bin/bash;<br />/bin/csh;<br />/bin/tcsh; | "/etc/cli.sh" | No |
| **bootstrap_script** | An optional script to run on the initial boot. | string | Bootstrap script example:<br />"touch /home/admin/bootstrap.txt; echo 'hello_world' > /home/admin/bootstrap.txt" | "" | No |
Expand Down
3 changes: 2 additions & 1 deletion modules/high-availability/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module "common" {
disk_size = var.disk_size
is_blink = var.is_blink
os_version = var.os_version
vm_os_sku = var.vm_os_sku
vm_os_sku = "${var.vm_os_sku}${var.hyper_v_generation == "V2" ? "-gen2" : ""}"
vm_os_offer = var.vm_os_offer
authentication_type = var.authentication_type
serial_console_password_hash = var.serial_console_password_hash
Expand Down Expand Up @@ -356,6 +356,7 @@ module "vm_boot_diagnostics_storage" {
module "custom_image" {
source = "../common/custom-image"
source_image_vhd_uri = var.source_image_vhd_uri
hyper_v_generation = var.hyper_v_generation
resource_group_name = module.common.resource_group_name
location = module.common.resource_group_location
storage_type = var.storage_account_type
Expand Down
14 changes: 14 additions & 0 deletions modules/high-availability/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,20 @@ variable "source_image_vhd_uri" {
default = "noCustomUri"
}

variable "hyper_v_generation" {
description = "The Hyper-V generation of the virtual machine. Set to 'V2' to deploy a Generation 2 VM, or 'V1' for Generation 1. 'V2' is supported on Gaia version R82.10 or later."
type = string
default = "V1"
validation {
condition = contains(["V1", "V2"], var.hyper_v_generation)
error_message = "Variable [hyper_v_generation] must be one of 'V1', 'V2'."
}
validation {
condition = var.hyper_v_generation != "V2" || var.source_image_vhd_uri != "noCustomUri" || !contains(["R8110", "R8120", "R82"], var.os_version)
error_message = "hyper_v_generation can be set to 'V2' only for a custom image, or for a marketplace image on Gaia version R82.10 or later."
}
}

variable "admin_username" {
description = "Administrator username of deployed VM. Due to Azure limitations 'notused' name can be used."
type = string
Expand Down
1 change: 1 addition & 0 deletions modules/single-gateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ Usage: `storage_account_deployment_mode = "None"`<br/>
| **os_version** | GAIA OS version. | string | "R8110";<br />"R8120";<br />"R82";<br />"R8210"; | N/A | Yes |
| **vm_os_sku** | A SKU of the image to be deployed. | string | "sg-byol" - BYOL license;<br />"sg-ngtp" - NGTP PAYG license;<br />"sg-ngtx" - NGTX PAYG license; | N/A | Yes |
| **vm_os_offer** | The name of the image offer to be deployed. | string | "check-point-cg-r8110";<br />"check-point-cg-r8120";<br />"check-point-cg-r82";<br />"check-point-cg-r8210"; | N/A | Yes |
| **hyper_v_generation** | The Hyper-V generation of the virtual machine. Set to 'V2' to deploy a Generation 2 VM, or 'V1' for Generation 1. 'V2' is supported on Gaia version R82.10 or later and is not supported with installation_type 'standalone'. | string | "V1";<br />"V2"; | "V1" | No |
| **allow_upload_download**| Automatically download Blade Contracts and other important data. Improve product experience by sending data to Check Point. | boolean | true;<br />false; | N/A | Yes |
| **admin_shell** | Enables selecting different admin shells. | string | /etc/cli.sh;<br />/bin/bash;<br />/bin/csh;<br />/bin/tcsh; | "/etc/cli.sh" | No |
| **bootstrap_script** | An optional script to run on the initial boot. | string | Bootstrap script example:<br />"touch /home/admin/bootstrap.txt; echo 'hello_world' > /home/admin/bootstrap.txt" | "" | No |
Expand Down
2 changes: 1 addition & 1 deletion modules/single-gateway/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ locals {
"losangeles" = ["westus"]
"perth" = ["australiaeast"]
}
vm_os_sku = var.installation_type == "standalone" ? "mgmt-byol" : var.vm_os_sku
vm_os_sku = "${var.installation_type == "standalone" ? "mgmt-byol" : var.vm_os_sku}${(var.hyper_v_generation == "V2" && var.installation_type != "standalone") ? "-gen2" : ""}"
is_blink = var.installation_type == "gateway"
template_name = var.enable_ipv6 ? "single_terraform_registry_dual_stack" : "single_terraform_registry"
}
1 change: 1 addition & 0 deletions modules/single-gateway/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ module "vm_boot_diagnostics_storage" {
module "custom_image" {
source = "../common/custom-image"
source_image_vhd_uri = var.source_image_vhd_uri
hyper_v_generation = var.hyper_v_generation
resource_group_name = module.common.resource_group_name
location = module.common.resource_group_location
storage_type = var.storage_account_type
Expand Down
14 changes: 14 additions & 0 deletions modules/single-gateway/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,20 @@ variable "source_image_vhd_uri" {
default = "noCustomUri"
}

variable "hyper_v_generation" {
description = "The Hyper-V generation of the virtual machine. Set to 'V2' to deploy a Generation 2 VM, or 'V1' for Generation 1. 'V2' is supported on Gaia version R82.10 or later and is not supported with installation_type 'standalone'."
type = string
default = "V1"
validation {
condition = contains(["V1", "V2"], var.hyper_v_generation)
error_message = "Variable [hyper_v_generation] must be one of 'V1', 'V2'."
}
validation {
condition = var.hyper_v_generation != "V2" || var.source_image_vhd_uri != "noCustomUri" || (!contains(["R8110", "R8120", "R82"], var.os_version) && var.installation_type != "standalone")
error_message = "hyper_v_generation can be set to 'V2' only for a custom image, or for a marketplace image on Gaia version R82.10 or later and not with installation_type 'standalone'."
}
}

variable "admin_username" {
description = "Administrator username of deployed VM. Due to Azure limitations 'notused' name can be used."
type = string
Expand Down
1 change: 1 addition & 0 deletions modules/vmss/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ For more information, refer to the [Azure Terraform documentation](https://regis
| **os_version** | GAIA OS version. | string | "R8110";<br />"R8120";<br />"R82";<br />"R8210"; | N/A | Yes |
| **vm_os_sku** | A SKU of the image to be deployed. | string | "sg-byol" - BYOL license;<br />"sg-ngtp" - NGTP PAYG license;<br />"sg-ngtx" - NGTX PAYG license; | N/A | Yes |
| **vm_os_offer** | The name of the image offer to be deployed. | string | "check-point-cg-r8110";<br />"check-point-cg-r8120";<br />"check-point-cg-r82";<br />"check-point-cg-r8210"; | N/A | Yes |
| **hyper_v_generation** | The Hyper-V generation of the virtual machine. Set to 'V2' to deploy a Generation 2 VM, or 'V1' for Generation 1. 'V2' is supported on Gaia version R82.10 or later. | string | "V1";<br />"V2"; | "V1" | No |
| **allow_upload_download** | Automatically download Blade Contracts and other important data. Improve product experience by sending data to Check Point. | boolean | true;<br />false; | N/A | Yes |
| **admin_shell** | Enables selecting different admin shells. | string | /etc/cli.sh;<br />/bin/bash;<br />/bin/csh;<br />/bin/tcsh; | "/etc/cli.sh" | No |
| **bootstrap_script** | An optional script to run on the initial boot. | string | Bootstrap script example:<br />"touch /home/admin/bootstrap.txt; echo 'hello_world' > /home/admin/bootstrap.txt" | "" | No |
Expand Down
3 changes: 2 additions & 1 deletion modules/vmss/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module "common" {
disk_size = var.disk_size
is_blink = var.is_blink
os_version = var.os_version
vm_os_sku = var.vm_os_sku
vm_os_sku = "${var.vm_os_sku}${var.hyper_v_generation == "V2" ? "-gen2" : ""}"
vm_os_offer = var.vm_os_offer
authentication_type = var.authentication_type
serial_console_password_hash = var.serial_console_password_hash
Expand Down Expand Up @@ -350,6 +350,7 @@ module "vm_boot_diagnostics_storage" {
module "custom_image" {
source = "../common/custom-image"
source_image_vhd_uri = var.source_image_vhd_uri
hyper_v_generation = var.hyper_v_generation
resource_group_name = module.common.resource_group_name
location = module.common.resource_group_location
tags = merge(lookup(var.tags, "custom-image", {}), lookup(var.tags, "all", {}))
Expand Down
14 changes: 14 additions & 0 deletions modules/vmss/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,20 @@ variable "source_image_vhd_uri" {
default = "noCustomUri"
}

variable "hyper_v_generation" {
description = "The Hyper-V generation of the virtual machine. Set to 'V2' to deploy a Generation 2 VM, or 'V1' for Generation 1. 'V2' is supported on Gaia version R82.10 or later."
type = string
default = "V1"
validation {
condition = contains(["V1", "V2"], var.hyper_v_generation)
error_message = "Variable [hyper_v_generation] must be one of 'V1', 'V2'."
}
validation {
condition = var.hyper_v_generation != "V2" || var.source_image_vhd_uri != "noCustomUri" || !contains(["R8110", "R8120", "R82"], var.os_version)
error_message = "hyper_v_generation can be set to 'V2' only for a custom image, or for a marketplace image on Gaia version R82.10 or later."
}
}

variable "admin_username" {
description = "Administrator username of deployed VM. Due to Azure limitations 'notused' name can be used."
type = string
Expand Down