Skip to content

Commit 40647ab

Browse files
authored
Merge pull request #8 from quixio/dev
Add Private DNS Zone support and module flexibility improvements
2 parents ce82d7d + ef07568 commit 40647ab

File tree

5 files changed

+23
-14
lines changed

5 files changed

+23
-14
lines changed

.github/workflows/terraform-module.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ jobs:
6363
name: Tag release
6464
runs-on: ubuntu-latest
6565
needs: validate
66-
# Only release on manual dispatch with bump==minor
67-
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.bump == 'minor' }}
66+
# Only release on manual dispatch
67+
if: ${{ github.event_name == 'workflow_dispatch' }}
6868
steps:
6969
- name: Checkout
7070
uses: actions/checkout@v4

examples/private-quix-infr-external-vnet/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ module "aks" {
7979
sku_tier = "Standard"
8080
private_cluster_enabled = true
8181

82-
vnet_name = azurerm_virtual_network.ext.name
83-
nodes_subnet_name = azurerm_subnet.nodes_ext.name
82+
vnet_name = azurerm_virtual_network.ext.name
83+
nodes_subnet_name = azurerm_subnet.nodes_ext.name
8484

8585
identity_name = "quix-private-nat-id"
8686
public_ip_name = "quix-private-nat-ip"

modules/quix-aks/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ No modules.
5454
| Name | Description | Type | Default | Required |
5555
|------|-------------|------|---------|:--------:|
5656
| <a name="input_attach_identity_ids"></a> [attach\_identity\_ids](#input\_attach\_identity\_ids) | Additional user-assigned identity IDs to attach to the cluster | `list(string)` | `[]` | no |
57-
| <a name="input_availability_zone"></a> [availability\_zone](#input\_availability\_zone) | Availability zone for public IP | `string` | n/a | yes |
57+
| <a name="input_availability_zone"></a> [availability\_zone](#input\_availability\_zone) | Availability zone for public IP (required only when create\_nat is true) | `string` | `null` | no |
5858
| <a name="input_bastion_name"></a> [bastion\_name](#input\_bastion\_name) | Name of the Azure Bastion resource | `string` | `"QuixBastion"` | no |
5959
| <a name="input_bastion_public_ip_id"></a> [bastion\_public\_ip\_id](#input\_bastion\_public\_ip\_id) | Existing Bastion Public IP ID to reuse (skip public IP creation when set) | `string` | `null` | no |
6060
| <a name="input_bastion_public_ip_name"></a> [bastion\_public\_ip\_name](#input\_bastion\_public\_ip\_name) | Name of the Public IP for Azure Bastion | `string` | `"QuixBastionIP"` | no |
@@ -82,6 +82,7 @@ No modules.
8282
| <a name="input_nodes_subnet_name"></a> [nodes\_subnet\_name](#input\_nodes\_subnet\_name) | Name of the AKS nodes subnet | `string` | `null` | no |
8383
| <a name="input_oidc_issuer_enabled"></a> [oidc\_issuer\_enabled](#input\_oidc\_issuer\_enabled) | Enable OIDC issuer | `bool` | `true` | no |
8484
| <a name="input_private_cluster_enabled"></a> [private\_cluster\_enabled](#input\_private\_cluster\_enabled) | Enable AKS private cluster | `bool` | `false` | no |
85+
| <a name="input_private_dns_prefix"></a> [private\_dns\_prefix](#input\_private\_dns\_prefix) | Custom DNS prefix for private cluster. Only used when private\_cluster\_enabled is true and private\_dns\_zone\_id is set to a custom zone ID. If null, uses the cluster name. | `string` | `null` | no |
8586
| <a name="input_private_dns_zone_id"></a> [private\_dns\_zone\_id](#input\_private\_dns\_zone\_id) | Private DNS Zone to use for AKS API server when private cluster is enabled. Accepts "System", "None", or a Private DNS Zone resource ID. | `string` | `"System"` | no |
8687
| <a name="input_public_ip_name"></a> [public\_ip\_name](#input\_public\_ip\_name) | Name of the public IP for NAT Gateway | `string` | `null` | no |
8788
| <a name="input_resource_group_name"></a> [resource\_group\_name](#input\_resource\_group\_name) | Resource group name (existing or to be created) | `string` | n/a | yes |

modules/quix-aks/aks.tf

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
################################################################################
44

55
resource "azurerm_kubernetes_cluster" "this" {
6-
name = var.name
7-
location = local.rg_location
8-
resource_group_name = local.rg_name_effective
9-
dns_prefix = "${var.name}-dns"
10-
kubernetes_version = var.kubernetes_version
11-
sku_tier = var.sku_tier
12-
private_cluster_enabled = var.private_cluster_enabled
13-
private_dns_zone_id = var.private_cluster_enabled ? var.private_dns_zone_id : null
6+
name = var.name
7+
location = local.rg_location
8+
resource_group_name = local.rg_name_effective
9+
dns_prefix = var.private_cluster_enabled ? null : "${var.name}-dns"
10+
dns_prefix_private_cluster = var.private_cluster_enabled ? coalesce(var.private_dns_prefix, "${var.name}-dns") : null
11+
kubernetes_version = var.kubernetes_version
12+
sku_tier = var.sku_tier
13+
private_cluster_enabled = var.private_cluster_enabled
14+
private_dns_zone_id = var.private_cluster_enabled ? var.private_dns_zone_id : null
1415

1516
oidc_issuer_enabled = var.oidc_issuer_enabled
1617
workload_identity_enabled = var.workload_identity_enabled

modules/quix-aks/variables.tf

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ variable "private_dns_zone_id" {
4747
default = "System"
4848
}
4949

50+
variable "private_dns_prefix" {
51+
description = "Custom DNS prefix for private cluster. Only used when private_cluster_enabled is true and private_dns_zone_id is set to a custom zone ID. If null, uses the cluster name."
52+
type = string
53+
default = null
54+
}
55+
5056
variable "oidc_issuer_enabled" {
5157
description = "Enable OIDC issuer"
5258
type = bool
@@ -181,8 +187,9 @@ variable "nat_gateway_id" {
181187
}
182188

183189
variable "availability_zone" {
184-
description = "Availability zone for public IP"
190+
description = "Availability zone for public IP (required only when create_nat is true)"
185191
type = string
192+
default = null
186193
}
187194

188195
variable "attach_identity_ids" {

0 commit comments

Comments
 (0)