/
kubernetesCluster.go
1903 lines (1789 loc) · 135 KB
/
kubernetesCluster.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package containerservice
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Managed Kubernetes Cluster (also known as AKS / Azure Kubernetes Service)
//
// ## Example Usage
//
// This example provisions a basic Managed Kubernetes Cluster.
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice"
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleKubernetesCluster, err := containerservice.NewKubernetesCluster(ctx, "example", &containerservice.KubernetesClusterArgs{
// Name: pulumi.String("example-aks1"),
// Location: example.Location,
// ResourceGroupName: example.Name,
// DnsPrefix: pulumi.String("exampleaks1"),
// DefaultNodePool: &containerservice.KubernetesClusterDefaultNodePoolArgs{
// Name: pulumi.String("default"),
// NodeCount: pulumi.Int(1),
// VmSize: pulumi.String("Standard_D2_v2"),
// },
// Identity: &containerservice.KubernetesClusterIdentityArgs{
// Type: pulumi.String("SystemAssigned"),
// },
// Tags: pulumi.StringMap{
// "Environment": pulumi.String("Production"),
// },
// })
// if err != nil {
// return err
// }
// ctx.Export("clientCertificate", exampleKubernetesCluster.KubeConfigs.ApplyT(func(kubeConfigs []containerservice.KubernetesClusterKubeConfig) (*string, error) {
// return &kubeConfigs[0].ClientCertificate, nil
// }).(pulumi.StringPtrOutput))
// ctx.Export("kubeConfig", exampleKubernetesCluster.KubeConfigRaw)
// return nil
// })
// }
//
// ```
//
// ## Import
//
// Managed Kubernetes Clusters can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:containerservice/kubernetesCluster:KubernetesCluster cluster1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.ContainerService/managedClusters/cluster1
// ```
type KubernetesCluster struct {
pulumi.CustomResourceState
// A `aciConnectorLinux` block as defined below. For more details, please visit [Create and configure an AKS cluster to use virtual nodes](https://docs.microsoft.com/azure/aks/virtual-nodes-portal).
AciConnectorLinux KubernetesClusterAciConnectorLinuxPtrOutput `pulumi:"aciConnectorLinux"`
// An `apiServerAccessProfile` block as defined below.
ApiServerAccessProfile KubernetesClusterApiServerAccessProfileOutput `pulumi:"apiServerAccessProfile"`
// Deprecated: This property has been renamed to `authorizedIpRanges` within the `apiServerAccessProfile` block and will be removed in v4.0 of the provider
ApiServerAuthorizedIpRanges pulumi.StringArrayOutput `pulumi:"apiServerAuthorizedIpRanges"`
// A `autoScalerProfile` block as defined below.
AutoScalerProfile KubernetesClusterAutoScalerProfileOutput `pulumi:"autoScalerProfile"`
// The upgrade channel for this Kubernetes Cluster. Possible values are `patch`, `rapid`, `node-image` and `stable`. Omitting this field sets this value to `none`.
//
// !> **Note:** Cluster Auto-Upgrade will update the Kubernetes Cluster (and its Node Pools) to the latest GA version of Kubernetes automatically - please [see the Azure documentation for more information](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel).
//
// > **Note:** Cluster Auto-Upgrade only updates to GA versions of Kubernetes and will not update to Preview versions.
AutomaticChannelUpgrade pulumi.StringPtrOutput `pulumi:"automaticChannelUpgrade"`
// A `azureActiveDirectoryRoleBasedAccessControl` block as defined below.
AzureActiveDirectoryRoleBasedAccessControl KubernetesClusterAzureActiveDirectoryRoleBasedAccessControlPtrOutput `pulumi:"azureActiveDirectoryRoleBasedAccessControl"`
// Should the Azure Policy Add-On be enabled? For more details please visit [Understand Azure Policy for Azure Kubernetes Service](https://docs.microsoft.com/en-ie/azure/governance/policy/concepts/rego-for-aks)
AzurePolicyEnabled pulumi.BoolPtrOutput `pulumi:"azurePolicyEnabled"`
// A `confidentialComputing` block as defined below. For more details please [the documentation](https://learn.microsoft.com/en-us/azure/confidential-computing/confidential-nodes-aks-overview)
ConfidentialComputing KubernetesClusterConfidentialComputingPtrOutput `pulumi:"confidentialComputing"`
// The current version running on the Azure Kubernetes Managed Cluster.
CurrentKubernetesVersion pulumi.StringOutput `pulumi:"currentKubernetesVersion"`
// A list of up to 10 base64 encoded CAs that will be added to the trust store on nodes with the `customCaTrustEnabled` feature enabled.
//
// > **Note:** Removing `customCaTrustCertificatesBase64` after it has been set forces a new resource to be created.
CustomCaTrustCertificatesBase64s pulumi.StringArrayOutput `pulumi:"customCaTrustCertificatesBase64s"`
// A `defaultNodePool` block as defined below.
DefaultNodePool KubernetesClusterDefaultNodePoolOutput `pulumi:"defaultNodePool"`
// The ID of the Disk Encryption Set which should be used for the Nodes and Volumes. More information [can be found in the documentation](https://docs.microsoft.com/azure/aks/azure-disk-customer-managed-keys). Changing this forces a new resource to be created.
DiskEncryptionSetId pulumi.StringPtrOutput `pulumi:"diskEncryptionSetId"`
// DNS prefix specified when creating the managed cluster. Possible values must begin and end with a letter or number, contain only letters, numbers, and hyphens and be between 1 and 54 characters in length. Changing this forces a new resource to be created.
DnsPrefix pulumi.StringPtrOutput `pulumi:"dnsPrefix"`
// Specifies the DNS prefix to use with private clusters. Changing this forces a new resource to be created.
//
// > **Note:** You must define either a `dnsPrefix` or a `dnsPrefixPrivateCluster` field.
//
// In addition, one of either `identity` or `servicePrincipal` blocks must be specified.
DnsPrefixPrivateCluster pulumi.StringPtrOutput `pulumi:"dnsPrefixPrivateCluster"`
// Specifies the Edge Zone within the Azure Region where this Managed Kubernetes Cluster should exist. Changing this forces a new resource to be created.
EdgeZone pulumi.StringPtrOutput `pulumi:"edgeZone"`
// Deprecated: The AKS API has removed support for this field on 2020-10-15 and is no longer possible to configure this the Pod Security Policy.
EnablePodSecurityPolicy pulumi.BoolPtrOutput `pulumi:"enablePodSecurityPolicy"`
// The FQDN of the Azure Kubernetes Managed Cluster.
Fqdn pulumi.StringOutput `pulumi:"fqdn"`
// Should HTTP Application Routing be enabled?
//
// > **Note:** At this time HTTP Application Routing is not supported in Azure China or Azure US Government.
HttpApplicationRoutingEnabled pulumi.BoolPtrOutput `pulumi:"httpApplicationRoutingEnabled"`
// The Zone Name of the HTTP Application Routing.
HttpApplicationRoutingZoneName pulumi.StringOutput `pulumi:"httpApplicationRoutingZoneName"`
// A `httpProxyConfig` block as defined below.
HttpProxyConfig KubernetesClusterHttpProxyConfigPtrOutput `pulumi:"httpProxyConfig"`
// An `identity` block as defined below. One of either `identity` or `servicePrincipal` must be specified.
//
// !> **Note:** A migration scenario from `servicePrincipal` to `identity` is supported. When upgrading `servicePrincipal` to `identity`, your cluster's control plane and addon pods will switch to use managed identity, but the kubelets will keep using your configured `servicePrincipal` until you upgrade your Node Pool.
Identity KubernetesClusterIdentityPtrOutput `pulumi:"identity"`
// Specifies whether Image Cleaner is enabled.
ImageCleanerEnabled pulumi.BoolPtrOutput `pulumi:"imageCleanerEnabled"`
// Specifies the interval in hours when images should be cleaned up. Defaults to `48`.
ImageCleanerIntervalHours pulumi.IntPtrOutput `pulumi:"imageCleanerIntervalHours"`
// A `ingressApplicationGateway` block as defined below.
//
// > **Note:** Since the Application Gateway is deployed inside a Virtual Network, users (and Service Principals) that are operating the Application Gateway must have the `Microsoft.Network/virtualNetworks/subnets/join/action` permission on the Virtual Network or Subnet. For more details, please visit [Virtual Network Permission](https://learn.microsoft.com/en-us/azure/application-gateway/configuration-infrastructure#virtual-network-permission).
IngressApplicationGateway KubernetesClusterIngressApplicationGatewayPtrOutput `pulumi:"ingressApplicationGateway"`
// A `keyManagementService` block as defined below. For more details, please visit [Key Management Service (KMS) etcd encryption to an AKS cluster](https://learn.microsoft.com/en-us/azure/aks/use-kms-etcd-encryption).
KeyManagementService KubernetesClusterKeyManagementServicePtrOutput `pulumi:"keyManagementService"`
// A `keyVaultSecretsProvider` block as defined below. For more details, please visit [Azure Keyvault Secrets Provider for AKS](https://docs.microsoft.com/azure/aks/csi-secrets-store-driver).
KeyVaultSecretsProvider KubernetesClusterKeyVaultSecretsProviderPtrOutput `pulumi:"keyVaultSecretsProvider"`
// Raw Kubernetes config for the admin account to be used by [kubectl](https://kubernetes.io/docs/reference/kubectl/overview/) and other compatible tools. This is only available when Role Based Access Control with Azure Active Directory is enabled and local accounts enabled.
KubeAdminConfigRaw pulumi.StringOutput `pulumi:"kubeAdminConfigRaw"`
// A `kubeAdminConfig` block as defined below. This is only available when Role Based Access Control with Azure Active Directory is enabled and local accounts enabled.
KubeAdminConfigs KubernetesClusterKubeAdminConfigArrayOutput `pulumi:"kubeAdminConfigs"`
// Raw Kubernetes config to be used by [kubectl](https://kubernetes.io/docs/reference/kubectl/overview/) and other compatible tools.
KubeConfigRaw pulumi.StringOutput `pulumi:"kubeConfigRaw"`
// A `kubeConfig` block as defined below.
KubeConfigs KubernetesClusterKubeConfigArrayOutput `pulumi:"kubeConfigs"`
// A `kubeletIdentity` block as defined below.
KubeletIdentity KubernetesClusterKubeletIdentityOutput `pulumi:"kubeletIdentity"`
// Version of Kubernetes specified when creating the AKS managed cluster. If not specified, the latest recommended version will be used at provisioning time (but won't auto-upgrade). AKS does not require an exact patch version to be specified, minor version aliases such as `1.22` are also supported. - The minor version's latest GA patch is automatically chosen in that case. More details can be found in [the documentation](https://docs.microsoft.com/en-us/azure/aks/supported-kubernetes-versions?tabs=azure-cli#alias-minor-version).
//
// > **Note:** Upgrading your cluster may take up to 10 minutes per node.
KubernetesVersion pulumi.StringOutput `pulumi:"kubernetesVersion"`
// A `linuxProfile` block as defined below.
LinuxProfile KubernetesClusterLinuxProfilePtrOutput `pulumi:"linuxProfile"`
// If `true` local accounts will be disabled. See [the documentation](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts) for more information.
//
// > **Note:** If `localAccountDisabled` is set to `true`, it is required to enable Kubernetes RBAC and AKS-managed Azure AD integration. See [the documentation](https://docs.microsoft.com/azure/aks/managed-aad#azure-ad-authentication-overview) for more information.
LocalAccountDisabled pulumi.BoolPtrOutput `pulumi:"localAccountDisabled"`
// The location where the Managed Kubernetes Cluster should be created. Changing this forces a new resource to be created.
Location pulumi.StringOutput `pulumi:"location"`
// A `maintenanceWindow` block as defined below.
MaintenanceWindow KubernetesClusterMaintenanceWindowPtrOutput `pulumi:"maintenanceWindow"`
// A `maintenanceWindowAutoUpgrade` block as defined below.
MaintenanceWindowAutoUpgrade KubernetesClusterMaintenanceWindowAutoUpgradePtrOutput `pulumi:"maintenanceWindowAutoUpgrade"`
// A `maintenanceWindowNodeOs` block as defined below.
MaintenanceWindowNodeOs KubernetesClusterMaintenanceWindowNodeOsPtrOutput `pulumi:"maintenanceWindowNodeOs"`
// A `microsoftDefender` block as defined below.
MicrosoftDefender KubernetesClusterMicrosoftDefenderPtrOutput `pulumi:"microsoftDefender"`
// Specifies a Prometheus add-on profile for the Kubernetes Cluster. A `monitorMetrics` block as defined below.
//
// > **Note:** If deploying Managed Prometheus, the `monitorMetrics` properties are required to configure the cluster for metrics collection. If no value is needed, set properties to `null`.
MonitorMetrics KubernetesClusterMonitorMetricsPtrOutput `pulumi:"monitorMetrics"`
// The name of the Managed Kubernetes Cluster to create. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// A `networkProfile` block as defined below. Changing this forces a new resource to be created.
//
// > **Note:** If `networkProfile` is not defined, `kubenet` profile will be used by default.
NetworkProfile KubernetesClusterNetworkProfileOutput `pulumi:"networkProfile"`
// The upgrade channel for this Kubernetes Cluster Nodes' OS Image. Possible values are `Unmanaged`, `SecurityPatch`, `NodeImage` and `None`.
//
// > **Note:** `nodeOsChannelUpgrade` must be set to `NodeImage` if `automaticChannelUpgrade` has been set to `node-image`
//
// > **Note:** This requires that the Preview Feature `Microsoft.ContainerService/NodeOsUpgradeChannelPreview` is enabled and the Resource Provider is re-registered, see [the documentation](https://learn.microsoft.com/en-us/azure/aks/auto-upgrade-node-image#register-the-nodeosupgradechannelpreview-feature-flag) for more information.
NodeOsChannelUpgrade pulumi.StringPtrOutput `pulumi:"nodeOsChannelUpgrade"`
// The name of the Resource Group where the Kubernetes Nodes should exist. Changing this forces a new resource to be created.
//
// > **Note:** Azure requires that a new, non-existent Resource Group is used, as otherwise, the provisioning of the Kubernetes Service will fail.
NodeResourceGroup pulumi.StringOutput `pulumi:"nodeResourceGroup"`
// The ID of the Resource Group containing the resources for this Managed Kubernetes Cluster.
NodeResourceGroupId pulumi.StringOutput `pulumi:"nodeResourceGroupId"`
// Enable or Disable the [OIDC issuer URL](https://learn.microsoft.com/en-gb/azure/aks/use-oidc-issuer)
OidcIssuerEnabled pulumi.BoolPtrOutput `pulumi:"oidcIssuerEnabled"`
// The OIDC issuer URL that is associated with the cluster.
OidcIssuerUrl pulumi.StringOutput `pulumi:"oidcIssuerUrl"`
// A `omsAgent` block as defined below.
OmsAgent KubernetesClusterOmsAgentPtrOutput `pulumi:"omsAgent"`
// Is Open Service Mesh enabled? For more details, please visit [Open Service Mesh for AKS](https://docs.microsoft.com/azure/aks/open-service-mesh-about).
OpenServiceMeshEnabled pulumi.BoolPtrOutput `pulumi:"openServiceMeshEnabled"`
// 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.
PortalFqdn pulumi.StringOutput `pulumi:"portalFqdn"`
// Should this Kubernetes Cluster have its API server only exposed on internal IP addresses? This provides a Private IP Address for the Kubernetes API on the Virtual Network where the Kubernetes Cluster is located. Defaults to `false`. Changing this forces a new resource to be created.
PrivateClusterEnabled pulumi.BoolPtrOutput `pulumi:"privateClusterEnabled"`
// Specifies whether a Public FQDN for this Private Cluster should be added. Defaults to `false`.
//
// > **Note:** If you use BYO DNS Zone, the AKS cluster should either use a User Assigned Identity or a service principal (which is deprecated) with the `Private DNS Zone Contributor` role and access to this Private DNS Zone. If `UserAssigned` identity is used - to prevent improper resource order destruction - the cluster should depend on the role assignment, like in this example:
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization"
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice"
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleZone, err := privatedns.NewZone(ctx, "example", &privatedns.ZoneArgs{
// Name: pulumi.String("privatelink.eastus2.azmk8s.io"),
// ResourceGroupName: example.Name,
// })
// if err != nil {
// return err
// }
// exampleUserAssignedIdentity, err := authorization.NewUserAssignedIdentity(ctx, "example", &authorization.UserAssignedIdentityArgs{
// Name: pulumi.String("aks-example-identity"),
// ResourceGroupName: example.Name,
// Location: example.Location,
// })
// if err != nil {
// return err
// }
// _, err = authorization.NewAssignment(ctx, "example", &authorization.AssignmentArgs{
// Scope: exampleZone.ID(),
// RoleDefinitionName: pulumi.String("Private DNS Zone Contributor"),
// PrincipalId: exampleUserAssignedIdentity.PrincipalId,
// })
// if err != nil {
// return err
// }
// _, err = containerservice.NewKubernetesCluster(ctx, "example", &containerservice.KubernetesClusterArgs{
// Name: pulumi.String("aksexamplewithprivatednszone1"),
// Location: example.Location,
// ResourceGroupName: example.Name,
// DnsPrefix: pulumi.String("aksexamplednsprefix1"),
// PrivateClusterEnabled: pulumi.Bool(true),
// PrivateDnsZoneId: exampleZone.ID(),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
PrivateClusterPublicFqdnEnabled pulumi.BoolPtrOutput `pulumi:"privateClusterPublicFqdnEnabled"`
// Either the ID of Private DNS Zone which should be delegated to this Cluster, `System` to have AKS manage this or `None`. In case of `None` you will need to bring your own DNS server and set up resolving, otherwise, the cluster will have issues after provisioning. Changing this forces a new resource to be created.
PrivateDnsZoneId pulumi.StringOutput `pulumi:"privateDnsZoneId"`
// 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.
PrivateFqdn pulumi.StringOutput `pulumi:"privateFqdn"`
// Whether public network access is allowed for this Kubernetes Cluster. Defaults to `true`.
//
// !> **Note:** `publicNetworkAccessEnabled` is currently not functional and is not passed to the Azure API. For further information please see this [issue](https://github.com/Azure/AKS/issues/3690). For controlling the public and private exposure of a cluster please see the properties `privateClusterEnabled` and `apiServerAccessProfile`.
//
// Deprecated: `publicNetworkAccessEnabled` is currently not functional and is not be passed to the API
PublicNetworkAccessEnabled pulumi.BoolPtrOutput `pulumi:"publicNetworkAccessEnabled"`
// Specifies the Resource Group where the Managed Kubernetes Cluster should exist. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// Whether Role Based Access Control for the Kubernetes Cluster should be enabled. Defaults to `true`. Changing this forces a new resource to be created.
RoleBasedAccessControlEnabled pulumi.BoolPtrOutput `pulumi:"roleBasedAccessControlEnabled"`
// Whether to enable run command for the cluster or not. Defaults to `true`.
RunCommandEnabled pulumi.BoolPtrOutput `pulumi:"runCommandEnabled"`
// A `serviceMeshProfile` block as defined below.
//
// > **Note:** This requires that the Preview Feature `Microsoft.ContainerService/AzureServiceMeshPreview` is enabled and the Resource Provider is re-registered, see [the documentation](https://learn.microsoft.com/en-us/azure/aks/istio-deploy-addon#register-the-azureservicemeshpreview-feature-flag) for more information.
ServiceMeshProfile KubernetesClusterServiceMeshProfilePtrOutput `pulumi:"serviceMeshProfile"`
// A `servicePrincipal` block as documented below. One of either `identity` or `servicePrincipal` must be specified.
//
// !> **Note:** A migration scenario from `servicePrincipal` to `identity` is supported. When upgrading `servicePrincipal` to `identity`, your cluster's control plane and addon pods will switch to use managed identity, but the kubelets will keep using your configured `servicePrincipal` until you upgrade your Node Pool.
ServicePrincipal KubernetesClusterServicePrincipalPtrOutput `pulumi:"servicePrincipal"`
// The SKU Tier that should be used for this Kubernetes Cluster. Possible values are `Free`, `Standard` (which includes the Uptime SLA) and `Premium`. Defaults to `Free`.
//
// > **Note:** Whilst the AKS API previously supported the `Paid` SKU - the AKS API introduced a breaking change in API Version `2023-02-01` (used in v3.51.0 and later) where the value `Paid` must now be set to `Standard`.
SkuTier pulumi.StringPtrOutput `pulumi:"skuTier"`
// A `storageProfile` block as defined below.
StorageProfile KubernetesClusterStorageProfilePtrOutput `pulumi:"storageProfile"`
// Specifies the support plan which should be used for this Kubernetes Cluster. Possible values are `KubernetesOfficial` and `AKSLongTermSupport`. Defaults to `KubernetesOfficial`.
SupportPlan pulumi.StringPtrOutput `pulumi:"supportPlan"`
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// A `webAppRouting` block as defined below.
WebAppRouting KubernetesClusterWebAppRoutingPtrOutput `pulumi:"webAppRouting"`
// A `windowsProfile` block as defined below.
WindowsProfile KubernetesClusterWindowsProfileOutput `pulumi:"windowsProfile"`
// A `workloadAutoscalerProfile` block defined below.
WorkloadAutoscalerProfile KubernetesClusterWorkloadAutoscalerProfilePtrOutput `pulumi:"workloadAutoscalerProfile"`
// Specifies whether Azure AD Workload Identity should be enabled for the Cluster. Defaults to `false`.
//
// > **Note:** To enable Azure AD Workload Identity `oidcIssuerEnabled` must be set to `true`.
//
// > **Note:** Enabling this option will allocate Workload Identity resources to the `kube-system` namespace in Kubernetes. If you wish to customize the deployment of Workload Identity, you can refer to [the documentation on Azure AD Workload Identity.](https://azure.github.io/azure-workload-identity/docs/installation/mutating-admission-webhook.html) The documentation provides guidance on how to install the mutating admission webhook, which allows for the customization of Workload Identity deployment.
WorkloadIdentityEnabled pulumi.BoolPtrOutput `pulumi:"workloadIdentityEnabled"`
}
// NewKubernetesCluster registers a new resource with the given unique name, arguments, and options.
func NewKubernetesCluster(ctx *pulumi.Context,
name string, args *KubernetesClusterArgs, opts ...pulumi.ResourceOption) (*KubernetesCluster, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DefaultNodePool == nil {
return nil, errors.New("invalid value for required argument 'DefaultNodePool'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
secrets := pulumi.AdditionalSecretOutputs([]string{
"kubeAdminConfigRaw",
"kubeAdminConfigs",
"kubeConfigRaw",
"kubeConfigs",
})
opts = append(opts, secrets)
opts = internal.PkgResourceDefaultOpts(opts)
var resource KubernetesCluster
err := ctx.RegisterResource("azure:containerservice/kubernetesCluster:KubernetesCluster", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetKubernetesCluster gets an existing KubernetesCluster resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetKubernetesCluster(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *KubernetesClusterState, opts ...pulumi.ResourceOption) (*KubernetesCluster, error) {
var resource KubernetesCluster
err := ctx.ReadResource("azure:containerservice/kubernetesCluster:KubernetesCluster", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering KubernetesCluster resources.
type kubernetesClusterState struct {
// A `aciConnectorLinux` block as defined below. For more details, please visit [Create and configure an AKS cluster to use virtual nodes](https://docs.microsoft.com/azure/aks/virtual-nodes-portal).
AciConnectorLinux *KubernetesClusterAciConnectorLinux `pulumi:"aciConnectorLinux"`
// An `apiServerAccessProfile` block as defined below.
ApiServerAccessProfile *KubernetesClusterApiServerAccessProfile `pulumi:"apiServerAccessProfile"`
// Deprecated: This property has been renamed to `authorizedIpRanges` within the `apiServerAccessProfile` block and will be removed in v4.0 of the provider
ApiServerAuthorizedIpRanges []string `pulumi:"apiServerAuthorizedIpRanges"`
// A `autoScalerProfile` block as defined below.
AutoScalerProfile *KubernetesClusterAutoScalerProfile `pulumi:"autoScalerProfile"`
// The upgrade channel for this Kubernetes Cluster. Possible values are `patch`, `rapid`, `node-image` and `stable`. Omitting this field sets this value to `none`.
//
// !> **Note:** Cluster Auto-Upgrade will update the Kubernetes Cluster (and its Node Pools) to the latest GA version of Kubernetes automatically - please [see the Azure documentation for more information](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel).
//
// > **Note:** Cluster Auto-Upgrade only updates to GA versions of Kubernetes and will not update to Preview versions.
AutomaticChannelUpgrade *string `pulumi:"automaticChannelUpgrade"`
// A `azureActiveDirectoryRoleBasedAccessControl` block as defined below.
AzureActiveDirectoryRoleBasedAccessControl *KubernetesClusterAzureActiveDirectoryRoleBasedAccessControl `pulumi:"azureActiveDirectoryRoleBasedAccessControl"`
// Should the Azure Policy Add-On be enabled? For more details please visit [Understand Azure Policy for Azure Kubernetes Service](https://docs.microsoft.com/en-ie/azure/governance/policy/concepts/rego-for-aks)
AzurePolicyEnabled *bool `pulumi:"azurePolicyEnabled"`
// A `confidentialComputing` block as defined below. For more details please [the documentation](https://learn.microsoft.com/en-us/azure/confidential-computing/confidential-nodes-aks-overview)
ConfidentialComputing *KubernetesClusterConfidentialComputing `pulumi:"confidentialComputing"`
// The current version running on the Azure Kubernetes Managed Cluster.
CurrentKubernetesVersion *string `pulumi:"currentKubernetesVersion"`
// A list of up to 10 base64 encoded CAs that will be added to the trust store on nodes with the `customCaTrustEnabled` feature enabled.
//
// > **Note:** Removing `customCaTrustCertificatesBase64` after it has been set forces a new resource to be created.
CustomCaTrustCertificatesBase64s []string `pulumi:"customCaTrustCertificatesBase64s"`
// A `defaultNodePool` block as defined below.
DefaultNodePool *KubernetesClusterDefaultNodePool `pulumi:"defaultNodePool"`
// The ID of the Disk Encryption Set which should be used for the Nodes and Volumes. More information [can be found in the documentation](https://docs.microsoft.com/azure/aks/azure-disk-customer-managed-keys). Changing this forces a new resource to be created.
DiskEncryptionSetId *string `pulumi:"diskEncryptionSetId"`
// DNS prefix specified when creating the managed cluster. Possible values must begin and end with a letter or number, contain only letters, numbers, and hyphens and be between 1 and 54 characters in length. Changing this forces a new resource to be created.
DnsPrefix *string `pulumi:"dnsPrefix"`
// Specifies the DNS prefix to use with private clusters. Changing this forces a new resource to be created.
//
// > **Note:** You must define either a `dnsPrefix` or a `dnsPrefixPrivateCluster` field.
//
// In addition, one of either `identity` or `servicePrincipal` blocks must be specified.
DnsPrefixPrivateCluster *string `pulumi:"dnsPrefixPrivateCluster"`
// Specifies the Edge Zone within the Azure Region where this Managed Kubernetes Cluster should exist. Changing this forces a new resource to be created.
EdgeZone *string `pulumi:"edgeZone"`
// Deprecated: The AKS API has removed support for this field on 2020-10-15 and is no longer possible to configure this the Pod Security Policy.
EnablePodSecurityPolicy *bool `pulumi:"enablePodSecurityPolicy"`
// The FQDN of the Azure Kubernetes Managed Cluster.
Fqdn *string `pulumi:"fqdn"`
// Should HTTP Application Routing be enabled?
//
// > **Note:** At this time HTTP Application Routing is not supported in Azure China or Azure US Government.
HttpApplicationRoutingEnabled *bool `pulumi:"httpApplicationRoutingEnabled"`
// The Zone Name of the HTTP Application Routing.
HttpApplicationRoutingZoneName *string `pulumi:"httpApplicationRoutingZoneName"`
// A `httpProxyConfig` block as defined below.
HttpProxyConfig *KubernetesClusterHttpProxyConfig `pulumi:"httpProxyConfig"`
// An `identity` block as defined below. One of either `identity` or `servicePrincipal` must be specified.
//
// !> **Note:** A migration scenario from `servicePrincipal` to `identity` is supported. When upgrading `servicePrincipal` to `identity`, your cluster's control plane and addon pods will switch to use managed identity, but the kubelets will keep using your configured `servicePrincipal` until you upgrade your Node Pool.
Identity *KubernetesClusterIdentity `pulumi:"identity"`
// Specifies whether Image Cleaner is enabled.
ImageCleanerEnabled *bool `pulumi:"imageCleanerEnabled"`
// Specifies the interval in hours when images should be cleaned up. Defaults to `48`.
ImageCleanerIntervalHours *int `pulumi:"imageCleanerIntervalHours"`
// A `ingressApplicationGateway` block as defined below.
//
// > **Note:** Since the Application Gateway is deployed inside a Virtual Network, users (and Service Principals) that are operating the Application Gateway must have the `Microsoft.Network/virtualNetworks/subnets/join/action` permission on the Virtual Network or Subnet. For more details, please visit [Virtual Network Permission](https://learn.microsoft.com/en-us/azure/application-gateway/configuration-infrastructure#virtual-network-permission).
IngressApplicationGateway *KubernetesClusterIngressApplicationGateway `pulumi:"ingressApplicationGateway"`
// A `keyManagementService` block as defined below. For more details, please visit [Key Management Service (KMS) etcd encryption to an AKS cluster](https://learn.microsoft.com/en-us/azure/aks/use-kms-etcd-encryption).
KeyManagementService *KubernetesClusterKeyManagementService `pulumi:"keyManagementService"`
// A `keyVaultSecretsProvider` block as defined below. For more details, please visit [Azure Keyvault Secrets Provider for AKS](https://docs.microsoft.com/azure/aks/csi-secrets-store-driver).
KeyVaultSecretsProvider *KubernetesClusterKeyVaultSecretsProvider `pulumi:"keyVaultSecretsProvider"`
// Raw Kubernetes config for the admin account to be used by [kubectl](https://kubernetes.io/docs/reference/kubectl/overview/) and other compatible tools. This is only available when Role Based Access Control with Azure Active Directory is enabled and local accounts enabled.
KubeAdminConfigRaw *string `pulumi:"kubeAdminConfigRaw"`
// A `kubeAdminConfig` block as defined below. This is only available when Role Based Access Control with Azure Active Directory is enabled and local accounts enabled.
KubeAdminConfigs []KubernetesClusterKubeAdminConfig `pulumi:"kubeAdminConfigs"`
// Raw Kubernetes config to be used by [kubectl](https://kubernetes.io/docs/reference/kubectl/overview/) and other compatible tools.
KubeConfigRaw *string `pulumi:"kubeConfigRaw"`
// A `kubeConfig` block as defined below.
KubeConfigs []KubernetesClusterKubeConfig `pulumi:"kubeConfigs"`
// A `kubeletIdentity` block as defined below.
KubeletIdentity *KubernetesClusterKubeletIdentity `pulumi:"kubeletIdentity"`
// Version of Kubernetes specified when creating the AKS managed cluster. If not specified, the latest recommended version will be used at provisioning time (but won't auto-upgrade). AKS does not require an exact patch version to be specified, minor version aliases such as `1.22` are also supported. - The minor version's latest GA patch is automatically chosen in that case. More details can be found in [the documentation](https://docs.microsoft.com/en-us/azure/aks/supported-kubernetes-versions?tabs=azure-cli#alias-minor-version).
//
// > **Note:** Upgrading your cluster may take up to 10 minutes per node.
KubernetesVersion *string `pulumi:"kubernetesVersion"`
// A `linuxProfile` block as defined below.
LinuxProfile *KubernetesClusterLinuxProfile `pulumi:"linuxProfile"`
// If `true` local accounts will be disabled. See [the documentation](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts) for more information.
//
// > **Note:** If `localAccountDisabled` is set to `true`, it is required to enable Kubernetes RBAC and AKS-managed Azure AD integration. See [the documentation](https://docs.microsoft.com/azure/aks/managed-aad#azure-ad-authentication-overview) for more information.
LocalAccountDisabled *bool `pulumi:"localAccountDisabled"`
// The location where the Managed Kubernetes Cluster should be created. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// A `maintenanceWindow` block as defined below.
MaintenanceWindow *KubernetesClusterMaintenanceWindow `pulumi:"maintenanceWindow"`
// A `maintenanceWindowAutoUpgrade` block as defined below.
MaintenanceWindowAutoUpgrade *KubernetesClusterMaintenanceWindowAutoUpgrade `pulumi:"maintenanceWindowAutoUpgrade"`
// A `maintenanceWindowNodeOs` block as defined below.
MaintenanceWindowNodeOs *KubernetesClusterMaintenanceWindowNodeOs `pulumi:"maintenanceWindowNodeOs"`
// A `microsoftDefender` block as defined below.
MicrosoftDefender *KubernetesClusterMicrosoftDefender `pulumi:"microsoftDefender"`
// Specifies a Prometheus add-on profile for the Kubernetes Cluster. A `monitorMetrics` block as defined below.
//
// > **Note:** If deploying Managed Prometheus, the `monitorMetrics` properties are required to configure the cluster for metrics collection. If no value is needed, set properties to `null`.
MonitorMetrics *KubernetesClusterMonitorMetrics `pulumi:"monitorMetrics"`
// The name of the Managed Kubernetes Cluster to create. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// A `networkProfile` block as defined below. Changing this forces a new resource to be created.
//
// > **Note:** If `networkProfile` is not defined, `kubenet` profile will be used by default.
NetworkProfile *KubernetesClusterNetworkProfile `pulumi:"networkProfile"`
// The upgrade channel for this Kubernetes Cluster Nodes' OS Image. Possible values are `Unmanaged`, `SecurityPatch`, `NodeImage` and `None`.
//
// > **Note:** `nodeOsChannelUpgrade` must be set to `NodeImage` if `automaticChannelUpgrade` has been set to `node-image`
//
// > **Note:** This requires that the Preview Feature `Microsoft.ContainerService/NodeOsUpgradeChannelPreview` is enabled and the Resource Provider is re-registered, see [the documentation](https://learn.microsoft.com/en-us/azure/aks/auto-upgrade-node-image#register-the-nodeosupgradechannelpreview-feature-flag) for more information.
NodeOsChannelUpgrade *string `pulumi:"nodeOsChannelUpgrade"`
// The name of the Resource Group where the Kubernetes Nodes should exist. Changing this forces a new resource to be created.
//
// > **Note:** Azure requires that a new, non-existent Resource Group is used, as otherwise, the provisioning of the Kubernetes Service will fail.
NodeResourceGroup *string `pulumi:"nodeResourceGroup"`
// The ID of the Resource Group containing the resources for this Managed Kubernetes Cluster.
NodeResourceGroupId *string `pulumi:"nodeResourceGroupId"`
// Enable or Disable the [OIDC issuer URL](https://learn.microsoft.com/en-gb/azure/aks/use-oidc-issuer)
OidcIssuerEnabled *bool `pulumi:"oidcIssuerEnabled"`
// The OIDC issuer URL that is associated with the cluster.
OidcIssuerUrl *string `pulumi:"oidcIssuerUrl"`
// A `omsAgent` block as defined below.
OmsAgent *KubernetesClusterOmsAgent `pulumi:"omsAgent"`
// Is Open Service Mesh enabled? For more details, please visit [Open Service Mesh for AKS](https://docs.microsoft.com/azure/aks/open-service-mesh-about).
OpenServiceMeshEnabled *bool `pulumi:"openServiceMeshEnabled"`
// 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.
PortalFqdn *string `pulumi:"portalFqdn"`
// Should this Kubernetes Cluster have its API server only exposed on internal IP addresses? This provides a Private IP Address for the Kubernetes API on the Virtual Network where the Kubernetes Cluster is located. Defaults to `false`. Changing this forces a new resource to be created.
PrivateClusterEnabled *bool `pulumi:"privateClusterEnabled"`
// Specifies whether a Public FQDN for this Private Cluster should be added. Defaults to `false`.
//
// > **Note:** If you use BYO DNS Zone, the AKS cluster should either use a User Assigned Identity or a service principal (which is deprecated) with the `Private DNS Zone Contributor` role and access to this Private DNS Zone. If `UserAssigned` identity is used - to prevent improper resource order destruction - the cluster should depend on the role assignment, like in this example:
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization"
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice"
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleZone, err := privatedns.NewZone(ctx, "example", &privatedns.ZoneArgs{
// Name: pulumi.String("privatelink.eastus2.azmk8s.io"),
// ResourceGroupName: example.Name,
// })
// if err != nil {
// return err
// }
// exampleUserAssignedIdentity, err := authorization.NewUserAssignedIdentity(ctx, "example", &authorization.UserAssignedIdentityArgs{
// Name: pulumi.String("aks-example-identity"),
// ResourceGroupName: example.Name,
// Location: example.Location,
// })
// if err != nil {
// return err
// }
// _, err = authorization.NewAssignment(ctx, "example", &authorization.AssignmentArgs{
// Scope: exampleZone.ID(),
// RoleDefinitionName: pulumi.String("Private DNS Zone Contributor"),
// PrincipalId: exampleUserAssignedIdentity.PrincipalId,
// })
// if err != nil {
// return err
// }
// _, err = containerservice.NewKubernetesCluster(ctx, "example", &containerservice.KubernetesClusterArgs{
// Name: pulumi.String("aksexamplewithprivatednszone1"),
// Location: example.Location,
// ResourceGroupName: example.Name,
// DnsPrefix: pulumi.String("aksexamplednsprefix1"),
// PrivateClusterEnabled: pulumi.Bool(true),
// PrivateDnsZoneId: exampleZone.ID(),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
PrivateClusterPublicFqdnEnabled *bool `pulumi:"privateClusterPublicFqdnEnabled"`
// Either the ID of Private DNS Zone which should be delegated to this Cluster, `System` to have AKS manage this or `None`. In case of `None` you will need to bring your own DNS server and set up resolving, otherwise, the cluster will have issues after provisioning. Changing this forces a new resource to be created.
PrivateDnsZoneId *string `pulumi:"privateDnsZoneId"`
// 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.
PrivateFqdn *string `pulumi:"privateFqdn"`
// Whether public network access is allowed for this Kubernetes Cluster. Defaults to `true`.
//
// !> **Note:** `publicNetworkAccessEnabled` is currently not functional and is not passed to the Azure API. For further information please see this [issue](https://github.com/Azure/AKS/issues/3690). For controlling the public and private exposure of a cluster please see the properties `privateClusterEnabled` and `apiServerAccessProfile`.
//
// Deprecated: `publicNetworkAccessEnabled` is currently not functional and is not be passed to the API
PublicNetworkAccessEnabled *bool `pulumi:"publicNetworkAccessEnabled"`
// Specifies the Resource Group where the Managed Kubernetes Cluster should exist. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// Whether Role Based Access Control for the Kubernetes Cluster should be enabled. Defaults to `true`. Changing this forces a new resource to be created.
RoleBasedAccessControlEnabled *bool `pulumi:"roleBasedAccessControlEnabled"`
// Whether to enable run command for the cluster or not. Defaults to `true`.
RunCommandEnabled *bool `pulumi:"runCommandEnabled"`
// A `serviceMeshProfile` block as defined below.
//
// > **Note:** This requires that the Preview Feature `Microsoft.ContainerService/AzureServiceMeshPreview` is enabled and the Resource Provider is re-registered, see [the documentation](https://learn.microsoft.com/en-us/azure/aks/istio-deploy-addon#register-the-azureservicemeshpreview-feature-flag) for more information.
ServiceMeshProfile *KubernetesClusterServiceMeshProfile `pulumi:"serviceMeshProfile"`
// A `servicePrincipal` block as documented below. One of either `identity` or `servicePrincipal` must be specified.
//
// !> **Note:** A migration scenario from `servicePrincipal` to `identity` is supported. When upgrading `servicePrincipal` to `identity`, your cluster's control plane and addon pods will switch to use managed identity, but the kubelets will keep using your configured `servicePrincipal` until you upgrade your Node Pool.
ServicePrincipal *KubernetesClusterServicePrincipal `pulumi:"servicePrincipal"`
// The SKU Tier that should be used for this Kubernetes Cluster. Possible values are `Free`, `Standard` (which includes the Uptime SLA) and `Premium`. Defaults to `Free`.
//
// > **Note:** Whilst the AKS API previously supported the `Paid` SKU - the AKS API introduced a breaking change in API Version `2023-02-01` (used in v3.51.0 and later) where the value `Paid` must now be set to `Standard`.
SkuTier *string `pulumi:"skuTier"`
// A `storageProfile` block as defined below.
StorageProfile *KubernetesClusterStorageProfile `pulumi:"storageProfile"`
// Specifies the support plan which should be used for this Kubernetes Cluster. Possible values are `KubernetesOfficial` and `AKSLongTermSupport`. Defaults to `KubernetesOfficial`.
SupportPlan *string `pulumi:"supportPlan"`
// A mapping of tags to assign to the resource.
Tags map[string]string `pulumi:"tags"`
// A `webAppRouting` block as defined below.
WebAppRouting *KubernetesClusterWebAppRouting `pulumi:"webAppRouting"`
// A `windowsProfile` block as defined below.
WindowsProfile *KubernetesClusterWindowsProfile `pulumi:"windowsProfile"`
// A `workloadAutoscalerProfile` block defined below.
WorkloadAutoscalerProfile *KubernetesClusterWorkloadAutoscalerProfile `pulumi:"workloadAutoscalerProfile"`
// Specifies whether Azure AD Workload Identity should be enabled for the Cluster. Defaults to `false`.
//
// > **Note:** To enable Azure AD Workload Identity `oidcIssuerEnabled` must be set to `true`.
//
// > **Note:** Enabling this option will allocate Workload Identity resources to the `kube-system` namespace in Kubernetes. If you wish to customize the deployment of Workload Identity, you can refer to [the documentation on Azure AD Workload Identity.](https://azure.github.io/azure-workload-identity/docs/installation/mutating-admission-webhook.html) The documentation provides guidance on how to install the mutating admission webhook, which allows for the customization of Workload Identity deployment.
WorkloadIdentityEnabled *bool `pulumi:"workloadIdentityEnabled"`
}
type KubernetesClusterState struct {
// A `aciConnectorLinux` block as defined below. For more details, please visit [Create and configure an AKS cluster to use virtual nodes](https://docs.microsoft.com/azure/aks/virtual-nodes-portal).
AciConnectorLinux KubernetesClusterAciConnectorLinuxPtrInput
// An `apiServerAccessProfile` block as defined below.
ApiServerAccessProfile KubernetesClusterApiServerAccessProfilePtrInput
// Deprecated: This property has been renamed to `authorizedIpRanges` within the `apiServerAccessProfile` block and will be removed in v4.0 of the provider
ApiServerAuthorizedIpRanges pulumi.StringArrayInput
// A `autoScalerProfile` block as defined below.
AutoScalerProfile KubernetesClusterAutoScalerProfilePtrInput
// The upgrade channel for this Kubernetes Cluster. Possible values are `patch`, `rapid`, `node-image` and `stable`. Omitting this field sets this value to `none`.
//
// !> **Note:** Cluster Auto-Upgrade will update the Kubernetes Cluster (and its Node Pools) to the latest GA version of Kubernetes automatically - please [see the Azure documentation for more information](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel).
//
// > **Note:** Cluster Auto-Upgrade only updates to GA versions of Kubernetes and will not update to Preview versions.
AutomaticChannelUpgrade pulumi.StringPtrInput
// A `azureActiveDirectoryRoleBasedAccessControl` block as defined below.
AzureActiveDirectoryRoleBasedAccessControl KubernetesClusterAzureActiveDirectoryRoleBasedAccessControlPtrInput
// Should the Azure Policy Add-On be enabled? For more details please visit [Understand Azure Policy for Azure Kubernetes Service](https://docs.microsoft.com/en-ie/azure/governance/policy/concepts/rego-for-aks)
AzurePolicyEnabled pulumi.BoolPtrInput
// A `confidentialComputing` block as defined below. For more details please [the documentation](https://learn.microsoft.com/en-us/azure/confidential-computing/confidential-nodes-aks-overview)
ConfidentialComputing KubernetesClusterConfidentialComputingPtrInput
// The current version running on the Azure Kubernetes Managed Cluster.
CurrentKubernetesVersion pulumi.StringPtrInput
// A list of up to 10 base64 encoded CAs that will be added to the trust store on nodes with the `customCaTrustEnabled` feature enabled.
//
// > **Note:** Removing `customCaTrustCertificatesBase64` after it has been set forces a new resource to be created.
CustomCaTrustCertificatesBase64s pulumi.StringArrayInput
// A `defaultNodePool` block as defined below.
DefaultNodePool KubernetesClusterDefaultNodePoolPtrInput
// The ID of the Disk Encryption Set which should be used for the Nodes and Volumes. More information [can be found in the documentation](https://docs.microsoft.com/azure/aks/azure-disk-customer-managed-keys). Changing this forces a new resource to be created.
DiskEncryptionSetId pulumi.StringPtrInput
// DNS prefix specified when creating the managed cluster. Possible values must begin and end with a letter or number, contain only letters, numbers, and hyphens and be between 1 and 54 characters in length. Changing this forces a new resource to be created.
DnsPrefix pulumi.StringPtrInput
// Specifies the DNS prefix to use with private clusters. Changing this forces a new resource to be created.
//
// > **Note:** You must define either a `dnsPrefix` or a `dnsPrefixPrivateCluster` field.
//
// In addition, one of either `identity` or `servicePrincipal` blocks must be specified.
DnsPrefixPrivateCluster pulumi.StringPtrInput
// Specifies the Edge Zone within the Azure Region where this Managed Kubernetes Cluster should exist. Changing this forces a new resource to be created.
EdgeZone pulumi.StringPtrInput
// Deprecated: The AKS API has removed support for this field on 2020-10-15 and is no longer possible to configure this the Pod Security Policy.
EnablePodSecurityPolicy pulumi.BoolPtrInput
// The FQDN of the Azure Kubernetes Managed Cluster.
Fqdn pulumi.StringPtrInput
// Should HTTP Application Routing be enabled?
//
// > **Note:** At this time HTTP Application Routing is not supported in Azure China or Azure US Government.
HttpApplicationRoutingEnabled pulumi.BoolPtrInput
// The Zone Name of the HTTP Application Routing.
HttpApplicationRoutingZoneName pulumi.StringPtrInput
// A `httpProxyConfig` block as defined below.
HttpProxyConfig KubernetesClusterHttpProxyConfigPtrInput
// An `identity` block as defined below. One of either `identity` or `servicePrincipal` must be specified.
//
// !> **Note:** A migration scenario from `servicePrincipal` to `identity` is supported. When upgrading `servicePrincipal` to `identity`, your cluster's control plane and addon pods will switch to use managed identity, but the kubelets will keep using your configured `servicePrincipal` until you upgrade your Node Pool.
Identity KubernetesClusterIdentityPtrInput
// Specifies whether Image Cleaner is enabled.
ImageCleanerEnabled pulumi.BoolPtrInput
// Specifies the interval in hours when images should be cleaned up. Defaults to `48`.
ImageCleanerIntervalHours pulumi.IntPtrInput
// A `ingressApplicationGateway` block as defined below.
//
// > **Note:** Since the Application Gateway is deployed inside a Virtual Network, users (and Service Principals) that are operating the Application Gateway must have the `Microsoft.Network/virtualNetworks/subnets/join/action` permission on the Virtual Network or Subnet. For more details, please visit [Virtual Network Permission](https://learn.microsoft.com/en-us/azure/application-gateway/configuration-infrastructure#virtual-network-permission).
IngressApplicationGateway KubernetesClusterIngressApplicationGatewayPtrInput
// A `keyManagementService` block as defined below. For more details, please visit [Key Management Service (KMS) etcd encryption to an AKS cluster](https://learn.microsoft.com/en-us/azure/aks/use-kms-etcd-encryption).
KeyManagementService KubernetesClusterKeyManagementServicePtrInput
// A `keyVaultSecretsProvider` block as defined below. For more details, please visit [Azure Keyvault Secrets Provider for AKS](https://docs.microsoft.com/azure/aks/csi-secrets-store-driver).
KeyVaultSecretsProvider KubernetesClusterKeyVaultSecretsProviderPtrInput
// Raw Kubernetes config for the admin account to be used by [kubectl](https://kubernetes.io/docs/reference/kubectl/overview/) and other compatible tools. This is only available when Role Based Access Control with Azure Active Directory is enabled and local accounts enabled.
KubeAdminConfigRaw pulumi.StringPtrInput
// A `kubeAdminConfig` block as defined below. This is only available when Role Based Access Control with Azure Active Directory is enabled and local accounts enabled.
KubeAdminConfigs KubernetesClusterKubeAdminConfigArrayInput
// Raw Kubernetes config to be used by [kubectl](https://kubernetes.io/docs/reference/kubectl/overview/) and other compatible tools.
KubeConfigRaw pulumi.StringPtrInput
// A `kubeConfig` block as defined below.
KubeConfigs KubernetesClusterKubeConfigArrayInput
// A `kubeletIdentity` block as defined below.
KubeletIdentity KubernetesClusterKubeletIdentityPtrInput
// Version of Kubernetes specified when creating the AKS managed cluster. If not specified, the latest recommended version will be used at provisioning time (but won't auto-upgrade). AKS does not require an exact patch version to be specified, minor version aliases such as `1.22` are also supported. - The minor version's latest GA patch is automatically chosen in that case. More details can be found in [the documentation](https://docs.microsoft.com/en-us/azure/aks/supported-kubernetes-versions?tabs=azure-cli#alias-minor-version).
//
// > **Note:** Upgrading your cluster may take up to 10 minutes per node.
KubernetesVersion pulumi.StringPtrInput
// A `linuxProfile` block as defined below.
LinuxProfile KubernetesClusterLinuxProfilePtrInput
// If `true` local accounts will be disabled. See [the documentation](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts) for more information.
//
// > **Note:** If `localAccountDisabled` is set to `true`, it is required to enable Kubernetes RBAC and AKS-managed Azure AD integration. See [the documentation](https://docs.microsoft.com/azure/aks/managed-aad#azure-ad-authentication-overview) for more information.
LocalAccountDisabled pulumi.BoolPtrInput
// The location where the Managed Kubernetes Cluster should be created. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// A `maintenanceWindow` block as defined below.
MaintenanceWindow KubernetesClusterMaintenanceWindowPtrInput
// A `maintenanceWindowAutoUpgrade` block as defined below.
MaintenanceWindowAutoUpgrade KubernetesClusterMaintenanceWindowAutoUpgradePtrInput
// A `maintenanceWindowNodeOs` block as defined below.
MaintenanceWindowNodeOs KubernetesClusterMaintenanceWindowNodeOsPtrInput
// A `microsoftDefender` block as defined below.
MicrosoftDefender KubernetesClusterMicrosoftDefenderPtrInput
// Specifies a Prometheus add-on profile for the Kubernetes Cluster. A `monitorMetrics` block as defined below.
//
// > **Note:** If deploying Managed Prometheus, the `monitorMetrics` properties are required to configure the cluster for metrics collection. If no value is needed, set properties to `null`.
MonitorMetrics KubernetesClusterMonitorMetricsPtrInput
// The name of the Managed Kubernetes Cluster to create. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// A `networkProfile` block as defined below. Changing this forces a new resource to be created.
//
// > **Note:** If `networkProfile` is not defined, `kubenet` profile will be used by default.
NetworkProfile KubernetesClusterNetworkProfilePtrInput
// The upgrade channel for this Kubernetes Cluster Nodes' OS Image. Possible values are `Unmanaged`, `SecurityPatch`, `NodeImage` and `None`.
//
// > **Note:** `nodeOsChannelUpgrade` must be set to `NodeImage` if `automaticChannelUpgrade` has been set to `node-image`
//
// > **Note:** This requires that the Preview Feature `Microsoft.ContainerService/NodeOsUpgradeChannelPreview` is enabled and the Resource Provider is re-registered, see [the documentation](https://learn.microsoft.com/en-us/azure/aks/auto-upgrade-node-image#register-the-nodeosupgradechannelpreview-feature-flag) for more information.
NodeOsChannelUpgrade pulumi.StringPtrInput
// The name of the Resource Group where the Kubernetes Nodes should exist. Changing this forces a new resource to be created.
//
// > **Note:** Azure requires that a new, non-existent Resource Group is used, as otherwise, the provisioning of the Kubernetes Service will fail.
NodeResourceGroup pulumi.StringPtrInput
// The ID of the Resource Group containing the resources for this Managed Kubernetes Cluster.
NodeResourceGroupId pulumi.StringPtrInput
// Enable or Disable the [OIDC issuer URL](https://learn.microsoft.com/en-gb/azure/aks/use-oidc-issuer)
OidcIssuerEnabled pulumi.BoolPtrInput
// The OIDC issuer URL that is associated with the cluster.
OidcIssuerUrl pulumi.StringPtrInput
// A `omsAgent` block as defined below.
OmsAgent KubernetesClusterOmsAgentPtrInput
// Is Open Service Mesh enabled? For more details, please visit [Open Service Mesh for AKS](https://docs.microsoft.com/azure/aks/open-service-mesh-about).
OpenServiceMeshEnabled pulumi.BoolPtrInput
// 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.
PortalFqdn pulumi.StringPtrInput
// Should this Kubernetes Cluster have its API server only exposed on internal IP addresses? This provides a Private IP Address for the Kubernetes API on the Virtual Network where the Kubernetes Cluster is located. Defaults to `false`. Changing this forces a new resource to be created.
PrivateClusterEnabled pulumi.BoolPtrInput
// Specifies whether a Public FQDN for this Private Cluster should be added. Defaults to `false`.
//
// > **Note:** If you use BYO DNS Zone, the AKS cluster should either use a User Assigned Identity or a service principal (which is deprecated) with the `Private DNS Zone Contributor` role and access to this Private DNS Zone. If `UserAssigned` identity is used - to prevent improper resource order destruction - the cluster should depend on the role assignment, like in this example:
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization"
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice"
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleZone, err := privatedns.NewZone(ctx, "example", &privatedns.ZoneArgs{
// Name: pulumi.String("privatelink.eastus2.azmk8s.io"),
// ResourceGroupName: example.Name,
// })
// if err != nil {
// return err
// }
// exampleUserAssignedIdentity, err := authorization.NewUserAssignedIdentity(ctx, "example", &authorization.UserAssignedIdentityArgs{
// Name: pulumi.String("aks-example-identity"),
// ResourceGroupName: example.Name,
// Location: example.Location,
// })
// if err != nil {
// return err
// }
// _, err = authorization.NewAssignment(ctx, "example", &authorization.AssignmentArgs{
// Scope: exampleZone.ID(),
// RoleDefinitionName: pulumi.String("Private DNS Zone Contributor"),
// PrincipalId: exampleUserAssignedIdentity.PrincipalId,
// })
// if err != nil {
// return err
// }
// _, err = containerservice.NewKubernetesCluster(ctx, "example", &containerservice.KubernetesClusterArgs{
// Name: pulumi.String("aksexamplewithprivatednszone1"),
// Location: example.Location,
// ResourceGroupName: example.Name,
// DnsPrefix: pulumi.String("aksexamplednsprefix1"),
// PrivateClusterEnabled: pulumi.Bool(true),
// PrivateDnsZoneId: exampleZone.ID(),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
PrivateClusterPublicFqdnEnabled pulumi.BoolPtrInput
// Either the ID of Private DNS Zone which should be delegated to this Cluster, `System` to have AKS manage this or `None`. In case of `None` you will need to bring your own DNS server and set up resolving, otherwise, the cluster will have issues after provisioning. Changing this forces a new resource to be created.
PrivateDnsZoneId pulumi.StringPtrInput
// 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.
PrivateFqdn pulumi.StringPtrInput
// Whether public network access is allowed for this Kubernetes Cluster. Defaults to `true`.
//
// !> **Note:** `publicNetworkAccessEnabled` is currently not functional and is not passed to the Azure API. For further information please see this [issue](https://github.com/Azure/AKS/issues/3690). For controlling the public and private exposure of a cluster please see the properties `privateClusterEnabled` and `apiServerAccessProfile`.
//
// Deprecated: `publicNetworkAccessEnabled` is currently not functional and is not be passed to the API
PublicNetworkAccessEnabled pulumi.BoolPtrInput
// Specifies the Resource Group where the Managed Kubernetes Cluster should exist. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
// Whether Role Based Access Control for the Kubernetes Cluster should be enabled. Defaults to `true`. Changing this forces a new resource to be created.
RoleBasedAccessControlEnabled pulumi.BoolPtrInput
// Whether to enable run command for the cluster or not. Defaults to `true`.
RunCommandEnabled pulumi.BoolPtrInput
// A `serviceMeshProfile` block as defined below.
//
// > **Note:** This requires that the Preview Feature `Microsoft.ContainerService/AzureServiceMeshPreview` is enabled and the Resource Provider is re-registered, see [the documentation](https://learn.microsoft.com/en-us/azure/aks/istio-deploy-addon#register-the-azureservicemeshpreview-feature-flag) for more information.
ServiceMeshProfile KubernetesClusterServiceMeshProfilePtrInput
// A `servicePrincipal` block as documented below. One of either `identity` or `servicePrincipal` must be specified.
//
// !> **Note:** A migration scenario from `servicePrincipal` to `identity` is supported. When upgrading `servicePrincipal` to `identity`, your cluster's control plane and addon pods will switch to use managed identity, but the kubelets will keep using your configured `servicePrincipal` until you upgrade your Node Pool.
ServicePrincipal KubernetesClusterServicePrincipalPtrInput
// The SKU Tier that should be used for this Kubernetes Cluster. Possible values are `Free`, `Standard` (which includes the Uptime SLA) and `Premium`. Defaults to `Free`.
//
// > **Note:** Whilst the AKS API previously supported the `Paid` SKU - the AKS API introduced a breaking change in API Version `2023-02-01` (used in v3.51.0 and later) where the value `Paid` must now be set to `Standard`.
SkuTier pulumi.StringPtrInput
// A `storageProfile` block as defined below.
StorageProfile KubernetesClusterStorageProfilePtrInput
// Specifies the support plan which should be used for this Kubernetes Cluster. Possible values are `KubernetesOfficial` and `AKSLongTermSupport`. Defaults to `KubernetesOfficial`.
SupportPlan pulumi.StringPtrInput
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapInput
// A `webAppRouting` block as defined below.
WebAppRouting KubernetesClusterWebAppRoutingPtrInput
// A `windowsProfile` block as defined below.
WindowsProfile KubernetesClusterWindowsProfilePtrInput
// A `workloadAutoscalerProfile` block defined below.
WorkloadAutoscalerProfile KubernetesClusterWorkloadAutoscalerProfilePtrInput
// Specifies whether Azure AD Workload Identity should be enabled for the Cluster. Defaults to `false`.
//
// > **Note:** To enable Azure AD Workload Identity `oidcIssuerEnabled` must be set to `true`.
//
// > **Note:** Enabling this option will allocate Workload Identity resources to the `kube-system` namespace in Kubernetes. If you wish to customize the deployment of Workload Identity, you can refer to [the documentation on Azure AD Workload Identity.](https://azure.github.io/azure-workload-identity/docs/installation/mutating-admission-webhook.html) The documentation provides guidance on how to install the mutating admission webhook, which allows for the customization of Workload Identity deployment.
WorkloadIdentityEnabled pulumi.BoolPtrInput
}
func (KubernetesClusterState) ElementType() reflect.Type {
return reflect.TypeOf((*kubernetesClusterState)(nil)).Elem()
}
type kubernetesClusterArgs struct {
// A `aciConnectorLinux` block as defined below. For more details, please visit [Create and configure an AKS cluster to use virtual nodes](https://docs.microsoft.com/azure/aks/virtual-nodes-portal).
AciConnectorLinux *KubernetesClusterAciConnectorLinux `pulumi:"aciConnectorLinux"`
// An `apiServerAccessProfile` block as defined below.
ApiServerAccessProfile *KubernetesClusterApiServerAccessProfile `pulumi:"apiServerAccessProfile"`
// Deprecated: This property has been renamed to `authorizedIpRanges` within the `apiServerAccessProfile` block and will be removed in v4.0 of the provider
ApiServerAuthorizedIpRanges []string `pulumi:"apiServerAuthorizedIpRanges"`
// A `autoScalerProfile` block as defined below.
AutoScalerProfile *KubernetesClusterAutoScalerProfile `pulumi:"autoScalerProfile"`
// The upgrade channel for this Kubernetes Cluster. Possible values are `patch`, `rapid`, `node-image` and `stable`. Omitting this field sets this value to `none`.
//
// !> **Note:** Cluster Auto-Upgrade will update the Kubernetes Cluster (and its Node Pools) to the latest GA version of Kubernetes automatically - please [see the Azure documentation for more information](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel).
//
// > **Note:** Cluster Auto-Upgrade only updates to GA versions of Kubernetes and will not update to Preview versions.
AutomaticChannelUpgrade *string `pulumi:"automaticChannelUpgrade"`
// A `azureActiveDirectoryRoleBasedAccessControl` block as defined below.
AzureActiveDirectoryRoleBasedAccessControl *KubernetesClusterAzureActiveDirectoryRoleBasedAccessControl `pulumi:"azureActiveDirectoryRoleBasedAccessControl"`
// Should the Azure Policy Add-On be enabled? For more details please visit [Understand Azure Policy for Azure Kubernetes Service](https://docs.microsoft.com/en-ie/azure/governance/policy/concepts/rego-for-aks)
AzurePolicyEnabled *bool `pulumi:"azurePolicyEnabled"`
// A `confidentialComputing` block as defined below. For more details please [the documentation](https://learn.microsoft.com/en-us/azure/confidential-computing/confidential-nodes-aks-overview)
ConfidentialComputing *KubernetesClusterConfidentialComputing `pulumi:"confidentialComputing"`
// A list of up to 10 base64 encoded CAs that will be added to the trust store on nodes with the `customCaTrustEnabled` feature enabled.
//
// > **Note:** Removing `customCaTrustCertificatesBase64` after it has been set forces a new resource to be created.
CustomCaTrustCertificatesBase64s []string `pulumi:"customCaTrustCertificatesBase64s"`
// A `defaultNodePool` block as defined below.
DefaultNodePool KubernetesClusterDefaultNodePool `pulumi:"defaultNodePool"`
// The ID of the Disk Encryption Set which should be used for the Nodes and Volumes. More information [can be found in the documentation](https://docs.microsoft.com/azure/aks/azure-disk-customer-managed-keys). Changing this forces a new resource to be created.
DiskEncryptionSetId *string `pulumi:"diskEncryptionSetId"`
// DNS prefix specified when creating the managed cluster. Possible values must begin and end with a letter or number, contain only letters, numbers, and hyphens and be between 1 and 54 characters in length. Changing this forces a new resource to be created.
DnsPrefix *string `pulumi:"dnsPrefix"`
// Specifies the DNS prefix to use with private clusters. Changing this forces a new resource to be created.
//
// > **Note:** You must define either a `dnsPrefix` or a `dnsPrefixPrivateCluster` field.
//
// In addition, one of either `identity` or `servicePrincipal` blocks must be specified.
DnsPrefixPrivateCluster *string `pulumi:"dnsPrefixPrivateCluster"`
// Specifies the Edge Zone within the Azure Region where this Managed Kubernetes Cluster should exist. Changing this forces a new resource to be created.
EdgeZone *string `pulumi:"edgeZone"`
// Deprecated: The AKS API has removed support for this field on 2020-10-15 and is no longer possible to configure this the Pod Security Policy.
EnablePodSecurityPolicy *bool `pulumi:"enablePodSecurityPolicy"`
// Should HTTP Application Routing be enabled?
//
// > **Note:** At this time HTTP Application Routing is not supported in Azure China or Azure US Government.
HttpApplicationRoutingEnabled *bool `pulumi:"httpApplicationRoutingEnabled"`
// A `httpProxyConfig` block as defined below.
HttpProxyConfig *KubernetesClusterHttpProxyConfig `pulumi:"httpProxyConfig"`
// An `identity` block as defined below. One of either `identity` or `servicePrincipal` must be specified.
//
// !> **Note:** A migration scenario from `servicePrincipal` to `identity` is supported. When upgrading `servicePrincipal` to `identity`, your cluster's control plane and addon pods will switch to use managed identity, but the kubelets will keep using your configured `servicePrincipal` until you upgrade your Node Pool.
Identity *KubernetesClusterIdentity `pulumi:"identity"`
// Specifies whether Image Cleaner is enabled.
ImageCleanerEnabled *bool `pulumi:"imageCleanerEnabled"`
// Specifies the interval in hours when images should be cleaned up. Defaults to `48`.
ImageCleanerIntervalHours *int `pulumi:"imageCleanerIntervalHours"`
// A `ingressApplicationGateway` block as defined below.
//
// > **Note:** Since the Application Gateway is deployed inside a Virtual Network, users (and Service Principals) that are operating the Application Gateway must have the `Microsoft.Network/virtualNetworks/subnets/join/action` permission on the Virtual Network or Subnet. For more details, please visit [Virtual Network Permission](https://learn.microsoft.com/en-us/azure/application-gateway/configuration-infrastructure#virtual-network-permission).
IngressApplicationGateway *KubernetesClusterIngressApplicationGateway `pulumi:"ingressApplicationGateway"`
// A `keyManagementService` block as defined below. For more details, please visit [Key Management Service (KMS) etcd encryption to an AKS cluster](https://learn.microsoft.com/en-us/azure/aks/use-kms-etcd-encryption).
KeyManagementService *KubernetesClusterKeyManagementService `pulumi:"keyManagementService"`
// A `keyVaultSecretsProvider` block as defined below. For more details, please visit [Azure Keyvault Secrets Provider for AKS](https://docs.microsoft.com/azure/aks/csi-secrets-store-driver).
KeyVaultSecretsProvider *KubernetesClusterKeyVaultSecretsProvider `pulumi:"keyVaultSecretsProvider"`
// A `kubeletIdentity` block as defined below.
KubeletIdentity *KubernetesClusterKubeletIdentity `pulumi:"kubeletIdentity"`
// Version of Kubernetes specified when creating the AKS managed cluster. If not specified, the latest recommended version will be used at provisioning time (but won't auto-upgrade). AKS does not require an exact patch version to be specified, minor version aliases such as `1.22` are also supported. - The minor version's latest GA patch is automatically chosen in that case. More details can be found in [the documentation](https://docs.microsoft.com/en-us/azure/aks/supported-kubernetes-versions?tabs=azure-cli#alias-minor-version).
//
// > **Note:** Upgrading your cluster may take up to 10 minutes per node.
KubernetesVersion *string `pulumi:"kubernetesVersion"`
// A `linuxProfile` block as defined below.
LinuxProfile *KubernetesClusterLinuxProfile `pulumi:"linuxProfile"`
// If `true` local accounts will be disabled. See [the documentation](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts) for more information.
//
// > **Note:** If `localAccountDisabled` is set to `true`, it is required to enable Kubernetes RBAC and AKS-managed Azure AD integration. See [the documentation](https://docs.microsoft.com/azure/aks/managed-aad#azure-ad-authentication-overview) for more information.
LocalAccountDisabled *bool `pulumi:"localAccountDisabled"`
// The location where the Managed Kubernetes Cluster should be created. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// A `maintenanceWindow` block as defined below.
MaintenanceWindow *KubernetesClusterMaintenanceWindow `pulumi:"maintenanceWindow"`
// A `maintenanceWindowAutoUpgrade` block as defined below.
MaintenanceWindowAutoUpgrade *KubernetesClusterMaintenanceWindowAutoUpgrade `pulumi:"maintenanceWindowAutoUpgrade"`
// A `maintenanceWindowNodeOs` block as defined below.
MaintenanceWindowNodeOs *KubernetesClusterMaintenanceWindowNodeOs `pulumi:"maintenanceWindowNodeOs"`
// A `microsoftDefender` block as defined below.
MicrosoftDefender *KubernetesClusterMicrosoftDefender `pulumi:"microsoftDefender"`
// Specifies a Prometheus add-on profile for the Kubernetes Cluster. A `monitorMetrics` block as defined below.
//
// > **Note:** If deploying Managed Prometheus, the `monitorMetrics` properties are required to configure the cluster for metrics collection. If no value is needed, set properties to `null`.
MonitorMetrics *KubernetesClusterMonitorMetrics `pulumi:"monitorMetrics"`
// The name of the Managed Kubernetes Cluster to create. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// A `networkProfile` block as defined below. Changing this forces a new resource to be created.
//
// > **Note:** If `networkProfile` is not defined, `kubenet` profile will be used by default.
NetworkProfile *KubernetesClusterNetworkProfile `pulumi:"networkProfile"`
// The upgrade channel for this Kubernetes Cluster Nodes' OS Image. Possible values are `Unmanaged`, `SecurityPatch`, `NodeImage` and `None`.
//
// > **Note:** `nodeOsChannelUpgrade` must be set to `NodeImage` if `automaticChannelUpgrade` has been set to `node-image`
//
// > **Note:** This requires that the Preview Feature `Microsoft.ContainerService/NodeOsUpgradeChannelPreview` is enabled and the Resource Provider is re-registered, see [the documentation](https://learn.microsoft.com/en-us/azure/aks/auto-upgrade-node-image#register-the-nodeosupgradechannelpreview-feature-flag) for more information.
NodeOsChannelUpgrade *string `pulumi:"nodeOsChannelUpgrade"`
// The name of the Resource Group where the Kubernetes Nodes should exist. Changing this forces a new resource to be created.
//
// > **Note:** Azure requires that a new, non-existent Resource Group is used, as otherwise, the provisioning of the Kubernetes Service will fail.
NodeResourceGroup *string `pulumi:"nodeResourceGroup"`
// Enable or Disable the [OIDC issuer URL](https://learn.microsoft.com/en-gb/azure/aks/use-oidc-issuer)
OidcIssuerEnabled *bool `pulumi:"oidcIssuerEnabled"`
// A `omsAgent` block as defined below.
OmsAgent *KubernetesClusterOmsAgent `pulumi:"omsAgent"`
// Is Open Service Mesh enabled? For more details, please visit [Open Service Mesh for AKS](https://docs.microsoft.com/azure/aks/open-service-mesh-about).
OpenServiceMeshEnabled *bool `pulumi:"openServiceMeshEnabled"`
// Should this Kubernetes Cluster have its API server only exposed on internal IP addresses? This provides a Private IP Address for the Kubernetes API on the Virtual Network where the Kubernetes Cluster is located. Defaults to `false`. Changing this forces a new resource to be created.
PrivateClusterEnabled *bool `pulumi:"privateClusterEnabled"`
// Specifies whether a Public FQDN for this Private Cluster should be added. Defaults to `false`.
//
// > **Note:** If you use BYO DNS Zone, the AKS cluster should either use a User Assigned Identity or a service principal (which is deprecated) with the `Private DNS Zone Contributor` role and access to this Private DNS Zone. If `UserAssigned` identity is used - to prevent improper resource order destruction - the cluster should depend on the role assignment, like in this example:
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization"
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice"
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleZone, err := privatedns.NewZone(ctx, "example", &privatedns.ZoneArgs{
// Name: pulumi.String("privatelink.eastus2.azmk8s.io"),
// ResourceGroupName: example.Name,
// })
// if err != nil {
// return err