Skip to content

Commit

Permalink
export web app routing ID (#22809)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephybun authored Aug 4, 2023
1 parent 78ea6b1 commit a66857f
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
29 changes: 28 additions & 1 deletion internal/services/containers/kubernetes_cluster_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
},
},
},
},
},
},
Expand Down Expand Up @@ -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,
},
}
}
Expand Down
16 changes: 16 additions & 0 deletions website/docs/r/kubernetes_cluster.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit a66857f

Please sign in to comment.