Skip to content

Commit 05a33be

Browse files
committed
Add new outputs: cluster_fqdn, cluster_portal_fqdn and cluster_private_fqdn
1 parent 0f9b95a commit 05a33be

5 files changed

Lines changed: 35 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ ENHANCEMENTS:
1818

1919
ENHANCEMENTS:
2020

21-
* Add `aci_connector_linux` addon. [#230](https://github.com/Azure/terraform-azurerm-aks/pull/230)
21+
* Add `aci_connector_linux` addon. [#230](https://github.com/Azure/terraform-azurerm-aks/pull/230)

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,10 @@ No modules.
368368
| <a name="output_client_certificate"></a> [client\_certificate](#output\_client\_certificate) | The `client_certificate` in the `azurerm_kubernetes_cluster`'s `kube_config` block. Base64 encoded public certificate used by clients to authenticate to the Kubernetes cluster. |
369369
| <a name="output_client_key"></a> [client\_key](#output\_client\_key) | The `client_key` in the `azurerm_kubernetes_cluster`'s `kube_config` block. Base64 encoded private key used by clients to authenticate to the Kubernetes cluster. |
370370
| <a name="output_cluster_ca_certificate"></a> [cluster\_ca\_certificate](#output\_cluster\_ca\_certificate) | The `cluster_ca_certificate` in the `azurerm_kubernetes_cluster`'s `kube_config` block. Base64 encoded public CA certificate used as the root of trust for the Kubernetes cluster. |
371+
| <a name="output_cluster_fqdn"></a> [cluster\_fqdn](#output\_cluster\_fqdn) | The FQDN of the Azure Kubernetes Managed Cluster. |
371372
| <a name="output_cluster_identity"></a> [cluster\_identity](#output\_cluster\_identity) | The `azurerm_kubernetes_cluster`'s `identity` block. |
373+
| <a name="output_cluster_portal_fqdn"></a> [cluster\_portal\_fqdn](#output\_cluster\_portal\_fqdn) | The FQDN for the Azure Portal resources when private link has been enabled, which is only resolvable inside the Virtual Network used by the Kubernetes Cluster. |
374+
| <a name="output_cluster_private_fqdn"></a> [cluster\_private\_fqdn](#output\_cluster\_private\_fqdn) | The FQDN for the Kubernetes Cluster when private link has been enabled, which is only resolvable inside the Virtual Network used by the Kubernetes Cluster. |
372375
| <a name="output_generated_cluster_private_ssh_key"></a> [generated\_cluster\_private\_ssh\_key](#output\_generated\_cluster\_private\_ssh\_key) | The cluster will use this generated private key as ssh key when `var.public_ssh_key` is empty or null. Private key data in [PEM (RFC 1421)](https://datatracker.ietf.org/doc/html/rfc1421) format. |
373376
| <a name="output_generated_cluster_public_ssh_key"></a> [generated\_cluster\_public\_ssh\_key](#output\_generated\_cluster\_public\_ssh\_key) | The cluster will use this generated public key as ssh key when `var.public_ssh_key` is empty or null. The fingerprint of the public key data in OpenSSH MD5 hash format, e.g. `aa:bb:cc:....` Only available if the selected private key format is compatible, similarly to `public_key_openssh` and the [ECDSA P224 limitations](https://registry.terraform.io/providers/hashicorp/tls/latest/docs#limitations). |
374377
| <a name="output_host"></a> [host](#output\_host) | The `host` in the `azurerm_kubernetes_cluster`'s `kube_config` block. The Kubernetes cluster server host. |

examples/startup/outputs.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ output "test_cluster_ca_certificate" {
4747
value = module.aks.client_certificate
4848
}
4949

50+
output "test_cluster_portal_fqdn" {
51+
value = module.aks.cluster_portal_fqdn
52+
}
53+
54+
output "test_cluster_private_fqdn" {
55+
value = module.aks.cluster_private_fqdn
56+
}
57+
5058
output "test_host" {
5159
sensitive = true
5260
value = module.aks.host

outputs.tf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,26 @@ output "cluster_ca_certificate" {
9393
value = azurerm_kubernetes_cluster.main.kube_config[0].cluster_ca_certificate
9494
}
9595

96+
output "cluster_fqdn" {
97+
description = "The FQDN of the Azure Kubernetes Managed Cluster."
98+
value = azurerm_kubernetes_cluster.main.fqdn
99+
}
100+
96101
output "cluster_identity" {
97102
description = "The `azurerm_kubernetes_cluster`'s `identity` block."
98103
value = try(azurerm_kubernetes_cluster.main.identity[0], null)
99104
}
100105

106+
output "cluster_portal_fqdn" {
107+
description = "The FQDN for the Azure Portal resources when private link has been enabled, which is only resolvable inside the Virtual Network used by the Kubernetes Cluster."
108+
value = azurerm_kubernetes_cluster.main.portal_fqdn
109+
}
110+
111+
output "cluster_private_fqdn" {
112+
description = "The FQDN for the Kubernetes Cluster when private link has been enabled, which is only resolvable inside the Virtual Network used by the Kubernetes Cluster."
113+
value = azurerm_kubernetes_cluster.main.private_fqdn
114+
}
115+
101116
output "generated_cluster_private_ssh_key" {
102117
description = "The cluster will use this generated private key as ssh key when `var.public_ssh_key` is empty or null. Private key data in [PEM (RFC 1421)](https://datatracker.ietf.org/doc/html/rfc1421) format."
103118
sensitive = true

test/e2e/terraform_aks_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,17 @@ func TestExamplesStartup(t *testing.T) {
2626
aksId, ok := output["test_aks_id"].(string)
2727
assert.True(t, ok)
2828
assert.Regexp(t, regexp.MustCompile("/subscriptions/.+/resourceGroups/.+/providers/Microsoft.ContainerService/managedClusters/.+"), aksId)
29+
assertOutputNotEmpty(t, output, "test_cluster_portal_fqdn")
30+
assertOutputNotEmpty(t, output, "test_cluster_private_fqdn")
2931
})
3032
}
3133

34+
func assertOutputNotEmpty(t *testing.T, output test_helper.TerraformOutput, name string) {
35+
o, ok := output[name].(string)
36+
assert.True(t, ok)
37+
assert.NotEqual(t, "", o)
38+
}
39+
3240
func TestExamplesWithoutMonitor(t *testing.T) {
3341
var vars map[string]interface{}
3442
managedIdentityId := os.Getenv("MSI_ID")

0 commit comments

Comments
 (0)