diff --git a/internal/services/containers/kubernetes_cluster_other_resource_test.go b/internal/services/containers/kubernetes_cluster_other_resource_test.go index ef36d65b9c17..f0a8b51ecbc6 100644 --- a/internal/services/containers/kubernetes_cluster_other_resource_test.go +++ b/internal/services/containers/kubernetes_cluster_other_resource_test.go @@ -849,6 +849,7 @@ func TestAccKubernetesCluster_webAppRouting(t *testing.T) { Config: r.webAppRouting(data), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("web_app_routing.0.web_app_routing_identity.#").HasValue("1"), ), }, data.ImportStep(), diff --git a/internal/services/containers/kubernetes_cluster_resource.go b/internal/services/containers/kubernetes_cluster_resource.go index f9193fbd9569..fe95e454295e 100644 --- a/internal/services/containers/kubernetes_cluster_resource.go +++ b/internal/services/containers/kubernetes_cluster_resource.go @@ -474,6 +474,26 @@ func resourceKubernetesCluster() *pluginsdk.Resource { validation.StringIsEmpty, ), }, + "web_app_routing_identity": { + Type: pluginsdk.TypeList, + Computed: true, + Elem: &pluginsdk.Resource{ + Schema: map[string]*pluginsdk.Schema{ + "client_id": { + Type: pluginsdk.TypeString, + Computed: true, + }, + "object_id": { + Type: pluginsdk.TypeString, + Computed: true, + }, + "user_assigned_identity_id": { + Type: pluginsdk.TypeString, + Computed: true, + }, + }, + }, + }, }, }, }, @@ -4427,9 +4447,16 @@ func flattenKubernetesClusterIngressProfile(input *managedclusters.ManagedCluste dnsZoneId = *v } + webAppRoutingIdentity := []interface{}{} + + if v := input.WebAppRouting.Identity; v != nil { + webAppRoutingIdentity = flattenKubernetesClusterAddOnIdentityProfile(v) + } + return []interface{}{ map[string]interface{}{ - "dns_zone_id": dnsZoneId, + "dns_zone_id": dnsZoneId, + "web_app_routing_identity": webAppRoutingIdentity, }, } } diff --git a/website/docs/r/kubernetes_cluster.html.markdown b/website/docs/r/kubernetes_cluster.html.markdown index f9cebfec3ae2..a9871ada246f 100644 --- a/website/docs/r/kubernetes_cluster.html.markdown +++ b/website/docs/r/kubernetes_cluster.html.markdown @@ -1092,6 +1092,22 @@ The `secret_identity` block exports the following: --- +A `web_app_routing` block exports the following: + +* `web_app_routing_identity` - A `web_app_routing_identity` block is exported. The exported attributes are defined below. + +--- + +The `web_app_routing_identity` block exports the following: + +* `client_id` - The Client ID of the user-defined Managed Identity used for Web App Routing. + +* `object_id` - The Object ID of the user-defined Managed Identity used for Web App Routing + +* `user_assigned_identity_id` - The ID of the User Assigned Identity used for Web App Routing. + +--- + A `workload_autoscaler_profile` block exports the following: * `vertical_pod_autoscaler_controlled_values` - Which resources values should be controlled.