Skip to content

Commit

Permalink
Merge pull request #15 from mloskot/ml/feat/support-cost-analysis-toggle
Browse files Browse the repository at this point in the history
feat: Support for cost_analysis_enabled property of azurerm_kubernetes_cluster
  • Loading branch information
Shr3ps authored Oct 25, 2024
2 parents 085a5df + 9e8a64f commit b2e355e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ module "aks" {
| azure\_policy\_enabled | Option to enable Azure Policy add-on. | `bool` | `true` | no |
| client\_name | Client name/account used in naming. | `string` | n/a | yes |
| container\_registry\_id | Azure Container Registry ID where Azure Kubernetes Service needs pull access. | `string` | `null` | no |
| cost\_analysis\_enabled | Option to enable cost analysis in the Azure portal for this Kubernetes cluster. The `sku_tier` must be set to `Standard` or `Premium` to enable this feature. | `bool` | `false` | no |
| custom\_diagnostic\_settings\_name | Custom name of the diagnostics settings, name will be 'default' if not set. | `string` | `"default"` | no |
| custom\_name | Custom AKS name, generated if not set. | `string` | `""` | no |
| data\_collection\_rule | AKS Data Collection Rule configuration. | <pre>object({<br/> enabled = optional(bool, true)<br/> custom_log_analytics_workspace_id = optional(string)<br/> data_streams = optional(list(string), [<br/> "Microsoft-ContainerLog",<br/> "Microsoft-ContainerLogV2",<br/> "Microsoft-KubeEvents",<br/> "Microsoft-KubePodInventory",<br/> "Microsoft-InsightsMetrics",<br/> "Microsoft-ContainerInventory",<br/> "Microsoft-ContainerNodeInventory",<br/> "Microsoft-KubeNodeInventory",<br/> "Microsoft-KubeServices",<br/> "Microsoft-KubePVInventory"<br/> ])<br/> namespaces_filter = optional(list(string), [<br/> "kube-system",<br/> "gatekeeper-system",<br/> "kube-node-lease",<br/> "calico-system",<br/> ])<br/> namespace_filtering_mode = optional(string, "Exclude")<br/> data_collection_interval = optional(string, "5m")<br/> container_log_v2_enabled = optional(bool, true)<br/> })</pre> | `{}` | no |
Expand Down
3 changes: 2 additions & 1 deletion r-aks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ resource "azurerm_kubernetes_cluster" "aks" {
}

# Azure integration config
azure_policy_enabled = var.azure_policy_enabled
azure_policy_enabled = var.azure_policy_enabled
cost_analysis_enabled = var.cost_analysis_enabled

identity {
type = "UserAssigned"
Expand Down
7 changes: 7 additions & 0 deletions variables-aks-light.tf
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,13 @@ variable "azure_policy_enabled" {
default = true
}

variable "cost_analysis_enabled" {
description = "Option to enable cost analysis in the Azure portal for this Kubernetes cluster. The `sku_tier` must be set to `Standard` or `Premium` to enable this feature."
type = bool
nullable = false
default = false
}

variable "linux_profile" {
description = "Username and SSH public key for accessing Linux nodes with SSH."
type = object({
Expand Down

0 comments on commit b2e355e

Please sign in to comment.