Skip to content
Open
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Changes made to CheckpointSW repo forked on 2026-02-04

- allow use of existing resource group in `common`, `high-availability`, `managment`, `mds`, `single-gateway` and `vmss` modules. Default behaviour is not changed
5 changes: 5 additions & 0 deletions modules/common/common/locals.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
locals {
resource_group = var.resource_group_create
? azurerm_resource_group.resource_group[0]
: data.azurerm_resource_group.resource_group[0]
}
6 changes: 6 additions & 0 deletions modules/common/common/main.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
resource "azurerm_resource_group" "resource_group" {
count = var.resource_group_create ? 1 : 0
name = var.resource_group_name
location = var.location
tags = var.tags
}

data "azurerm_resource_group" "existing_resource_group" {
count = var.resource_group_create ? 0 : 1
name = var.resource_group_name
}

module "regions" {
source = "Azure/avm-utl-regions/azurerm"
version = "0.5.1"
Expand Down
8 changes: 4 additions & 4 deletions modules/common/common/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
output "resource_group_name" {
value = azurerm_resource_group.resource_group.name
value = local.resource_group.name
}

output "resource_group_id" {
value = azurerm_resource_group.resource_group.id
value = local.resource_group.id
}

output "resource_group_location" {
value = azurerm_resource_group.resource_group.location
value = local.resource_group.location
}

output "azurerm_resource_group_id" {
value = azurerm_resource_group.resource_group.id
value = local.resource_group.id
}

output "admin_username" {
Expand Down
13 changes: 13 additions & 0 deletions modules/common/common/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,25 @@ variable "resource_group_name" {
type = string
}

variable "existing_resource_group_name" {
description = "Azure Resource Group name to use if using an existing resource group; empty string creates resource_group_name rg"
type = string
default = ""

}

variable "resource_group_id" {
description = "Azure Resource Group ID to use."
type = string
default = ""
}

variable "resource_group_create" {
description = "Define if Azure Resource Group should be created"
type = bool
default = true
}

variable "location" {
description = "The location/region where resources will be created. The full list of Azure regions can be found at https://azure.microsoft.com/regions"
type = string
Expand Down
1 change: 1 addition & 0 deletions modules/high-availability/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ Usage: `storage_account_deployment_mode = "None"`<br/>
| **subscription_id** | The subscription ID is used to pay for Azure cloud services | string | N/A |
| **tenant_id** | The tenant ID of the Service Principal used to deploy the solution. | string | N/A |
| **resource_group_name** | The name of the resource group that will contain the contents of the deployment. | string | Resource group names only allow alphanumeric characters, periods, underscores, hyphens, and parentheses and cannot end in a period. |
| **resource_group_create** | Define if Azure Resource Group should be created | boolean | true;<br />false;<br />**Default:** true |
| **cluster_name** | The name of the Check Point Cluster Object. | string | Only alphanumeric characters are allowed, and the name must be 1-30 characters long. |
| **location** | The region where the resources will be deployed at. | string | The full list of Azure regions can be found at https://azure.microsoft.com/regions. |
| **tags** | Tags can be associated either globally across all resources or scoped to specific resource types. For example, a global tag can be defined as: {"all": {"example": "example"}}.<br/>Supported resource types for tag assignment include:<br>`all` (Applies tags universally to all resource instances)<br/>`resource-group`<br/>`virtual-network`<br/>`network-security-group`<br/>`network-interface`<br/>`public-ip`<br/>`public-ip-prefix`<br/>`load-balancer`<br/>`route-table`<br/>`storage-account`<br/>`virtual-machine`<br/>`custom-image`<br/>`availability-set`<br/>**Important:** When identical tag keys are defined both globally under `all` and within a specific resource scope, the tag value specified under `all` overrides the resource-specific tag. | map(map(string)) | **Defaults:** {} |
Expand Down
1 change: 1 addition & 0 deletions modules/high-availability/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
module "common" {
source = "../common/common"
resource_group_name = var.resource_group_name
resource_group_create = var.resource_group_create
location = var.location
is_zonal = var.availability_type == "Availability Zone"
availability_zones_num = tostring(length(var.availability_zones))
Expand Down
6 changes: 6 additions & 0 deletions modules/high-availability/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ variable "resource_group_name" {
type = string
}

variable "resource_group_create" {
description = "Define if Azure Resource Group should be created"
type = bool
default = true
}

variable "cluster_name" {
description = "Cluster name."
type = string
Expand Down
1 change: 1 addition & 0 deletions modules/management/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ Usage: `storage_account_deployment_mode = "None"`<br/>
| **tenant_id** | The tenant ID of the Service Principal used to deploy the solution | string | N/A |
| **subscription_id** | The subscription ID is used to pay for Azure cloud services | string | N/A |
| **resource_group_name** | The name of the resource group that will contain the contents of the deployment. | string | Resource group names only allow alphanumeric characters, periods, underscores, hyphens, and parenthesis and cannot end in a period. |
| **resource_group_create** | Define if Azure Resource Group should be created | boolean | true;<br />false;<br />**Default:** true |
| **mgmt_name** | Management name | string. | N/A |
| **location** | The region where the resources will be deployed. | string | The full list of Azure regions can be found at https://azure.microsoft.com/regions. |
| **tags** | Tags can be associated either globally across all resources or scoped to specific resource types. For example, a global tag can be defined as: {"all": {"example": "example"}}.<br/>Supported resource types for tag assignment include:<br>`all` (Applies tags universally to all resource instances)<br/>`resource-group`<br/>`virtual-network`<br/>`network-security-group`<br/>`network-interface`<br/>`public-ip`<br/>`route-table`<br/>`storage-account`<br/>`virtual-machine`<br/>`custom-image`<br/>**Important:** When identical tag keys are defined both globally under `all` and within a specific resource scope, the tag value specified under `all` overrides the resource-specific tag. | map(map(string)) | **Defaults:** {} |
Expand Down
1 change: 1 addition & 0 deletions modules/management/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
module "common" {
source = "../common/common"
resource_group_name = var.resource_group_name
resource_group_create = var.resource_group_create
location = var.location
is_zonal = var.zone != ""
availability_zones_num = "1"
Expand Down
6 changes: 6 additions & 0 deletions modules/management/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ variable "resource_group_name" {
type = string
}

variable "resource_group_create" {
description = "Define if Azure Resource Group should be created"
type = bool
default = true
}

variable "mgmt_name" {
description = "Management name."
type = string
Expand Down
1 change: 1 addition & 0 deletions modules/mds/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ Usage: `storage_account_deployment_mode = "None"`<br/>
| **tenant_id** | The tenant ID of the Service Principal used to deploy the solution | string | N/A |
| **subscription_id** | The subscription ID is used to pay for Azure cloud services | string | N/A |
| **resource_group_name** | The name of the resource group that will contain the contents of the deployment. | string | Resource group names only allow alphanumeric characters, periods, underscores, hyphens and parenthesis and cannot end in a period. |
| **resource_group_create** | Define if Azure Resource Group should be created | boolean | true;<br />false;<br />**Default:** true |
| **mds_name** | MDS name. | string | N/A |
| **location** | The region where the resources will be deployed at. | string | The full list of Azure regions can be found at https://azure.microsoft.com/regions. |
| **tags** | Tags can be associated either globally across all resources or scoped to specific resource types. For example, a global tag can be defined as: {"all": {"example": "example"}}.<br/>Supported resource types for tag assignment include:<br>`all` (Applies tags universally to all resource instances)<br/>`resource-group`<br/>`virtual-network`<br/>`network-security-group`<br/>`network-interface`<br/>`public-ip`<br/>`route-table`<br/>`storage-account`<br/>`virtual-machine`<br/>`custom-image`<br/>**Important:** When identical tag keys are defined both globally under `all` and within a specific resource scope, the tag value specified under `all` overrides the resource-specific tag. | map(map(string)) | **Default:** {} |
Expand Down
1 change: 1 addition & 0 deletions modules/mds/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
module "common" {
source = "../common/common"
resource_group_name = var.resource_group_name
resource_group_create = var.resource_group_create
location = var.location
is_zonal = var.zone != ""
availability_zones_num = "1"
Expand Down
6 changes: 6 additions & 0 deletions modules/mds/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ variable "resource_group_name" {
type = string
}

variable "resource_group_create" {
description = "Define if Azure Resource Group should be created"
type = bool
default = true
}

variable "mds_name" {
description = "MDS name."
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 @@ -122,6 +122,7 @@ Usage: `storage_account_deployment_mode = "None"`<br/>
| **tenant_id** | The tenant ID of the Service Principal used to deploy the solution | string | N/A |
| **subscription_id** | The subscription ID is used to pay for Azure cloud services | string | N/A |
| **resource_group_name** | The name of the resource group that will contain the contents of the deployment. | string | Resource group names only allow alphanumeric characters, periods, underscores, hyphens and parenthesis and cannot end in a period. |
| **resource_group_create** | Define if Azure Resource Group should be created | boolean | true;<br />false;<br />**Default:** true |
| **single_gateway_name** | The name of the Check Point single GW Object. | string | Only alphanumeric characters are allowed, and the name must be 1-30 characters long. |
| **location** | The region where the resources will be deployed at. | string | The full list of Azure regions can be found at https://azure.microsoft.com/regions. |
| **tags** | Tags can be associated either globally across all resources or scoped to specific resource types. For example, a global tag can be defined as: {"all": {"example": "example"}}.<br/>Supported resource types for tag assignment include:<br>`all` (Applies tags universally to all resource instances)<br/>`resource-group`<br/>`virtual-network`<br/>`network-security-group`<br/>`network-interface`<br/>`public-ip`<br/>`route-table`<br/>`storage-account`<br/>`virtual-machine`<br/>`custom-image`<br/>**Important:** When identical tag keys are defined both globally under `all` and within a specific resource scope, the tag value specified under `all` overrides the resource-specific tag. | map(map(string)) | **Default:** {} |
Expand Down
1 change: 1 addition & 0 deletions modules/single-gateway/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
module "common" {
source = "../common/common"
resource_group_name = var.resource_group_name
resource_group_create = var.resource_group_create
location = var.location
is_zonal = var.zone != ""
availability_zones_num = "1"
Expand Down
6 changes: 6 additions & 0 deletions modules/single-gateway/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ variable "resource_group_name" {
type = string
}

variable "resource_group_create" {
description = "Define if Azure Resource Group should be created"
type = bool
default = true
}

variable "single_gateway_name" {
description = "Single Gateway name."
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 @@ -170,6 +170,7 @@ For more information, refer to the official - [Checkout the Azure Terraform docu
| **tenant_id** | The tenant ID of the Service Principal used to deploy the solution | string | N/A |
| **subscription_id** | The subscription ID is used to pay for Azure cloud services | string | N/A |
| **resource_group_name** | The name of the resource group that will contain the contents of the deployment. | string | Resource group names only allow alphanumeric characters, periods, underscores, hyphens and parenthesis and cannot end in a period.<br />Note: Resource group name must not contain reserved words based on: sk40179. |
| **resource_group_create** | Define if Azure Resource Group should be created | boolean | true;<br />false;<br />**Default:** true |
| **vmss_name** | The name of the Check Point VMSS Object. | string | Only alphanumeric characters are allowed, and the name must be 1-30 characters long.<br />Note: VMSS name must not contain reserved words based on: sk40179. |
| **location** | The region where the resources will be deployed at. | string | The full list of Azure regions can be found at https://azure.microsoft.com/regions. |
| **tags** | Tags can be associated either globally across all resources or scoped to specific resource types. For example, a global tag can be defined as: {"all": {"example": "example"}}.<br/>Supported resource types for tag assignment include:<br>`all` (Applies tags universally to all resource instances)<br/>`resource-group`<br/>`virtual-network`<br/>`network-security-group`<br/>`network-interface`<br/>`public-ip`<br/>`public-ip-prefix`<br/>`load-balancer`<br/>`route-table`<br/>`storage-account`<br/>`virtual-machine-scale-set`<br/>`custom-image`<br/>`autoscale-setting`<br/>**Important:** When identical tag keys are defined both globally under `all` and within a specific resource scope, the tag value specified under `all` overrides the resource-specific tag. | map(map(string)) | **Default:** {} |
Expand Down
1 change: 1 addition & 0 deletions modules/vmss/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
module "common" {
source = "../common/common"
resource_group_name = var.resource_group_name
resource_group_create = var.resource_group_create
location = var.location
is_zonal = var.availability_zones_num != "0"
availability_zones_num = var.availability_zones_num
Expand Down
6 changes: 6 additions & 0 deletions modules/vmss/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ variable "resource_group_name" {
type = string
}

variable "resource_group_create" {
description = "Define if Azure Resource Group should be created"
type = bool
default = true
}

variable "vmss_name" {
description = "VMSS name."
type = string
Expand Down