You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
azurerm_kubernetes_cluster - add policy property to network_profile.advanced_networking block
This change adds support for the `policy` property within the
`network_profile.advanced_networking` block for Azure Kubernetes Service clusters.
The property maps to the Azure SDK's `AdvancedNetworkingSecurity.AdvancedNetworkPolicies` field.
Changes:
- Add `policy` field with valid values `FQDN` and `L7`
- Add validation to ensure `policy` can only be set when `security_enabled`
is `true`, and that it cannot be combined with a service mesh profile in
`Istio` mode
- Expand/flatten maps the API's `None` value to/from the Terraform-idiomatic
empty string so the field can be omitted to disable advanced network policies
- Add tests for the new property and validation
- Update documentation
Signed-off-by: Quang Nguyen <nguyenquang@microsoft.com>
ExpectError: regexp.MustCompile("`network_profile.0.advanced_networking.0.policy` can only be set when `network_profile.0.advanced_networking.0.security_enabled` is set to `true`"),
ExpectError: regexp.MustCompile("`network_profile.0.advanced_networking.0.policy` can only be set when `network_profile.0.advanced_networking.0.security_enabled` is set to `true`"),
ExpectError: regexp.MustCompile("`network_profile.0.advanced_networking.0.policy` cannot be set when `service_mesh_profile.0.mode` is set to `Istio`"),
returnfmt.Errorf("when `network_profile.0.advanced_networking` has `security_enabled` set to `true`, `network_profile.0.network_plugin` must be set to `%s`", managedclusters.NetworkPluginAzure)
returnfmt.Errorf("`network_profile.0.advanced_networking.0.policy` can only be set when `network_profile.0.advanced_networking.0.security_enabled` is set to `true`")
returnfmt.Errorf("`network_profile.0.advanced_networking.0.policy` can only be set when `network_profile.0.network_data_plane` is set to `%s`", managedclusters.NetworkDataplaneCilium)
returnfmt.Errorf("`network_profile.0.advanced_networking.0.policy` cannot be set when `service_mesh_profile.0.mode` is set to `%s`", managedclusters.ServiceMeshModeIstio)
Copy file name to clipboardExpand all lines: website/docs/r/kubernetes_cluster.html.markdown
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -736,6 +736,8 @@ An `advanced_networking` block supports the following:
736
736
737
737
*`security_enabled` - (Optional) Is security enabled? Defaults to `false`. This can only be enabled (set to `true`) when `network_plugin` is set to `azure` and `network_data_plane` is set to `cilium`.
738
738
739
+
*`policy` - (Optional) Specifies the advanced network policy for the cluster. Possible values are `FQDN` and `L7`. This can only be set when `security_enabled` is set to `true` and `network_data_plane` is set to `cilium`. This cannot be set when `service_mesh_profile``mode` is set to `Istio`. Omitting this field disables advanced network policy enforcement (equivalent to `None`).
740
+
739
741
---
740
742
741
743
A `load_balancer_profile` block supports the following:
0 commit comments