Skip to content

Commit

Permalink
added dhcp variable & updated the lan name
Browse files Browse the repository at this point in the history
  • Loading branch information
jdabat committed Aug 1, 2024
1 parent ead57cb commit 577cb18
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 2 additions & 3 deletions modules/ionos-lan-and-firewall/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@
resource "ionoscloud_lan" "lan" {
datacenter_id = var.datacenter_id
public = var.is_public
name = format( "%s-%s",var.name,"intern-connection-lan")
name = format( "%s-%s-%x",var.name,var.is_public? "public":"private","-connection-lan")
}

# Create a NIC for the basic VM and connect it to the LAN
resource "ionoscloud_nic" "nic" {
datacenter_id = var.datacenter_id
server_id = var.server_id
dhcp = true
dhcp = var.dhcp_enabled
lan = ionoscloud_lan.lan.id
firewall_active = true

}

# Add The Ports The VM
Expand Down
6 changes: 6 additions & 0 deletions modules/ionos-lan-and-firewall/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,10 @@ variable "is_public" {
description = "The Type of lan is public (true) or private (false)"
type = bool
default = false
}

variable "dhcp_enabled" {
description = "The DHCP is used (true) or not (false)"
type = bool
default = true
}

0 comments on commit 577cb18

Please sign in to comment.