Skip to content

Instantly share code, notes, and snippets.

@agrajm
Created April 30, 2021 15:55
Show Gist options
  • Save agrajm/99f7298a47dad98052dd4f16dbae2f9c to your computer and use it in GitHub Desktop.
Save agrajm/99f7298a47dad98052dd4f16dbae2f9c to your computer and use it in GitHub Desktop.
resource "azurerm_kubernetes_cluster" "aks" {
...
network_profile {
...
network_plugin = "azure" # for Azure CNI
# Default value is LoadBalancer. Changed to userDefinedRouting to force all egress traffic through Firewall
outbound_type = "userDefinedRouting"
}
addon_profile {
azure_policy {
enabled = true
}
....
}
identity {
type = "SystemAssigned"
}
# Change this to true for enabling Private AKS clusters
private_cluster_enabled = false
depends_on = [azurerm_route_table.rt, azurerm_subnet_route_table_association.aks_subnet_association]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment