diff --git a/modules/ionos-basic-vm-mariadb/main.tf b/modules/ionos-basic-vm-mariadb/main.tf index 527489b..1344d30 100644 --- a/modules/ionos-basic-vm-mariadb/main.tf +++ b/modules/ionos-basic-vm-mariadb/main.tf @@ -1,5 +1,5 @@ # Create a private LAN -resource "ionoscloud_lan" "mariadb_lan" { +resource "ionoscloud_lan" "basic_vm_mariadb_lan" { datacenter_id = var.datacenter_id public = false name = "${var.server_name}-lan-private" @@ -27,7 +27,7 @@ module "basic-vm" { create_lan = var.create_lan # Ensure the private LAN is created before the basic VM - depends_on = [ionoscloud_lan.mariadb_lan] + depends_on = [ionoscloud_lan.basic_vm_mariadb_lan] initial_user = "technicaluser" initial_uid = "2215" @@ -39,7 +39,7 @@ resource "ionoscloud_nic" "privacyidea_vm_nic" { datacenter_id = var.datacenter_id server_id = module.basic-vm.basic_vm_server_id dhcp = true - lan = ionoscloud_lan.mariadb_lan.id + lan = ionoscloud_lan.basic_vm_mariadb_lan.id firewall_active = true } @@ -54,7 +54,7 @@ resource "ionoscloud_mariadb_cluster" "mariadb_cluster" { connections { datacenter_id = var.datacenter_id - lan_id = ionoscloud_lan.mariadb_lan.id + lan_id = ionoscloud_lan.basic_vm_mariadb_lan.id cidr = local.database_ip_cidr } diff --git a/modules/ionos-basic-vm-mariadb/output.tf b/modules/ionos-basic-vm-mariadb/output.tf index d25873f..f852b2a 100644 --- a/modules/ionos-basic-vm-mariadb/output.tf +++ b/modules/ionos-basic-vm-mariadb/output.tf @@ -3,12 +3,12 @@ output "basic_vm_lan_ip" { value = ionoscloud_nic.privacyidea_vm_nic.ips[0] } -output "database_ip_cidr" { +output "mariadb_ip_cidr" { description = "The CIDR block for the database IP address" value = local.database_ip_cidr } -output "database_ip" { +output "mariadb_ip" { description = "IP address of the MariaDB cluster" value = local.database_ip } @@ -21,4 +21,9 @@ output "basic_vm_server_dns" { output "basic_vm_server_public_ip" { description= "the public IP address assigned to the basic VM server" value = module.basic-vm.basic_vm_server_public_ip +} + +output "private_lan_id" { + description = "The ID of the private LAN created for the basic VM and MariaDB cluster" + value = ionoscloud_lan.basic_vm_mariadb_lan.id } \ No newline at end of file