Skip to content

Commit

Permalink
DBP-817-Adjust naming convetion
Browse files Browse the repository at this point in the history
  • Loading branch information
sahassou committed Jun 10, 2024
1 parent edd17a2 commit 92ef3d4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
8 changes: 4 additions & 4 deletions modules/ionos-basic-vm-mariadb/main.tf
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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
}

Expand All @@ -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
}

Expand Down
9 changes: 7 additions & 2 deletions modules/ionos-basic-vm-mariadb/output.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}

0 comments on commit 92ef3d4

Please sign in to comment.