Skip to content

Commit

Permalink
No public description
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 692986299
  • Loading branch information
dfellmeth-google authored and copybara-github committed Nov 4, 2024
1 parent e566242 commit 470dfcc
Show file tree
Hide file tree
Showing 24 changed files with 166 additions and 44 deletions.
4 changes: 2 additions & 2 deletions modules/s4/app.tf
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ resource "google_compute_instance" "sapdapp11" {
]
}
machine_type = var.app_machine_type
metadata = {
metadata = merge(var.custom_app_metadata, {
enable-oslogin = "FALSE"
ssh-keys = ""
}
})
min_cpu_platform = lookup(local.cpu_platform_map, var.app_machine_type, "Automatic")
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)}"
network_interface {
Expand Down
4 changes: 2 additions & 2 deletions modules/s4/ascs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ resource "google_compute_instance" "sapdascs11" {
]
}
machine_type = var.ascs_machine_type
metadata = {
metadata = merge(var.custom_ascs_metadata, {
enable-oslogin = "FALSE"
ssh-keys = ""
}
})
min_cpu_platform = lookup(local.cpu_platform_map, var.ascs_machine_type, "Automatic")
name = length(var.ascs_vm_names) > 0 ? var.ascs_vm_names[0] : "${var.vm_prefix}ascs11"
network_interface {
Expand Down
4 changes: 2 additions & 2 deletions modules/s4/db.tf
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ resource "google_compute_instance" "sapddb11" {
]
}
machine_type = var.db_machine_type
metadata = {
metadata = merge(var.custom_db_metadata, {
enable-oslogin = "FALSE"
ssh-keys = ""
}
})
min_cpu_platform = lookup(local.cpu_platform_map, var.db_machine_type, "Automatic")
name = length(var.db_vm_names) > 0 ? var.db_vm_names[0] : "${var.vm_prefix}db11"
network_interface {
Expand Down
17 changes: 17 additions & 0 deletions modules/s4/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -428,3 +428,20 @@ variable "disk_size_map" {
type = map(number)
}

variable "custom_app_metadata" {
type = map<string, string>
description = "Optional - default is empty. Custom metadata to be added to the app VMs."
default = {}
}

variable "custom_ascs_metadata" {
type = map<string, string>
description = "Optional - default is empty. Custom metadata to be added to the ASCS VMs."
default = {}
}

variable "custom_db_metadata" {
type = map<string, string>
description = "Optional - default is empty. Custom metadata to be added to the DB VMs."
default = {}
}
4 changes: 2 additions & 2 deletions modules/s4_ha/app.tf
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@ resource "google_compute_instance" "sapdapp11" {
]
}
machine_type = var.app_machine_type
metadata = {
metadata = merge(var.custom_app_metadata, {
enable-oslogin = "FALSE"
ssh-keys = ""
}
})
min_cpu_platform = lookup(local.cpu_platform_map, var.app_machine_type, "Automatic")
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)}"
network_interface {
Expand Down
8 changes: 4 additions & 4 deletions modules/s4_ha/ascs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ resource "google_compute_instance" "sapdascs11" {
]
}
machine_type = var.ascs_machine_type
metadata = {
metadata = merge(var.custom_ascs_metadata, {
enable-oslogin = "FALSE"
ssh-keys = ""
}
})
min_cpu_platform = lookup(local.cpu_platform_map, var.ascs_machine_type, "Automatic")
name = length(var.ascs_vm_names) > 0 ? var.ascs_vm_names[0] : "${var.vm_prefix}ascs11"
network_interface {
Expand Down Expand Up @@ -246,10 +246,10 @@ resource "google_compute_instance" "sapdascs12" {
]
}
machine_type = var.ascs_machine_type
metadata = {
metadata = merge(var.custom_ascs_metadata, {
enable-oslogin = "FALSE"
ssh-keys = ""
}
})
min_cpu_platform = lookup(local.cpu_platform_map, var.ascs_machine_type, "Automatic")
name = length(var.ascs_vm_names) > 1 ? var.ascs_vm_names[1] : "${var.vm_prefix}ascs12"
network_interface {
Expand Down
8 changes: 4 additions & 4 deletions modules/s4_ha/db.tf
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,10 @@ resource "google_compute_instance" "sapddb11" {
]
}
machine_type = var.db_machine_type
metadata = {
metadata = merge(var.custom_db_metadata, {
enable-oslogin = "FALSE"
ssh-keys = ""
}
})
min_cpu_platform = lookup(local.cpu_platform_map, var.db_machine_type, "Automatic")
name = length(var.db_vm_names) > 0 ? var.db_vm_names[0] : "${var.vm_prefix}db11"
network_interface {
Expand Down Expand Up @@ -398,10 +398,10 @@ resource "google_compute_instance" "sapddb12" {
]
}
machine_type = var.db_machine_type
metadata = {
metadata = merge(var.custom_db_metadata, {
enable-oslogin = "FALSE"
ssh-keys = ""
}
})
min_cpu_platform = lookup(local.cpu_platform_map, var.db_machine_type, "Automatic")
name = length(var.db_vm_names) > 1 ? var.db_vm_names[1] : "${var.vm_prefix}db12"
network_interface {
Expand Down
18 changes: 17 additions & 1 deletion modules/s4_ha/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -451,10 +451,26 @@ variable "zone2_name" {
type = string
}


variable "disk_size_map" {
default = {}
description = "disk_size_map"
type = map(number)
}

variable "custom_app_metadata" {
type = map<string, string>
description = "Optional - default is empty. Custom metadata to be added to the app VMs."
default = {}
}

variable "custom_ascs_metadata" {
type = map<string, string>
description = "Optional - default is empty. Custom metadata to be added to the ASCS VMs."
default = {}
}

variable "custom_db_metadata" {
type = map<string, string>
description = "Optional - default is empty. Custom metadata to be added to the DB VMs."
default = {}
}
4 changes: 2 additions & 2 deletions modules/sap_ase/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -240,13 +240,13 @@ resource "google_compute_instance" "sap_ase_instance" {
}
}

metadata = {
metadata = merge(var.custom_metadata, {
startup-script = local.primary_startup_url
post_deployment_script = var.post_deployment_script
sap_deployment_debug = var.sap_deployment_debug
sap_ase_sid = var.ase_sid
template-type = "TERRAFORM"
}
})

lifecycle {
# Ignore changes in the instance metadata, since it is modified by the SAP startup script.
Expand Down
6 changes: 6 additions & 0 deletions modules/sap_ase/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -227,3 +227,9 @@ variable "can_ip_forward" {
description = "Whether sending and receiving of packets with non-matching source or destination IPs is allowed."
default = true
}

variable "custom_metadata" {
type = map<string, string>
description = "Optional - default is empty. Custom metadata to be added to the VM."
default = {}
}
4 changes: 2 additions & 2 deletions modules/sap_db2/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,13 @@ resource "google_compute_instance" "sap_db2_instance" {
}
}

metadata = {
metadata = merge(var.custom_metadata, {
startup-script = local.primary_startup_url
post_deployment_script = var.post_deployment_script
sap_deployment_debug = var.sap_deployment_debug
sap_ibm_db2_sid = var.db2_sid
template-type = "TERRAFORM"
}
})

lifecycle {
# Ignore changes in the instance metadata, since it is modified by the SAP startup script.
Expand Down
6 changes: 6 additions & 0 deletions modules/sap_db2/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -237,3 +237,9 @@ variable "can_ip_forward" {
description = "Whether sending and receiving of packets with non-matching source or destination IPs is allowed."
default = true
}

variable "custom_metadata" {
type = map<string, string>
description = "Optional - default is empty. Custom metadata to be added to the VM."
default = {}
}
8 changes: 4 additions & 4 deletions modules/sap_hana/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ resource "google_compute_instance" "sap_hana_primary_instance" {
}
}

metadata = {
metadata = merge(var.custom_primary_metadata, {
startup-script = local.primary_startup_url
post_deployment_script = var.post_deployment_script
sap_deployment_debug = var.sap_deployment_debug
Expand All @@ -574,7 +574,7 @@ resource "google_compute_instance" "sap_hana_primary_instance" {
data_stripe_size = var.data_stripe_size
log_stripe_size = var.log_stripe_size
template-type = "TERRAFORM"
}
})

lifecycle {
# Ignore changes in the instance metadata, since it is modified by the SAP startup script.
Expand Down Expand Up @@ -681,7 +681,7 @@ resource "google_compute_instance" "sap_hana_worker_instances" {
}
}

metadata = {
metadata = merge(var.custom_secondary_metadata, {
startup-script = local.secondary_startup_url
post_deployment_script = var.post_deployment_script
sap_deployment_debug = var.sap_deployment_debug
Expand All @@ -705,7 +705,7 @@ resource "google_compute_instance" "sap_hana_worker_instances" {
data_stripe_size = var.data_stripe_size
log_stripe_size = var.log_stripe_size
template-type = "TERRAFORM"
}
})

lifecycle {
# Ignore changes in the instance metadata, since it is modified by the SAP startup script.
Expand Down
12 changes: 12 additions & 0 deletions modules/sap_hana/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -551,3 +551,15 @@ variable "log_stripe_size" {
description = "Optional - default is 64k. Stripe size for log volume striping (if enable_log_striping = true)."
default = "64k"
}

variable "custom_primary_metadata" {
type = map<string, string>
description = "Optional - default is empty. Custom metadata to be added to the primary VM."
default = {}
}

variable "custom_secondary_metadata" {
type = map<string, string>
description = "Optional - default is empty. Custom metadata to be added to the secondary VMs."
default = {}
}
15 changes: 10 additions & 5 deletions modules/sap_hana_ha/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,8 @@ resource "google_compute_instance" "sap_hana_ha_primary_instance" {
log_stripe_size = var.log_stripe_size
template-type = "TERRAFORM"
},
local.wlm_metadata
local.wlm_metadata,
var.custom_primary_metadata
)

lifecycle {
Expand Down Expand Up @@ -792,7 +793,8 @@ resource "google_compute_instance" "sap_hana_ha_primary_workers" {
log_stripe_size = var.log_stripe_size
template-type = "TERRAFORM"
},
local.wlm_metadata
local.wlm_metadata,
var.custom_primary_metadata
)

lifecycle {
Expand Down Expand Up @@ -1047,7 +1049,8 @@ resource "google_compute_instance" "sap_hana_ha_secondary_instance" {
log_stripe_size = var.log_stripe_size
template-type = "TERRAFORM"
},
local.wlm_metadata
local.wlm_metadata,
var.custom_secondary_metadata
)

lifecycle {
Expand Down Expand Up @@ -1192,7 +1195,8 @@ resource "google_compute_instance" "sap_hana_ha_secondary_workers" {
log_stripe_size = var.log_stripe_size
template-type = "TERRAFORM"
},
local.wlm_metadata
local.wlm_metadata,
var.custom_secondary_metadata
)

lifecycle {
Expand Down Expand Up @@ -1387,7 +1391,8 @@ resource "google_compute_instance" "sap_majority_maker_instance" {
majority_maker_zone = local.mm_fully_defined ? var.majority_maker_zone : ""
template-type = "TERRAFORM"
},
local.wlm_metadata
local.wlm_metadata,
var.custom_mm_metadata
)

lifecycle {
Expand Down
18 changes: 18 additions & 0 deletions modules/sap_hana_ha/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -606,3 +606,21 @@ variable "log_stripe_size" {
description = "Optional - default is 64k. Stripe size for log volume striping (if enable_log_striping = true)."
default = "64k"
}

variable "custom_primary_metadata" {
type = map<string, string>
description = "Optional - default is empty. Custom metadata to be added to the primary VM."
default = {}
}

variable "custom_secondary_metadata" {
type = map<string, string>
description = "Optional - default is empty. Custom metadata to be added to the secondary VMs."
default = {}
}

variable "custom_mm_metadata" {
type = map<string, string>
description = "Optional - default is empty. Custom metadata to be added to the majority maker VM."
default = {}
}
12 changes: 6 additions & 6 deletions modules/sap_hana_scaleout/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ resource "google_compute_instance" "sap_hana_scaleout_primary_instance" {
}
}

metadata = {
metadata = merge(var.custom_primary_metadata,{
startup-script = local.primary_startup_url
post_deployment_script = var.post_deployment_script
sap_deployment_debug = var.sap_deployment_debug
Expand All @@ -380,7 +380,7 @@ resource "google_compute_instance" "sap_hana_scaleout_primary_instance" {
sap_hana_data_disk_type = local.final_data_disk_type
native_bm = local.native_bm
template-type = "TERRAFORM"
}
})

lifecycle {
# Ignore changes in the instance metadata, since it is modified by the SAP startup script.
Expand Down Expand Up @@ -468,7 +468,7 @@ resource "google_compute_instance" "sap_hana_scaleout_worker_instances" {
}
}

metadata = {
metadata = merge(var.custom_secondary_metadata, {
startup-script = local.secondary_startup_url
post_deployment_script = var.post_deployment_script
sap_deployment_debug = var.sap_deployment_debug
Expand All @@ -491,7 +491,7 @@ resource "google_compute_instance" "sap_hana_scaleout_worker_instances" {
use_single_data_log_disk = var.use_single_data_log_disk
native_bm = local.native_bm
template-type = "TERRAFORM"
}
})

lifecycle {
# Ignore changes in the instance metadata, since it is modified by the SAP startup script.
Expand Down Expand Up @@ -562,7 +562,7 @@ resource "google_compute_instance" "sap_hana_scaleout_standby_instances" {
}
}

metadata = {
metadata = merge(var.custom_standby_metadata, {
startup-script = local.secondary_startup_url
post_deployment_script = var.post_deployment_script
sap_deployment_debug = var.sap_deployment_debug
Expand All @@ -585,7 +585,7 @@ resource "google_compute_instance" "sap_hana_scaleout_standby_instances" {
sap_hana_standby_nodes = var.sap_hana_standby_nodes
native_bm = local.native_bm
template-type = "TERRAFORM"
}
})

lifecycle {
# Ignore changes in the instance metadata, since it is modified by the SAP startup script.
Expand Down
Loading

0 comments on commit 470dfcc

Please sign in to comment.