Skip to content

Commit 35f8502

Browse files
chkp-natanelmchkp-avivm
authored andcommitted
VWAN | Added plan parameters
1 parent 7cdb545 commit 35f8502

File tree

4 files changed

+53
-6
lines changed

4 files changed

+53
-6
lines changed

modules/nva_into_existing_hub/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ data "http" "accept-marketplace-terms-existing-agreement" {
7272
resource "azurerm_marketplace_agreement" "accept-marketplace-terms" {
7373
count = can(jsondecode(data.http.accept-marketplace-terms-existing-agreement.response_body).id) ? (jsondecode(data.http.accept-marketplace-terms-existing-agreement.response_body).properties.state == "Active" ? 0 : 1) : 1
7474
publisher = "checkpoint"
75-
offer = "cp-vwan-managed-app"
75+
offer = var.plan_product
7676
plan = "vwan-app"
7777
}
7878

@@ -140,9 +140,9 @@ resource "azapi_resource" "managed-app" {
140140
kind = "MarketPlace",
141141
plan = {
142142
name = "vwan-app"
143-
product = "cp-vwan-managed-app"
143+
product = var.plan_product
144144
publisher = "checkpoint"
145-
version = "1.0.22"
145+
version = var.plan_version
146146
},
147147
identity = {
148148
type = "UserAssigned"

modules/nva_into_existing_hub/variables.tf

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,4 +195,26 @@ locals{
195195
is_both_params_used = length(var.existing-public-ip) > 0 && var.new-public-ip == "yes"
196196
validation_message_both = "Only one parameter of existing-public-ip or new-public-ip can be used"
197197
_ = regex("^$", (!local.is_both_params_used ? "" : local.validation_message_both))
198+
}
199+
200+
variable "plan_product" {
201+
description = "Use the following plan when deploying with terraform: cp-vwan-managed-app"
202+
type = string
203+
default = "cp-vwan-managed-app"
204+
}
205+
206+
variable "plan_version" {
207+
description = "Use the latest version of the managed application (e.g., 1.0.23) for best results. Full version list: https://support.checkpoint.com/results/sk/sk132192"
208+
type = string
209+
default = "1.0.23"
210+
}
211+
212+
variable "custom_license_type" {
213+
description = "License type when using staged image."
214+
type = string
215+
default = ""
216+
validation {
217+
condition = contains(["", "ngtp", "ngtx", "premium"], var.custom_license_type)
218+
error_message = "Valid options are 'ngtp', 'ngtx', or 'premium' or empty."
219+
}
198220
}

modules/nva_into_new_vwan/main.tf

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ data "http" "accept-marketplace-terms-existing-agreement" {
8282
resource "azurerm_marketplace_agreement" "accept-marketplace-terms" {
8383
count = can(jsondecode(data.http.accept-marketplace-terms-existing-agreement.response_body).id) ? (jsondecode(data.http.accept-marketplace-terms-existing-agreement.response_body).properties.state == "Active" ? 0 : 1) : 1
8484
publisher = "checkpoint"
85-
offer = "cp-vwan-managed-app"
85+
offer = var.plan_product
8686
plan = "vwan-app"
8787
}
8888

@@ -151,9 +151,9 @@ resource "azapi_resource" "managed-app" {
151151
kind = "MarketPlace",
152152
plan = {
153153
name = "vwan-app"
154-
product = "cp-vwan-managed-app"
154+
product = var.plan_product
155155
publisher = "checkpoint"
156-
version = "1.0.22"
156+
version = var.plan_version
157157
},
158158
identity = {
159159
type = "UserAssigned"
@@ -234,6 +234,9 @@ resource "azapi_resource" "managed-app" {
234234
},
235235
templateName = {
236236
value = "wan_terraform_registry"
237+
},
238+
customLicenseType = {
239+
value = var.custom_license_type
237240
}
238241
},
239242
managedResourceGroupId = "/subscriptions/${var.subscription_id}/resourcegroups/${var.nva-rg-name}"

modules/nva_into_new_vwan/variables.tf

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,4 +206,26 @@ locals{
206206
is_both_params_used = length(var.existing-public-ip) > 0 && var.new-public-ip == "yes"
207207
validation_message_both = "Only one parameter of existing-public-ip or new-public-ip can be used"
208208
_ = regex("^$", (!local.is_both_params_used ? "" : local.validation_message_both))
209+
}
210+
211+
variable "plan_product" {
212+
description = "Use the following plan when deploying with terraform: cp-vwan-managed-app"
213+
type = string
214+
default = "cp-vwan-managed-app"
215+
}
216+
217+
variable "plan_version" {
218+
description = "Use the latest version of the managed application (e.g., 1.0.23) for best results. Full version list: https://support.checkpoint.com/results/sk/sk132192"
219+
type = string
220+
default = "1.0.23"
221+
}
222+
223+
variable "custom_license_type" {
224+
description = "License type when using staged image."
225+
type = string
226+
default = ""
227+
validation {
228+
condition = contains(["", "ngtp", "ngtx", "premium"], var.custom_license_type)
229+
error_message = "Valid options are 'ngtp', 'ngtx', or 'premium' or empty."
230+
}
209231
}

0 commit comments

Comments
 (0)