Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for web_app_routing #297

Merged
merged 1 commit into from
Feb 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,18 +239,18 @@ The following sections are generated by [terraform-docs](https://github.com/terr
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
|---------------------------------------------------------------------------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.2 |
| <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) | >= 3.40 |
| <a name="requirement_tls"></a> [tls](#requirement\_tls) | >= 3.1 |
| Name | Version |
|---------------------------------------------------------------------------|----------------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.2 |
| <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) | >= 3.40, < 4.0 |
| <a name="requirement_tls"></a> [tls](#requirement\_tls) | >= 3.1 |

## Providers

| Name | Version |
|---------------------------------------------------------------|---------|
| <a name="provider_azurerm"></a> [azurerm](#provider\_azurerm) | >= 3.40 |
| <a name="provider_tls"></a> [tls](#provider\_tls) | >= 3.1 |
| Name | Version |
|---------------------------------------------------------------|----------------|
| <a name="provider_azurerm"></a> [azurerm](#provider\_azurerm) | >= 3.40, < 4.0 |
| <a name="provider_tls"></a> [tls](#provider\_tls) | >= 3.1 |

## Modules

Expand Down Expand Up @@ -386,6 +386,7 @@ No modules.
| <a name="input_tags"></a> [tags](#input\_tags) | Any tags that should be present on the AKS cluster resources | `map(string)` | `{}` | no |
| <a name="input_ultra_ssd_enabled"></a> [ultra\_ssd\_enabled](#input\_ultra\_ssd\_enabled) | (Optional) Used to specify whether the UltraSSD is enabled in the Default Node Pool. Defaults to false. | `bool` | `false` | no |
| <a name="input_vnet_subnet_id"></a> [vnet\_subnet\_id](#input\_vnet\_subnet\_id) | (Optional) The ID of a Subnet where the Kubernetes Node Pool should exist. Changing this forces a new resource to be created. | `string` | `null` | no |
| <a name="input_web_app_routing"></a> [web\_app\_routing](#input\_web\_app\_routing) | object({<br> dns\_zone\_id = "(Required) Specifies the ID of the DNS Zone in which DNS entries are created for applications deployed to the cluster when Web App Routing is enabled."<br>}) | <pre>object({<br> dns_zone_id = string<br> })</pre> | `null` | no |
| <a name="input_workload_identity_enabled"></a> [workload\_identity\_enabled](#input\_workload\_identity\_enabled) | Enable or Disable Workload Identity. Defaults to false. | `bool` | `false` | no |

## Outputs
Expand Down
2 changes: 1 addition & 1 deletion examples/named_cluster/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">=3.11.0, < 4.0"
version = ">=3.40.0, < 4.0"
}
curl = {
source = "anschoewe/curl"
Expand Down
2 changes: 1 addition & 1 deletion examples/startup/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">=3.11.0, < 4.0"
version = ">= 3.40, < 4.0"
}
curl = {
source = "anschoewe/curl"
Expand Down
8 changes: 8 additions & 0 deletions examples/without_monitor/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ resource "azurerm_subnet" "test" {
enforce_private_link_endpoint_network_policies = true
}

resource "azurerm_dns_zone" "aks_web_app_routing" {
name = "fakeaks.com"
resource_group_name = local.resource_group.name
}

module "aks_without_monitor" {
source = "../.."

Expand All @@ -46,4 +51,7 @@ module "aks_without_monitor" {
rbac_aad = true
rbac_aad_managed = true
role_based_access_control_enabled = true
web_app_routing = {
dns_zone_id = azurerm_dns_zone.aks_web_app_routing.id
}
}
2 changes: 1 addition & 1 deletion examples/without_monitor/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">=3.11.0, < 4.0"
version = ">= 3.40, < 4.0"
}
curl = {
source = "anschoewe/curl"
Expand Down
7 changes: 7 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,13 @@ resource "azurerm_kubernetes_cluster" "main" {
snapshot_controller_enabled = var.storage_profile_snapshot_controller_enabled
}
}
dynamic "web_app_routing" {
for_each = var.web_app_routing == null ? [] : ["web_app_routing"]

content {
dns_zone_id = var.web_app_routing.dns_zone_id
}
}

lifecycle {
precondition {
Expand Down
12 changes: 12 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,18 @@ variable "vnet_subnet_id" {
default = null
}

variable "web_app_routing" {
type = object({
dns_zone_id = string
})
description = <<-EOT
object({
dns_zone_id = "(Required) Specifies the ID of the DNS Zone in which DNS entries are created for applications deployed to the cluster when Web App Routing is enabled."
})
EOT
default = null
}

variable "workload_identity_enabled" {
description = "Enable or Disable Workload Identity. Defaults to false."
type = bool
Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">= 3.40"
version = ">= 3.40, < 4.0"
}
tls = {
source = "hashicorp/tls"
Expand Down