From b67517be53f6bcd52523de0190fce44811c02c3b Mon Sep 17 00:00:00 2001 From: Sam Swerdlow Date: Mon, 21 Oct 2024 06:24:19 -0700 Subject: [PATCH] No public description PiperOrigin-RevId: 688112954 --- modules/s4/app.tf | 9 +++++---- modules/s4/ascs.tf | 4 ++-- modules/s4/db.tf | 20 +++++++++---------- modules/s4/variables.tf | 11 +---------- modules/s4_ha/app.tf | 17 ++++++++-------- modules/s4_ha/ascs.tf | 8 ++++---- modules/s4_ha/db.tf | 40 +++++++++++++++++++------------------- modules/s4_ha/variables.tf | 11 +---------- 8 files changed, 52 insertions(+), 68 deletions(-) diff --git a/modules/s4/app.tf b/modules/s4/app.tf index dde6ca4f..06f4d556 100644 --- a/modules/s4/app.tf +++ b/modules/s4/app.tf @@ -56,8 +56,9 @@ resource "google_compute_disk" "sapdapp11_export_interfaces" { } name = "${length(var.app_vm_names) > (0 + (count.index * 2)) ? var.app_vm_names[0 + (count.index * 2)] : "${var.vm_prefix}app1${1 + (count.index * 2)}"}-export-interfaces" project = data.google_project.sap-project.project_id - provisioned_iops = var.app_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (var.disk_size_map["app_disk_export_interfaces_size"] != 0 ? var.disk_size_map["app_disk_export_interfaces_size"] : var.app_disk_export_interfaces_size)) : null - size = (var.disk_size_map["app_disk_export_interfaces_size"] != 0 ? var.disk_size_map["app_disk_export_interfaces_size"] : var.app_disk_export_interfaces_size) + provisioned_iops = var.app_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (lookup(var.disk_size_map, "app_disk_export_interfaces_size", var.app_disk_export_interfaces_size))) : null + size = lookup(var.disk_size_map, "app_disk_export_interfaces_size", var.app_disk_export_interfaces_size) + timeouts { create = "1h" delete = "1h" @@ -74,8 +75,8 @@ resource "google_compute_disk" "sapdapp11_usr_sap" { } name = "${length(var.app_vm_names) > (0 + (count.index * 2)) ? var.app_vm_names[0 + (count.index * 2)] : "${var.vm_prefix}app1${1 + (count.index * 2)}"}-usr-sap" project = data.google_project.sap-project.project_id - provisioned_iops = var.app_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (var.disk_size_map["app_disk_usr_sap_size"] != 0 ? var.disk_size_map["app_disk_usr_sap_size"] : var.app_disk_usr_sap_size)) : null - size = (var.disk_size_map["app_disk_usr_sap_size"] != 0 ? var.disk_size_map["app_disk_usr_sap_size"] : var.app_disk_usr_sap_size) + provisioned_iops = var.app_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (lookup(var.disk_size_map, "app_disk_usr_sap_size", var.app_disk_usr_sap_size))) : null + size = lookup(var.disk_size_map, "app_disk_usr_sap_size", var.app_disk_usr_sap_size) timeouts { create = "1h" delete = "1h" diff --git a/modules/s4/ascs.tf b/modules/s4/ascs.tf index ff204a81..e6ccaa17 100644 --- a/modules/s4/ascs.tf +++ b/modules/s4/ascs.tf @@ -53,8 +53,8 @@ resource "google_compute_disk" "sapdascs11_usr_sap" { } name = "${length(var.ascs_vm_names) > 0 ? var.ascs_vm_names[0] : "${var.vm_prefix}ascs11"}-usr-sap" project = data.google_project.sap-project.project_id - provisioned_iops = var.ascs_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (var.disk_size_map["ascs_disk_usr_sap_size"] != 0 ? var.disk_size_map["ascs_disk_usr_sap_size"] : var.ascs_disk_usr_sap_size)) : null - size = (var.disk_size_map["ascs_disk_usr_sap_size"] != 0 ? var.disk_size_map["ascs_disk_usr_sap_size"] : var.ascs_disk_usr_sap_size) + provisioned_iops = var.ascs_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (lookup(var.disk_size_map, "ascs_disk_usr_sap_size", var.ascs_disk_usr_sap_size))) : null + size = lookup(var.disk_size_map, "ascs_disk_usr_sap_size", var.ascs_disk_usr_sap_size) timeouts { create = "1h" delete = "1h" diff --git a/modules/s4/db.tf b/modules/s4/db.tf index f5e4295e..192d6f3c 100644 --- a/modules/s4/db.tf +++ b/modules/s4/db.tf @@ -57,8 +57,8 @@ resource "google_compute_disk" "sapddb11_hana_data" { } name = "${length(var.db_vm_names) > 0 ? var.db_vm_names[0] : "${var.vm_prefix}db11"}-hana-data-${count.index}" project = data.google_project.sap-project.project_id - provisioned_iops = var.db_data_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (var.disk_size_map["db_disk_hana_data_size"] != 0 ? var.disk_size_map["db_disk_hana_data_size"] : var.db_disk_hana_data_size)) / var.number_data_disks : null - size = (var.disk_size_map["db_disk_hana_data_size"] != 0 ? var.disk_size_map["db_disk_hana_data_size"] : var.db_disk_hana_data_size) / var.number_data_disks + provisioned_iops = var.db_data_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (lookup(var.disk_size_map, "db_disk_hana_data_size", var.db_disk_hana_data_size))) / var.number_data_disks : null + size = lookup(var.disk_size_map, "db_disk_hana_data_size", var.db_disk_hana_data_size) / var.number_data_disks timeouts { create = "1h" delete = "1h" @@ -75,8 +75,8 @@ resource "google_compute_disk" "sapddb11_hana_log" { } name = "${length(var.db_vm_names) > 0 ? var.db_vm_names[0] : "${var.vm_prefix}db11"}-hana-log-${count.index}" project = data.google_project.sap-project.project_id - provisioned_iops = var.db_log_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (var.disk_size_map["db_disk_hana_log_size"] != 0 ? var.disk_size_map["db_disk_hana_log_size"] : var.db_disk_hana_log_size)) / var.number_log_disks : null - size = (var.disk_size_map["db_disk_hana_log_size"] != 0 ? var.disk_size_map["db_disk_hana_log_size"] : var.db_disk_hana_log_size) / var.number_log_disks + provisioned_iops = var.db_log_disk_type == "hyperdisk-extreme" ? max(10000, 2 * lookup(var.disk_size_map, "db_disk_hana_log_size", var.db_disk_hana_log_size)) / var.number_log_disks : null + size = lookup(var.disk_size_map, "db_disk_hana_log_size", var.db_disk_hana_log_size) / var.number_log_disks timeouts { create = "1h" delete = "1h" @@ -92,8 +92,8 @@ resource "google_compute_disk" "sapddb11_hana_shared" { } name = "${length(var.db_vm_names) > 0 ? var.db_vm_names[0] : "${var.vm_prefix}db11"}-hana-shared" project = data.google_project.sap-project.project_id - provisioned_iops = var.db_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (var.disk_size_map["db_disk_hana_shared_size"] != 0 ? var.disk_size_map["db_disk_hana_shared_size"] : var.db_disk_hana_shared_size)) : null - size = (var.disk_size_map["db_disk_hana_shared_size"] != 0 ? var.disk_size_map["db_disk_hana_shared_size"] : var.db_disk_hana_shared_size) + provisioned_iops = var.db_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (lookup(var.disk_size_map, "db_disk_hana_shared_size", var.db_disk_hana_shared_size))) : null + size = lookup(var.disk_size_map, "db_disk_hana_shared_size", var.db_disk_hana_shared_size) timeouts { create = "1h" delete = "1h" @@ -109,8 +109,8 @@ resource "google_compute_disk" "sapddb11_hanabackup" { } name = "${length(var.db_vm_names) > 0 ? var.db_vm_names[0] : "${var.vm_prefix}db11"}-hanabackup" project = data.google_project.sap-project.project_id - provisioned_iops = var.db_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (var.disk_size_map["db_disk_backup_size"] != 0 ? var.disk_size_map["db_disk_backup_size"] : var.db_disk_backup_size)) : null - size = (var.disk_size_map["db_disk_backup_size"] != 0 ? var.disk_size_map["db_disk_backup_size"] : var.db_disk_backup_size) + provisioned_iops = var.db_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (lookup(var.disk_size_map, "db_disk_backup_size", var.db_disk_backup_size))) : null + size = lookup(var.disk_size_map, "db_disk_backup_size", var.db_disk_backup_size) timeouts { create = "1h" delete = "1h" @@ -126,8 +126,8 @@ resource "google_compute_disk" "sapddb11_usr_sap" { } name = "${length(var.db_vm_names) > 0 ? var.db_vm_names[0] : "${var.vm_prefix}db11"}-usr-sap" project = data.google_project.sap-project.project_id - provisioned_iops = var.db_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (var.disk_size_map["db_disk_usr_sap_size"] != 0 ? var.disk_size_map["db_disk_usr_sap_size"] : var.db_disk_usr_sap_size)) : null - size = (var.disk_size_map["db_disk_usr_sap_size"] != 0 ? var.disk_size_map["db_disk_usr_sap_size"] : var.db_disk_usr_sap_size) + provisioned_iops = var.db_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (lookup(var.disk_size_map, "db_disk_usr_sap_size", var.db_disk_usr_sap_size))) : null + size = lookup(var.disk_size_map, "db_disk_usr_sap_size", var.db_disk_usr_sap_size) timeouts { create = "1h" delete = "1h" diff --git a/modules/s4/variables.tf b/modules/s4/variables.tf index e2375723..7b385303 100644 --- a/modules/s4/variables.tf +++ b/modules/s4/variables.tf @@ -423,16 +423,7 @@ variable "zone1_name" { } variable "disk_size_map" { - default = { - app_disk_export_interfaces_size = 0 - app_disk_usr_sap_size = 0 - ascs_disk_usr_sap_size = 0 - db_disk_backup_size = 0 - db_disk_hana_data_size = 0 - db_disk_hana_log_size = 0 - db_disk_hana_shared_size = 0 - db_disk_usr_sap_size = 0 - } + default = {} description = "disk_size_map" type = map(number) } diff --git a/modules/s4_ha/app.tf b/modules/s4_ha/app.tf index bc146b36..1a67ef27 100644 --- a/modules/s4_ha/app.tf +++ b/modules/s4_ha/app.tf @@ -65,8 +65,8 @@ resource "google_compute_disk" "sapdapp11_export_interfaces" { } name = "${length(var.app_vm_names) > (0 + (count.index * 2)) ? var.app_vm_names[0 + (count.index * 2)] : "${var.vm_prefix}app1${1 + (count.index * 2)}"}-export-interfaces" project = data.google_project.sap-project.project_id - provisioned_iops = var.app_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (var.disk_size_map["app_disk_export_interfaces_size"] != 0 ? var.disk_size_map["app_disk_export_interfaces_size"] : var.app_disk_export_interfaces_size)) : null - size = var.disk_size_map["app_disk_export_interfaces_size"] != 0 ? var.disk_size_map["app_disk_export_interfaces_size"] : var.app_disk_export_interfaces_size + provisioned_iops = var.app_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (lookup(var.disk_size_map, "app_disk_export_interfaces_size", var.app_disk_export_interfaces_size))) : null + size = lookup(var.disk_size_map, "app_disk_export_interfaces_size", var.app_disk_export_interfaces_size) timeouts { create = "1h" delete = "1h" @@ -83,8 +83,8 @@ resource "google_compute_disk" "sapdapp11_usr_sap" { } name = "${length(var.app_vm_names) > (0 + (count.index * 2)) ? var.app_vm_names[0 + (count.index * 2)] : "${var.vm_prefix}app1${1 + (count.index * 2)}"}-usr-sap" project = data.google_project.sap-project.project_id - provisioned_iops = var.app_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (var.disk_size_map["app_disk_usr_sap_size"] != 0 ? var.disk_size_map["app_disk_usr_sap_size"] : var.app_disk_usr_sap_size)) : null - size = (var.disk_size_map["app_disk_usr_sap_size"] != 0 ? var.disk_size_map["app_disk_usr_sap_size"] : var.app_disk_usr_sap_size) + provisioned_iops = var.app_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (lookup(var.disk_size_map, "app_disk_usr_sap_size", var.app_disk_usr_sap_size))) : null + size = lookup(var.disk_size_map, "app_disk_usr_sap_size", var.app_disk_usr_sap_size) timeouts { create = "1h" delete = "1h" @@ -119,8 +119,9 @@ resource "google_compute_disk" "sapdapp12_export_interfaces" { } name = "${length(var.app_vm_names) > (1 + (count.index * 2)) ? var.app_vm_names[1 + (count.index * 2)] : "${var.vm_prefix}app1${2 + (count.index * 2)}"}-export-interfaces" project = data.google_project.sap-project.project_id - provisioned_iops = var.app_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (var.disk_size_map["app_disk_export_interfaces_size"] != 0 ? var.disk_size_map["app_disk_export_interfaces_size"] : var.app_disk_export_interfaces_size)) : null - size = (var.disk_size_map["app_disk_export_interfaces_size"] != 0 ? var.disk_size_map["app_disk_export_interfaces_size"] : var.app_disk_export_interfaces_size) + provisioned_iops = var.app_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (lookup(var.disk_size_map, "app_disk_export_interfaces_size", var.app_disk_export_interfaces_size))) : null + size = lookup(var.disk_size_map, "app_disk_export_interfaces_size", var.app_disk_export_interfaces_size) + timeouts { create = "1h" delete = "1h" @@ -137,8 +138,8 @@ resource "google_compute_disk" "sapdapp12_usr_sap" { } name = "${length(var.app_vm_names) > (1 + (count.index * 2)) ? var.app_vm_names[1 + (count.index * 2)] : "${var.vm_prefix}app1${2 + (count.index * 2)}"}-usr-sap" project = data.google_project.sap-project.project_id - provisioned_iops = var.app_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (var.disk_size_map["app_disk_usr_sap_size"] != 0 ? var.disk_size_map["app_disk_usr_sap_size"] : var.app_disk_usr_sap_size)) : null - size = (var.disk_size_map["app_disk_usr_sap_size"] != 0 ? var.disk_size_map["app_disk_usr_sap_size"] : var.app_disk_usr_sap_size) + provisioned_iops = var.app_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (lookup(var.disk_size_map, "app_disk_usr_sap_size", var.app_disk_usr_sap_size))) : null + size = lookup(var.disk_size_map, "app_disk_usr_sap_size", var.app_disk_usr_sap_size) timeouts { create = "1h" delete = "1h" diff --git a/modules/s4_ha/ascs.tf b/modules/s4_ha/ascs.tf index 7bed23dc..b7b8790c 100644 --- a/modules/s4_ha/ascs.tf +++ b/modules/s4_ha/ascs.tf @@ -61,8 +61,8 @@ resource "google_compute_disk" "sapdascs11_usr_sap" { } name = "${length(var.ascs_vm_names) > 0 ? var.ascs_vm_names[0] : "${var.vm_prefix}ascs11"}-usr-sap" project = data.google_project.sap-project.project_id - provisioned_iops = var.ascs_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (var.disk_size_map["ascs_disk_usr_sap_size"] != 0 ? var.disk_size_map["ascs_disk_usr_sap_size"] : var.ascs_disk_usr_sap_size)) : null - size = (var.disk_size_map["ascs_disk_usr_sap_size"] != 0 ? var.disk_size_map["ascs_disk_usr_sap_size"] : var.ascs_disk_usr_sap_size) + provisioned_iops = var.ascs_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (lookup(var.disk_size_map, "ascs_disk_usr_sap_size", var.ascs_disk_usr_sap_size))) : null + size = lookup(var.disk_size_map, "ascs_disk_usr_sap_size", var.ascs_disk_usr_sap_size) timeouts { create = "1h" delete = "1h" @@ -95,8 +95,8 @@ resource "google_compute_disk" "sapdascs12_usr_sap" { } name = "${length(var.ascs_vm_names) > 1 ? var.ascs_vm_names[1] : "${var.vm_prefix}ascs12"}-usr-sap" project = data.google_project.sap-project.project_id - provisioned_iops = var.ascs_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (var.disk_size_map["ascs_disk_usr_sap_size"] != 0 ? var.disk_size_map["ascs_disk_usr_sap_size"] : var.ascs_disk_usr_sap_size)) : null - size = (var.disk_size_map["ascs_disk_usr_sap_size"] != 0 ? var.disk_size_map["ascs_disk_usr_sap_size"] : var.ascs_disk_usr_sap_size) + provisioned_iops = var.ascs_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (lookup(var.disk_size_map, "ascs_disk_usr_sap_size", var.ascs_disk_usr_sap_size))) : null + size = lookup(var.disk_size_map, "ascs_disk_usr_sap_size", var.ascs_disk_usr_sap_size) timeouts { create = "1h" delete = "1h" diff --git a/modules/s4_ha/db.tf b/modules/s4_ha/db.tf index f3421d23..55f63312 100644 --- a/modules/s4_ha/db.tf +++ b/modules/s4_ha/db.tf @@ -66,8 +66,8 @@ resource "google_compute_disk" "sapddb11_hana_data" { } name = "${length(var.db_vm_names) > 0 ? var.db_vm_names[0] : "${var.vm_prefix}db11"}-hana-data-${count.index}" project = data.google_project.sap-project.project_id - provisioned_iops = var.db_data_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (var.disk_size_map["db_disk_hana_data_size"] != 0 ? var.disk_size_map["db_disk_hana_data_size"] : var.db_disk_hana_data_size)) / var.number_data_disks : null - size = (var.disk_size_map["db_disk_hana_data_size"] != 0 ? var.disk_size_map["db_disk_hana_data_size"] : var.db_disk_hana_data_size) / var.number_data_disks + provisioned_iops = var.db_data_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (lookup(var.disk_size_map, "db_disk_hana_data_size", var.db_disk_hana_data_size))) / var.number_data_disks : null + size = lookup(var.disk_size_map, "db_disk_hana_data_size", var.db_disk_hana_data_size) / var.number_data_disks timeouts { create = "1h" delete = "1h" @@ -84,8 +84,8 @@ resource "google_compute_disk" "sapddb11_hana_log" { } name = "${length(var.db_vm_names) > 0 ? var.db_vm_names[0] : "${var.vm_prefix}db11"}-hana-log-${count.index}" project = data.google_project.sap-project.project_id - provisioned_iops = var.db_log_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (var.disk_size_map["db_disk_hana_log_size"] != 0 ? var.disk_size_map["db_disk_hana_log_size"] : var.db_disk_hana_log_size)) / var.number_log_disks : null - size = (var.disk_size_map["db_disk_hana_log_size"] != 0 ? var.disk_size_map["db_disk_hana_log_size"] : var.db_disk_hana_log_size) / var.number_log_disks + provisioned_iops = var.db_log_disk_type == "hyperdisk-extreme" ? max(10000, 2 * lookup(var.disk_size_map, "db_disk_hana_log_size", var.db_disk_hana_log_size)) / var.number_log_disks : null + size = lookup(var.disk_size_map, "db_disk_hana_log_size", var.db_disk_hana_log_size) / var.number_log_disks timeouts { create = "1h" delete = "1h" @@ -101,8 +101,8 @@ resource "google_compute_disk" "sapddb11_hana_shared" { } name = "${length(var.db_vm_names) > 0 ? var.db_vm_names[0] : "${var.vm_prefix}db11"}-hana-shared" project = data.google_project.sap-project.project_id - provisioned_iops = var.db_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (var.disk_size_map["db_disk_hana_shared_size"] != 0 ? var.disk_size_map["db_disk_hana_shared_size"] : var.db_disk_hana_shared_size)) : null - size = (var.disk_size_map["db_disk_hana_shared_size"] != 0 ? var.disk_size_map["db_disk_hana_shared_size"] : var.db_disk_hana_shared_size) + provisioned_iops = var.db_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (lookup(var.disk_size_map, "db_disk_hana_shared_size", var.db_disk_hana_shared_size))) : null + size = lookup(var.disk_size_map, "db_disk_hana_shared_size", var.db_disk_hana_shared_size) timeouts { create = "1h" delete = "1h" @@ -118,8 +118,8 @@ resource "google_compute_disk" "sapddb11_hanabackup" { } name = "${length(var.db_vm_names) > 0 ? var.db_vm_names[0] : "${var.vm_prefix}db11"}-hanabackup" project = data.google_project.sap-project.project_id - provisioned_iops = var.db_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (var.disk_size_map["db_disk_backup_size"] != 0 ? var.disk_size_map["db_disk_backup_size"] : var.db_disk_backup_size)) : null - size = (var.disk_size_map["db_disk_backup_size"] != 0 ? var.disk_size_map["db_disk_backup_size"] : var.db_disk_backup_size) + provisioned_iops = var.db_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (lookup(var.disk_size_map, "db_disk_backup_size", var.db_disk_backup_size))) : null + size = lookup(var.disk_size_map, "db_disk_backup_size", var.db_disk_backup_size) timeouts { create = "1h" delete = "1h" @@ -135,8 +135,8 @@ resource "google_compute_disk" "sapddb11_usr_sap" { } name = "${length(var.db_vm_names) > 0 ? var.db_vm_names[0] : "${var.vm_prefix}db11"}-usr-sap" project = data.google_project.sap-project.project_id - provisioned_iops = var.db_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (var.disk_size_map["db_disk_usr_sap_size"] != 0 ? var.disk_size_map["db_disk_usr_sap_size"] : var.db_disk_usr_sap_size)) : null - size = (var.disk_size_map["db_disk_usr_sap_size"] != 0 ? var.disk_size_map["db_disk_usr_sap_size"] : var.db_disk_usr_sap_size) + provisioned_iops = var.db_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (lookup(var.disk_size_map, "db_disk_usr_sap_size", var.db_disk_usr_sap_size))) : null + size = lookup(var.disk_size_map, "db_disk_usr_sap_size", var.db_disk_usr_sap_size) timeouts { create = "1h" delete = "1h" @@ -170,8 +170,8 @@ resource "google_compute_disk" "sapddb12_hana_data" { } name = "${length(var.db_vm_names) > 1 ? var.db_vm_names[1] : "${var.vm_prefix}db12"}-hana-data-${count.index}" project = data.google_project.sap-project.project_id - provisioned_iops = var.db_data_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (var.disk_size_map["db_disk_hana_data_size"] != 0 ? var.disk_size_map["db_disk_hana_data_size"] : var.db_disk_hana_data_size)) / var.number_data_disks : null - size = (var.disk_size_map["db_disk_hana_data_size"] != 0 ? var.disk_size_map["db_disk_hana_data_size"] : var.db_disk_hana_data_size) / var.number_data_disks + provisioned_iops = var.db_data_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (lookup(var.disk_size_map, "db_disk_hana_data_size", var.db_disk_hana_data_size))) / var.number_data_disks : null + size = lookup(var.disk_size_map, "db_disk_hana_data_size", var.db_disk_hana_data_size) / var.number_data_disks timeouts { create = "1h" delete = "1h" @@ -188,8 +188,8 @@ resource "google_compute_disk" "sapddb12_hana_log" { } name = "${length(var.db_vm_names) > 1 ? var.db_vm_names[1] : "${var.vm_prefix}db12"}-hana-log-${count.index}" project = data.google_project.sap-project.project_id - provisioned_iops = var.db_log_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (var.disk_size_map["db_disk_hana_log_size"] != 0 ? var.disk_size_map["db_disk_hana_log_size"] : var.db_disk_hana_log_size)) / var.number_log_disks : null - size = (var.disk_size_map["db_disk_hana_log_size"] != 0 ? var.disk_size_map["db_disk_hana_log_size"] : var.db_disk_hana_log_size) / var.number_log_disks + provisioned_iops = var.db_log_disk_type == "hyperdisk-extreme" ? max(10000, 2 * lookup(var.disk_size_map, "db_disk_hana_log_size", var.db_disk_hana_log_size)) / var.number_log_disks : null + size = lookup(var.disk_size_map, "db_disk_hana_log_size", var.db_disk_hana_log_size) / var.number_log_disks timeouts { create = "1h" delete = "1h" @@ -205,8 +205,8 @@ resource "google_compute_disk" "sapddb12_hana_shared" { } name = "${length(var.db_vm_names) > 1 ? var.db_vm_names[1] : "${var.vm_prefix}db12"}-hana-shared" project = data.google_project.sap-project.project_id - provisioned_iops = var.db_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (var.disk_size_map["db_disk_hana_shared_size"] != 0 ? var.disk_size_map["db_disk_hana_shared_size"] : var.db_disk_hana_shared_size)) : null - size = (var.disk_size_map["db_disk_hana_shared_size"] != 0 ? var.disk_size_map["db_disk_hana_shared_size"] : var.db_disk_hana_shared_size) + provisioned_iops = var.db_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (lookup(var.disk_size_map, "db_disk_hana_shared_size", var.db_disk_hana_shared_size))) : null + size = lookup(var.disk_size_map, "db_disk_hana_shared_size", var.db_disk_hana_shared_size) timeouts { create = "1h" delete = "1h" @@ -222,8 +222,8 @@ resource "google_compute_disk" "sapddb12_hanabackup" { } name = "${length(var.db_vm_names) > 1 ? var.db_vm_names[1] : "${var.vm_prefix}db12"}-hanabackup" project = data.google_project.sap-project.project_id - provisioned_iops = var.db_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (var.disk_size_map["db_disk_backup_size"] != 0 ? var.disk_size_map["db_disk_backup_size"] : var.db_disk_backup_size)) : null - size = (var.disk_size_map["db_disk_backup_size"] != 0 ? var.disk_size_map["db_disk_backup_size"] : var.db_disk_backup_size) + provisioned_iops = var.db_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (lookup(var.disk_size_map, "db_disk_backup_size", var.db_disk_backup_size))) : null + size = lookup(var.disk_size_map, "db_disk_backup_size", var.db_disk_backup_size) timeouts { create = "1h" delete = "1h" @@ -239,8 +239,8 @@ resource "google_compute_disk" "sapddb12_usr_sap" { } name = "${length(var.db_vm_names) > 1 ? var.db_vm_names[1] : "${var.vm_prefix}db12"}-usr-sap" project = data.google_project.sap-project.project_id - provisioned_iops = var.db_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (var.disk_size_map["db_disk_usr_sap_size"] != 0 ? var.disk_size_map["db_disk_usr_sap_size"] : var.db_disk_usr_sap_size)) : null - size = (var.disk_size_map["db_disk_usr_sap_size"] != 0 ? var.disk_size_map["db_disk_usr_sap_size"] : var.db_disk_usr_sap_size) + provisioned_iops = var.db_disk_type == "hyperdisk-extreme" ? max(10000, 2 * (lookup(var.disk_size_map, "db_disk_usr_sap_size", var.db_disk_usr_sap_size))) : null + size = lookup(var.disk_size_map, "db_disk_usr_sap_size", var.db_disk_usr_sap_size) timeouts { create = "1h" delete = "1h" diff --git a/modules/s4_ha/variables.tf b/modules/s4_ha/variables.tf index d7265ee5..c7170a22 100644 --- a/modules/s4_ha/variables.tf +++ b/modules/s4_ha/variables.tf @@ -453,16 +453,7 @@ variable "zone2_name" { variable "disk_size_map" { - default = { - app_disk_export_interfaces_size = 0 - app_disk_usr_sap_size = 0 - ascs_disk_usr_sap_size = 0 - db_disk_backup_size = 0 - db_disk_hana_data_size = 0 - db_disk_hana_log_size = 0 - db_disk_hana_shared_size = 0 - db_disk_usr_sap_size = 0 - } + default = {} description = "disk_size_map" type = map(number) }