Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.containerservice.kotlin
import com.pulumi.azure.containerservice.KubernetesClusterArgs.builder
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterAciConnectorLinuxArgs
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterAciConnectorLinuxArgsBuilder
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterApiServerAccessProfileArgs
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterApiServerAccessProfileArgsBuilder
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterAutoScalerProfileArgs
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterAutoScalerProfileArgsBuilder
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterAzureActiveDirectoryRoleBasedAccessControlArgs
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterAzureActiveDirectoryRoleBasedAccessControlArgsBuilder
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterConfidentialComputingArgs
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterConfidentialComputingArgsBuilder
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterDefaultNodePoolArgs
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterDefaultNodePoolArgsBuilder
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterHttpProxyConfigArgs
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterHttpProxyConfigArgsBuilder
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterIdentityArgs
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterIdentityArgsBuilder
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterIngressApplicationGatewayArgs
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterIngressApplicationGatewayArgsBuilder
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterKeyManagementServiceArgs
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterKeyManagementServiceArgsBuilder
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterKeyVaultSecretsProviderArgs
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterKeyVaultSecretsProviderArgsBuilder
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterKubeletIdentityArgs
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterKubeletIdentityArgsBuilder
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterLinuxProfileArgs
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterLinuxProfileArgsBuilder
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterMaintenanceWindowArgs
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterMaintenanceWindowArgsBuilder
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterMaintenanceWindowAutoUpgradeArgs
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterMaintenanceWindowAutoUpgradeArgsBuilder
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterMaintenanceWindowNodeOsArgs
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterMaintenanceWindowNodeOsArgsBuilder
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterMicrosoftDefenderArgs
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterMicrosoftDefenderArgsBuilder
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterMonitorMetricsArgs
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterMonitorMetricsArgsBuilder
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterNetworkProfileArgs
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterNetworkProfileArgsBuilder
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterOmsAgentArgs
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterOmsAgentArgsBuilder
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterServiceMeshProfileArgs
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterServiceMeshProfileArgsBuilder
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterServicePrincipalArgs
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterServicePrincipalArgsBuilder
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterStorageProfileArgs
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterStorageProfileArgsBuilder
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterWebAppRoutingArgs
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterWebAppRoutingArgsBuilder
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterWindowsProfileArgs
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterWindowsProfileArgsBuilder
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterWorkloadAutoscalerProfileArgs
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterWorkloadAutoscalerProfileArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Deprecated
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* Manages a Managed Kubernetes Cluster (also known as AKS / Azure Kubernetes Service)
* ## Example Usage
* This example provisions a basic Managed Kubernetes Cluster.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = new azure.core.ResourceGroup("example", {
* name: "example-resources",
* location: "West Europe",
* });
* const exampleKubernetesCluster = new azure.containerservice.KubernetesCluster("example", {
* name: "example-aks1",
* location: example.location,
* resourceGroupName: example.name,
* dnsPrefix: "exampleaks1",
* defaultNodePool: {
* name: "default",
* nodeCount: 1,
* vmSize: "Standard_D2_v2",
* },
* identity: {
* type: "SystemAssigned",
* },
* tags: {
* Environment: "Production",
* },
* });
* export const clientCertificate = exampleKubernetesCluster.kubeConfigs.apply(kubeConfigs => kubeConfigs[0].clientCertificate);
* export const kubeConfig = exampleKubernetesCluster.kubeConfigRaw;
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.core.ResourceGroup("example",
* name="example-resources",
* location="West Europe")
* example_kubernetes_cluster = azure.containerservice.KubernetesCluster("example",
* name="example-aks1",
* location=example.location,
* resource_group_name=example.name,
* dns_prefix="exampleaks1",
* default_node_pool=azure.containerservice.KubernetesClusterDefaultNodePoolArgs(
* name="default",
* node_count=1,
* vm_size="Standard_D2_v2",
* ),
* identity=azure.containerservice.KubernetesClusterIdentityArgs(
* type="SystemAssigned",
* ),
* tags={
* "Environment": "Production",
* })
* pulumi.export("clientCertificate", example_kubernetes_cluster.kube_configs[0].client_certificate)
* pulumi.export("kubeConfig", example_kubernetes_cluster.kube_config_raw)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var example = new Azure.Core.ResourceGroup("example", new()
* {
* Name = "example-resources",
* Location = "West Europe",
* });
* var exampleKubernetesCluster = new Azure.ContainerService.KubernetesCluster("example", new()
* {
* Name = "example-aks1",
* Location = example.Location,
* ResourceGroupName = example.Name,
* DnsPrefix = "exampleaks1",
* DefaultNodePool = new Azure.ContainerService.Inputs.KubernetesClusterDefaultNodePoolArgs
* {
* Name = "default",
* NodeCount = 1,
* VmSize = "Standard_D2_v2",
* },
* Identity = new Azure.ContainerService.Inputs.KubernetesClusterIdentityArgs
* {
* Type = "SystemAssigned",
* },
* Tags =
* {
* { "Environment", "Production" },
* },
* });
* return new Dictionary
* {
* ["clientCertificate"] = exampleKubernetesCluster.KubeConfigs.Apply(kubeConfigs => kubeConfigs[0].ClientCertificate),
* ["kubeConfig"] = exampleKubernetesCluster.KubeConfigRaw,
* };
* });
* ```
* ```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
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azure.core.ResourceGroup;
* import com.pulumi.azure.core.ResourceGroupArgs;
* import com.pulumi.azure.containerservice.KubernetesCluster;
* import com.pulumi.azure.containerservice.KubernetesClusterArgs;
* import com.pulumi.azure.containerservice.inputs.KubernetesClusterDefaultNodePoolArgs;
* import com.pulumi.azure.containerservice.inputs.KubernetesClusterIdentityArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var example = new ResourceGroup("example", ResourceGroupArgs.builder()
* .name("example-resources")
* .location("West Europe")
* .build());
* var exampleKubernetesCluster = new KubernetesCluster("exampleKubernetesCluster", KubernetesClusterArgs.builder()
* .name("example-aks1")
* .location(example.location())
* .resourceGroupName(example.name())
* .dnsPrefix("exampleaks1")
* .defaultNodePool(KubernetesClusterDefaultNodePoolArgs.builder()
* .name("default")
* .nodeCount(1)
* .vmSize("Standard_D2_v2")
* .build())
* .identity(KubernetesClusterIdentityArgs.builder()
* .type("SystemAssigned")
* .build())
* .tags(Map.of("Environment", "Production"))
* .build());
* ctx.export("clientCertificate", exampleKubernetesCluster.kubeConfigs().applyValue(kubeConfigs -> kubeConfigs[0].clientCertificate()));
* ctx.export("kubeConfig", exampleKubernetesCluster.kubeConfigRaw());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: azure:core:ResourceGroup
* properties:
* name: example-resources
* location: West Europe
* exampleKubernetesCluster:
* type: azure:containerservice:KubernetesCluster
* name: example
* properties:
* name: example-aks1
* location: ${example.location}
* resourceGroupName: ${example.name}
* dnsPrefix: exampleaks1
* defaultNodePool:
* name: default
* nodeCount: 1
* vmSize: Standard_D2_v2
* identity:
* type: SystemAssigned
* tags:
* Environment: Production
* outputs:
* clientCertificate: ${exampleKubernetesCluster.kubeConfigs[0].clientCertificate}
* kubeConfig: ${exampleKubernetesCluster.kubeConfigRaw}
* ```
*
* ## 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
* ```
* @property aciConnectorLinux A `aci_connector_linux` 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).
* @property apiServerAccessProfile An `api_server_access_profile` block as defined below.
* @property apiServerAuthorizedIpRanges
* @property autoScalerProfile A `auto_scaler_profile` block as defined below.
* @property automaticChannelUpgrade 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.
* @property azureActiveDirectoryRoleBasedAccessControl A `azure_active_directory_role_based_access_control` block as defined below.
* @property azurePolicyEnabled 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)
* @property confidentialComputing A `confidential_computing` block as defined below. For more details please [the documentation](https://learn.microsoft.com/en-us/azure/confidential-computing/confidential-nodes-aks-overview)
* @property customCaTrustCertificatesBase64s A list of up to 10 base64 encoded CAs that will be added to the trust store on nodes with the `custom_ca_trust_enabled` feature enabled.
* > **Note:** Removing `custom_ca_trust_certificates_base64` after it has been set forces a new resource to be created.
* @property defaultNodePool A `default_node_pool` block as defined below.
* @property diskEncryptionSetId 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.
* @property dnsPrefix 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.
* @property dnsPrefixPrivateCluster Specifies the DNS prefix to use with private clusters. Changing this forces a new resource to be created.
* > **Note:** You must define either a `dns_prefix` or a `dns_prefix_private_cluster` field.
* In addition, one of either `identity` or `service_principal` blocks must be specified.
* @property edgeZone Specifies the Edge Zone within the Azure Region where this Managed Kubernetes Cluster should exist. Changing this forces a new resource to be created.
* @property enablePodSecurityPolicy
* @property httpApplicationRoutingEnabled Should HTTP Application Routing be enabled?
* > **Note:** At this time HTTP Application Routing is not supported in Azure China or Azure US Government.
* @property httpProxyConfig A `http_proxy_config` block as defined below.
* @property identity An `identity` block as defined below. One of either `identity` or `service_principal` must be specified.
* !> **Note:** A migration scenario from `service_principal` to `identity` is supported. When upgrading `service_principal` to `identity`, your cluster's control plane and addon pods will switch to use managed identity, but the kubelets will keep using your configured `service_principal` until you upgrade your Node Pool.
* @property imageCleanerEnabled Specifies whether Image Cleaner is enabled.
* @property imageCleanerIntervalHours Specifies the interval in hours when images should be cleaned up. Defaults to `48`.
* @property ingressApplicationGateway A `ingress_application_gateway` 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).
* @property keyManagementService A `key_management_service` 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).
* @property keyVaultSecretsProvider A `key_vault_secrets_provider` 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).
* @property kubeletIdentity A `kubelet_identity` block as defined below.
* @property kubernetesVersion 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.
* @property linuxProfile A `linux_profile` block as defined below.
* @property localAccountDisabled 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 `local_account_disabled` 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.
* @property location The location where the Managed Kubernetes Cluster should be created. Changing this forces a new resource to be created.
* @property maintenanceWindow A `maintenance_window` block as defined below.
* @property maintenanceWindowAutoUpgrade A `maintenance_window_auto_upgrade` block as defined below.
* @property maintenanceWindowNodeOs A `maintenance_window_node_os` block as defined below.
* @property microsoftDefender A `microsoft_defender` block as defined below.
* @property monitorMetrics Specifies a Prometheus add-on profile for the Kubernetes Cluster. A `monitor_metrics` block as defined below.
* > **Note:** If deploying Managed Prometheus, the `monitor_metrics` properties are required to configure the cluster for metrics collection. If no value is needed, set properties to `null`.
* @property name The name of the Managed Kubernetes Cluster to create. Changing this forces a new resource to be created.
* @property networkProfile A `network_profile` block as defined below. Changing this forces a new resource to be created.
* > **Note:** If `network_profile` is not defined, `kubenet` profile will be used by default.
* @property nodeOsChannelUpgrade The upgrade channel for this Kubernetes Cluster Nodes' OS Image. Possible values are `Unmanaged`, `SecurityPatch`, `NodeImage` and `None`.
* > **Note:** `node_os_channel_upgrade` must be set to `NodeImage` if `automatic_channel_upgrade` 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.
* @property nodeResourceGroup 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.
* @property oidcIssuerEnabled Enable or Disable the [OIDC issuer URL](https://learn.microsoft.com/en-gb/azure/aks/use-oidc-issuer)
* @property omsAgent A `oms_agent` block as defined below.
* @property openServiceMeshEnabled 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).
* @property privateClusterEnabled 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.
* @property privateClusterPublicFqdnEnabled 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:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = new azure.core.ResourceGroup("example", {
* name: "example",
* location: "West Europe",
* });
* const exampleZone = new azure.privatedns.Zone("example", {
* name: "privatelink.eastus2.azmk8s.io",
* resourceGroupName: example.name,
* });
* const exampleUserAssignedIdentity = new azure.authorization.UserAssignedIdentity("example", {
* name: "aks-example-identity",
* resourceGroupName: example.name,
* location: example.location,
* });
* const exampleAssignment = new azure.authorization.Assignment("example", {
* scope: exampleZone.id,
* roleDefinitionName: "Private DNS Zone Contributor",
* principalId: exampleUserAssignedIdentity.principalId,
* });
* const exampleKubernetesCluster = new azure.containerservice.KubernetesCluster("example", {
* name: "aksexamplewithprivatednszone1",
* location: example.location,
* resourceGroupName: example.name,
* dnsPrefix: "aksexamplednsprefix1",
* privateClusterEnabled: true,
* privateDnsZoneId: exampleZone.id,
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.core.ResourceGroup("example",
* name="example",
* location="West Europe")
* example_zone = azure.privatedns.Zone("example",
* name="privatelink.eastus2.azmk8s.io",
* resource_group_name=example.name)
* example_user_assigned_identity = azure.authorization.UserAssignedIdentity("example",
* name="aks-example-identity",
* resource_group_name=example.name,
* location=example.location)
* example_assignment = azure.authorization.Assignment("example",
* scope=example_zone.id,
* role_definition_name="Private DNS Zone Contributor",
* principal_id=example_user_assigned_identity.principal_id)
* example_kubernetes_cluster = azure.containerservice.KubernetesCluster("example",
* name="aksexamplewithprivatednszone1",
* location=example.location,
* resource_group_name=example.name,
* dns_prefix="aksexamplednsprefix1",
* private_cluster_enabled=True,
* private_dns_zone_id=example_zone.id)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var example = new Azure.Core.ResourceGroup("example", new()
* {
* Name = "example",
* Location = "West Europe",
* });
* var exampleZone = new Azure.PrivateDns.Zone("example", new()
* {
* Name = "privatelink.eastus2.azmk8s.io",
* ResourceGroupName = example.Name,
* });
* var exampleUserAssignedIdentity = new Azure.Authorization.UserAssignedIdentity("example", new()
* {
* Name = "aks-example-identity",
* ResourceGroupName = example.Name,
* Location = example.Location,
* });
* var exampleAssignment = new Azure.Authorization.Assignment("example", new()
* {
* Scope = exampleZone.Id,
* RoleDefinitionName = "Private DNS Zone Contributor",
* PrincipalId = exampleUserAssignedIdentity.PrincipalId,
* });
* var exampleKubernetesCluster = new Azure.ContainerService.KubernetesCluster("example", new()
* {
* Name = "aksexamplewithprivatednszone1",
* Location = example.Location,
* ResourceGroupName = example.Name,
* DnsPrefix = "aksexamplednsprefix1",
* PrivateClusterEnabled = true,
* PrivateDnsZoneId = exampleZone.Id,
* });
* });
* ```
* ```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
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azure.core.ResourceGroup;
* import com.pulumi.azure.core.ResourceGroupArgs;
* import com.pulumi.azure.privatedns.Zone;
* import com.pulumi.azure.privatedns.ZoneArgs;
* import com.pulumi.azure.authorization.UserAssignedIdentity;
* import com.pulumi.azure.authorization.UserAssignedIdentityArgs;
* import com.pulumi.azure.authorization.Assignment;
* import com.pulumi.azure.authorization.AssignmentArgs;
* import com.pulumi.azure.containerservice.KubernetesCluster;
* import com.pulumi.azure.containerservice.KubernetesClusterArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var example = new ResourceGroup("example", ResourceGroupArgs.builder()
* .name("example")
* .location("West Europe")
* .build());
* var exampleZone = new Zone("exampleZone", ZoneArgs.builder()
* .name("privatelink.eastus2.azmk8s.io")
* .resourceGroupName(example.name())
* .build());
* var exampleUserAssignedIdentity = new UserAssignedIdentity("exampleUserAssignedIdentity", UserAssignedIdentityArgs.builder()
* .name("aks-example-identity")
* .resourceGroupName(example.name())
* .location(example.location())
* .build());
* var exampleAssignment = new Assignment("exampleAssignment", AssignmentArgs.builder()
* .scope(exampleZone.id())
* .roleDefinitionName("Private DNS Zone Contributor")
* .principalId(exampleUserAssignedIdentity.principalId())
* .build());
* var exampleKubernetesCluster = new KubernetesCluster("exampleKubernetesCluster", KubernetesClusterArgs.builder()
* .name("aksexamplewithprivatednszone1")
* .location(example.location())
* .resourceGroupName(example.name())
* .dnsPrefix("aksexamplednsprefix1")
* .privateClusterEnabled(true)
* .privateDnsZoneId(exampleZone.id())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: azure:core:ResourceGroup
* properties:
* name: example
* location: West Europe
* exampleZone:
* type: azure:privatedns:Zone
* name: example
* properties:
* name: privatelink.eastus2.azmk8s.io
* resourceGroupName: ${example.name}
* exampleUserAssignedIdentity:
* type: azure:authorization:UserAssignedIdentity
* name: example
* properties:
* name: aks-example-identity
* resourceGroupName: ${example.name}
* location: ${example.location}
* exampleAssignment:
* type: azure:authorization:Assignment
* name: example
* properties:
* scope: ${exampleZone.id}
* roleDefinitionName: Private DNS Zone Contributor
* principalId: ${exampleUserAssignedIdentity.principalId}
* exampleKubernetesCluster:
* type: azure:containerservice:KubernetesCluster
* name: example
* properties:
* name: aksexamplewithprivatednszone1
* location: ${example.location}
* resourceGroupName: ${example.name}
* dnsPrefix: aksexamplednsprefix1
* privateClusterEnabled: true
* privateDnsZoneId: ${exampleZone.id}
* ```
*
* @property privateDnsZoneId 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.
* @property publicNetworkAccessEnabled Whether public network access is allowed for this Kubernetes Cluster. Defaults to `true`.
* !> **Note:** `public_network_access_enabled` 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 `private_cluster_enabled` and `api_server_access_profile`.
* @property resourceGroupName Specifies the Resource Group where the Managed Kubernetes Cluster should exist. Changing this forces a new resource to be created.
* @property roleBasedAccessControlEnabled Whether Role Based Access Control for the Kubernetes Cluster should be enabled. Defaults to `true`. Changing this forces a new resource to be created.
* @property runCommandEnabled Whether to enable run command for the cluster or not. Defaults to `true`.
* @property serviceMeshProfile A `service_mesh_profile` 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.
* @property servicePrincipal A `service_principal` block as documented below. One of either `identity` or `service_principal` must be specified.
* !> **Note:** A migration scenario from `service_principal` to `identity` is supported. When upgrading `service_principal` to `identity`, your cluster's control plane and addon pods will switch to use managed identity, but the kubelets will keep using your configured `service_principal` until you upgrade your Node Pool.
* @property skuTier 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`.
* @property storageProfile A `storage_profile` block as defined below.
* @property supportPlan Specifies the support plan which should be used for this Kubernetes Cluster. Possible values are `KubernetesOfficial` and `AKSLongTermSupport`. Defaults to `KubernetesOfficial`.
* @property tags A mapping of tags to assign to the resource.
* @property webAppRouting A `web_app_routing` block as defined below.
* @property windowsProfile A `windows_profile` block as defined below.
* @property workloadAutoscalerProfile A `workload_autoscaler_profile` block defined below.
* @property workloadIdentityEnabled Specifies whether Azure AD Workload Identity should be enabled for the Cluster. Defaults to `false`.
* > **Note:** To enable Azure AD Workload Identity `oidc_issuer_enabled` 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.
*/
public data class KubernetesClusterArgs(
public val aciConnectorLinux: Output? = null,
public val apiServerAccessProfile: Output? = null,
@Deprecated(
message = """
This property has been renamed to `authorized_ip_ranges` within the `api_server_access_profile`
block and will be removed in v4.0 of the provider
""",
)
public val apiServerAuthorizedIpRanges: Output>? = null,
public val autoScalerProfile: Output? = null,
public val automaticChannelUpgrade: Output? = null,
public val azureActiveDirectoryRoleBasedAccessControl:
Output? = null,
public val azurePolicyEnabled: Output? = null,
public val confidentialComputing: Output? = null,
public val customCaTrustCertificatesBase64s: Output>? = null,
public val defaultNodePool: Output? = null,
public val diskEncryptionSetId: Output? = null,
public val dnsPrefix: Output? = null,
public val dnsPrefixPrivateCluster: Output? = null,
public val edgeZone: Output? = null,
@Deprecated(
message = """
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.
""",
)
public val enablePodSecurityPolicy: Output? = null,
public val httpApplicationRoutingEnabled: Output? = null,
public val httpProxyConfig: Output? = null,
public val identity: Output? = null,
public val imageCleanerEnabled: Output? = null,
public val imageCleanerIntervalHours: Output? = null,
public val ingressApplicationGateway: Output? =
null,
public val keyManagementService: Output? = null,
public val keyVaultSecretsProvider: Output? = null,
public val kubeletIdentity: Output? = null,
public val kubernetesVersion: Output? = null,
public val linuxProfile: Output? = null,
public val localAccountDisabled: Output? = null,
public val location: Output? = null,
public val maintenanceWindow: Output? = null,
public val maintenanceWindowAutoUpgrade:
Output? = null,
public val maintenanceWindowNodeOs: Output? = null,
public val microsoftDefender: Output? = null,
public val monitorMetrics: Output? = null,
public val name: Output? = null,
public val networkProfile: Output? = null,
public val nodeOsChannelUpgrade: Output? = null,
public val nodeResourceGroup: Output? = null,
public val oidcIssuerEnabled: Output? = null,
public val omsAgent: Output? = null,
public val openServiceMeshEnabled: Output? = null,
public val privateClusterEnabled: Output? = null,
public val privateClusterPublicFqdnEnabled: Output? = null,
public val privateDnsZoneId: Output? = null,
@Deprecated(
message = """
`public_network_access_enabled` is currently not functional and is not be passed to the API
""",
)
public val publicNetworkAccessEnabled: Output? = null,
public val resourceGroupName: Output? = null,
public val roleBasedAccessControlEnabled: Output? = null,
public val runCommandEnabled: Output? = null,
public val serviceMeshProfile: Output? = null,
public val servicePrincipal: Output? = null,
public val skuTier: Output? = null,
public val storageProfile: Output? = null,
public val supportPlan: Output? = null,
public val tags: Output