Skip to content
Merged
Changes from 1 commit
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
29 changes: 20 additions & 9 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

output "client_key" {
sensitive = true
value = azurerm_kubernetes_cluster.main.kube_config[0].client_key
Expand Down Expand Up @@ -52,7 +51,7 @@ output "kube_admin_config_raw" {
}

output "http_application_routing_zone_name" {
value = azurerm_kubernetes_cluster.main.http_application_routing_enabled ? azurerm_kubernetes_cluster.main.http_application_routing_zone_name : ""
value = azurerm_kubernetes_cluster.main.http_application_routing_zone_name != null ? azurerm_kubernetes_cluster.main.http_application_routing_zone_name : ""
}

output "system_assigned_identity" {
Expand All @@ -64,29 +63,41 @@ output "kubelet_identity" {
}

output "admin_client_key" {
value = length(azurerm_kubernetes_cluster.main.kube_admin_config) > 0 ? azurerm_kubernetes_cluster.main.kube_admin_config.0.client_key : ""
value = try(azurerm_kubernetes_cluster.main.kube_admin_config[0].client_key, "")
}

output "admin_client_certificate" {
value = length(azurerm_kubernetes_cluster.main.kube_admin_config) > 0 ? azurerm_kubernetes_cluster.main.kube_admin_config.0.client_certificate : ""
value = try(azurerm_kubernetes_cluster.main.kube_admin_config[0].client_certificate, "")
}

output "admin_cluster_ca_certificate" {
value = length(azurerm_kubernetes_cluster.main.kube_admin_config) > 0 ? azurerm_kubernetes_cluster.main.kube_admin_config.0.cluster_ca_certificate : ""
value = try(azurerm_kubernetes_cluster.main.kube_admin_config[0].cluster_ca_certificate, "")
}

output "admin_host" {
value = length(azurerm_kubernetes_cluster.main.kube_admin_config) > 0 ? azurerm_kubernetes_cluster.main.kube_admin_config.0.host : ""
value = try(azurerm_kubernetes_cluster.main.kube_admin_config[0].host, "")
}

output "admin_username" {
value = length(azurerm_kubernetes_cluster.main.kube_admin_config) > 0 ? azurerm_kubernetes_cluster.main.kube_admin_config.0.username : ""
value = try(azurerm_kubernetes_cluster.main.kube_admin_config[0].username, "")
}

output "admin_password" {
value = length(azurerm_kubernetes_cluster.main.kube_admin_config) > 0 ? azurerm_kubernetes_cluster.main.kube_admin_config.0.password : ""
value = try(azurerm_kubernetes_cluster.main.kube_admin_config[0].password, "")
}

output "addon_profile" {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand you want to keep the addon_profile output name to avoid breaking changes.

However in #157 you bumped the azure provider from version 2.x to 3.x so breaking changes are expected, and folks should read upgrade notes.

Keeping the addon_profile forever will be super confusing for folks starting using this module directly with the version 3.x of the provider, because they will have to understand where the legacy of this naming comes from.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested creating in my project the following output.tf file:

output aci_connector_linux {
value = module.aks.addon_profile.aci_connector_linux
}
output aci_connector_linux_enabled {
value = module.aks.addon_profile.aci_connector_linux_enabled
}
output azure_policy_enabled {
value = module.aks.addon_profile.azure_policy_enabled
}
output http_application_routing_enabled {
value = module.aks.addon_profile.http_application_routing_enabled
}
output ingress_application_gateway {
value = module.aks.addon_profile.ingress_application_gateway
}
output ingress_application_gateway_enabled {
value = module.aks.addon_profile.ingress_application_gateway_enabled
}
output key_vault_secrets_provider {
value = module.aks.addon_profile.key_vault_secrets_provider
}
output key_vault_secrets_provider_enabled {
value = module.aks.addon_profile.key_vault_secrets_provider_enabled
}
output oms_agent {
value = module.aks.addon_profile.oms_agent
}
output oms_agent_enabled {
value = module.aks.addon_profile.oms_agent_enabled
}
output open_service_mesh_enabled {
value = module.aks.addon_profile.open_service_mesh_enabled
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would drop the addon_profile string in the outputs and add information about this change in the Changelog file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, addon_profile makes no sense with the updated provider. I added the export in order to get hold of the identity of the AGIC, in order to be able to do role assignments:

principal_id         = module.aks.addon_profile.ingress_application_gateway[0].ingress_application_gateway_identity[0].object_id
  scope                = module.aks.addon_profile.ingress_application_gateway[0].gateway_id

as long as we still get hold of those values anything is fine.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed!

value = try(azurerm_kubernetes_cluster.main.addon_profile.0, null)
value = {
aci_connector_linux = try(azurerm_kubernetes_cluster.main.aci_connector_linux[0], null)
aci_connector_linux_enabled = can(azurerm_kubernetes_cluster.main.aci_connector_linux[0])
azure_policy_enabled = azurerm_kubernetes_cluster.main.azure_policy_enabled
http_application_routing_enabled = azurerm_kubernetes_cluster.main.http_application_routing_enabled
ingress_application_gateway = try(azurerm_kubernetes_cluster.main.ingress_application_gateway[0], null)
ingress_application_gateway_enabled = can(azurerm_kubernetes_cluster.main.ingress_application_gateway[0])
key_vault_secrets_provider = try(azurerm_kubernetes_cluster.main.key_vault_secrets_provider[0], null)
key_vault_secrets_provider_enabled = can(azurerm_kubernetes_cluster.main.key_vault_secrets_provider[0])
oms_agent = try(azurerm_kubernetes_cluster.main.oms_agent[0], null)
oms_agent_enabled = can(azurerm_kubernetes_cluster.main.oms_agent[0])
open_service_mesh_enabled = azurerm_kubernetes_cluster.main.open_service_mesh_enabled
}
}