Skip to content

Commit 9b5b9b2

Browse files
committed
use var.prefix for both dns_prefix and dns_prefix_private_cluster, based on var.private_cluster_enabled
1 parent 7cf3feb commit 9b5b9b2

File tree

3 files changed

+2
-9
lines changed

3 files changed

+2
-9
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,6 @@ No modules.
319319
| <a name="input_create_role_assignments_for_application_gateway"></a> [create\_role\_assignments\_for\_application\_gateway](#input\_create\_role\_assignments\_for\_application\_gateway) | (Optional) Whether to create the corresponding role assignments for application gateway or not. Defaults to `true`. | `bool` | `true` | no |
320320
| <a name="input_default_node_pool_fips_enabled"></a> [default\_node\_pool\_fips\_enabled](#input\_default\_node\_pool\_fips\_enabled) | (Optional) Should the nodes in this Node Pool have Federal Information Processing Standard enabled? Changing this forces a new resource to be created. | `bool` | `null` | no |
321321
| <a name="input_disk_encryption_set_id"></a> [disk\_encryption\_set\_id](#input\_disk\_encryption\_set\_id) | (Optional) The ID of the Disk Encryption Set which should be used for the Nodes and Volumes. More information [can be found in the documentation](https://docs.microsoft.com/azure/aks/azure-disk-customer-managed-keys). Changing this forces a new resource to be created. | `string` | `null` | no |
322-
| <a name="input_dns_prefix_private_cluster"></a> [dns\_prefix\_private\_cluster](#input\_dns\_prefix\_private\_cluster) | (Optional) Specifies the DNS prefix to use with private clusters. Only one of `var.prefix,var.dns_prefix_private_cluster` can be specified. Changing this forces a new resource to be created. | `string` | `null` | no |
323322
| <a name="input_ebpf_data_plane"></a> [ebpf\_data\_plane](#input\_ebpf\_data\_plane) | (Optional) Specifies the eBPF data plane used for building the Kubernetes network. Possible value is `cilium`. Changing this forces a new resource to be created. | `string` | `null` | no |
324323
| <a name="input_enable_auto_scaling"></a> [enable\_auto\_scaling](#input\_enable\_auto\_scaling) | Enable node pool autoscaling | `bool` | `false` | no |
325324
| <a name="input_enable_host_encryption"></a> [enable\_host\_encryption](#input\_enable\_host\_encryption) | Enable Host Encryption for default node pool. Encryption at host feature must be enabled on the subscription: https://docs.microsoft.com/azure/virtual-machines/linux/disks-enable-host-based-encryption-cli | `bool` | `false` | no |

main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ resource "azurerm_kubernetes_cluster" "main" {
2121
automatic_channel_upgrade = var.automatic_channel_upgrade
2222
azure_policy_enabled = var.azure_policy_enabled
2323
disk_encryption_set_id = var.disk_encryption_set_id
24-
dns_prefix = var.prefix
25-
dns_prefix_private_cluster = var.dns_prefix_private_cluster
24+
dns_prefix = var.private_cluster_enabled == true ? null : var.prefix
25+
dns_prefix_private_cluster = var.private_cluster_enabled == true ? var.prefix : false
2626
image_cleaner_enabled = var.image_cleaner_enabled
2727
image_cleaner_interval_hours = var.image_cleaner_interval_hours
2828
kubernetes_version = var.kubernetes_version

variables.tf

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -454,12 +454,6 @@ variable "disk_encryption_set_id" {
454454
description = "(Optional) The ID of the Disk Encryption Set which should be used for the Nodes and Volumes. More information [can be found in the documentation](https://docs.microsoft.com/azure/aks/azure-disk-customer-managed-keys). Changing this forces a new resource to be created."
455455
}
456456

457-
variable "dns_prefix_private_cluster" {
458-
type = string
459-
default = null
460-
description = "(Optional) Specifies the DNS prefix to use with private clusters. Only one of `var.prefix,var.dns_prefix_private_cluster` can be specified. Changing this forces a new resource to be created."
461-
}
462-
463457
variable "ebpf_data_plane" {
464458
type = string
465459
default = null

0 commit comments

Comments
 (0)