Skip to content

Commit 8aa2d15

Browse files
author
Roman Schwarz
committed
Add dns_servers variable
Signed-off-by: Roman Schwarz <rs@cloudeteer.de>
1 parent 100de16 commit 8aa2d15

3 files changed

Lines changed: 22 additions & 6 deletions

File tree

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,14 @@ list(object({
421421

422422
Default: `[]`
423423

424+
### <a name="input_dns_servers"></a> [dns\_servers](#input\_dns\_servers)
425+
426+
Description: A list of DNS server IP addresses to assign to the primary network interface of the virtual machine. These servers will override the default DNS settings provided by the subnet or virtual network.
427+
428+
Type: `list(string)`
429+
430+
Default: `[]`
431+
424432
### <a name="input_domain_join"></a> [domain\_join](#input\_domain\_join)
425433

426434
Description: Enable domain join for the virtual machine. This feature is not supported on Linux Virtual Machines.

r-network.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ resource "azurerm_network_interface" "this" {
1515
resource_group_name = var.resource_group_name
1616
tags = var.tags
1717

18+
dns_servers = var.dns_servers
19+
1820
ip_configuration {
1921
name = "ipconfig1"
2022
private_ip_address = var.private_ip_address

variables.tf

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
locals {
2-
windows_license_types = ["None", "Windows_Client", "Windows_Server"]
3-
linux_license_types = [
4-
"RHEL_BYOS", "RHEL_BASE", "RHEL_EUS", "RHEL_SAPAPPS", "RHEL_SAPHA", "RHEL_BASESAPAPPS", "RHEL_BASESAPHA",
5-
"SLES_BYOS", "SLES_SAP", "SLES_HPC"
6-
]
7-
82
identity_type = (
93
var.entra_id_login.enabled ? (
104
strcontains(try(var.identity.type, ""), "UserAssigned") ?
115
replace(var.identity.type, var.identity.type, "SystemAssigned, UserAssigned") :
126
"SystemAssigned"
137
) :
148
try(var.identity.type, null))
9+
linux_license_types = [
10+
"RHEL_BYOS", "RHEL_BASE", "RHEL_EUS", "RHEL_SAPAPPS", "RHEL_SAPHA", "RHEL_BASESAPAPPS", "RHEL_BASESAPHA",
11+
"SLES_BYOS", "SLES_SAP", "SLES_HPC"
12+
]
13+
windows_license_types = ["None", "Windows_Client", "Windows_Server"]
1514
}
1615

1716
variable "additional_capabilities" {
@@ -237,6 +236,13 @@ variable "data_disks" {
237236
default = []
238237
}
239238

239+
variable "dns_servers" {
240+
description = "A list of DNS server IP addresses to assign to the primary network interface of the virtual machine. These servers will override the default DNS settings provided by the subnet or virtual network."
241+
242+
type = list(string)
243+
default = []
244+
}
245+
240246
variable "domain_join" {
241247
description = <<-EOT
242248
Enable domain join for the virtual machine. This feature is not supported on Linux Virtual Machines.

0 commit comments

Comments
 (0)