public class ManagedCluster
extends com.pulumi.resources.CustomResource
Managed cluster.
API Version: 2021-03-01.
## Example Usage
### Create Managed Cluster with Azure KeyVault Secrets Provider Addon
```java
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.containerservice.ManagedCluster;
import com.pulumi.azurenative.containerservice.ManagedClusterArgs;
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 managedCluster = new ManagedCluster("managedCluster", ManagedClusterArgs.builder()
.addonProfiles(Map.of("azureKeyvaultSecretsProvider", Map.ofEntries(
Map.entry("config", Map.of("enableSecretRotation", "true")),
Map.entry("enabled", true)
)))
.agentPoolProfiles(Map.ofEntries(
Map.entry("count", 3),
Map.entry("enableNodePublicIP", true),
Map.entry("mode", "System"),
Map.entry("name", "nodepool1"),
Map.entry("osType", "Linux"),
Map.entry("type", "VirtualMachineScaleSets"),
Map.entry("vmSize", "Standard_DS2_v2")
))
.autoScalerProfile(Map.ofEntries(
Map.entry("scaleDownDelayAfterAdd", "15m"),
Map.entry("scanInterval", "20s")
))
.diskEncryptionSetID("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des")
.dnsPrefix("dnsprefix1")
.enablePodSecurityPolicy(true)
.enableRBAC(true)
.kubernetesVersion("")
.linuxProfile(Map.ofEntries(
Map.entry("adminUsername", "azureuser"),
Map.entry("ssh", Map.of("publicKeys", Map.of("keyData", "keydata")))
))
.location("location1")
.networkProfile(Map.ofEntries(
Map.entry("loadBalancerProfile", Map.of("managedOutboundIPs", Map.of("count", 2))),
Map.entry("loadBalancerSku", "standard"),
Map.entry("outboundType", "loadBalancer")
))
.resourceGroupName("rg1")
.resourceName("clustername1")
.servicePrincipalProfile(Map.ofEntries(
Map.entry("clientId", "clientid"),
Map.entry("secret", "secret")
))
.sku(Map.ofEntries(
Map.entry("name", "Basic"),
Map.entry("tier", "Free")
))
.tags(Map.ofEntries(
Map.entry("archv2", ""),
Map.entry("tier", "production")
))
.windowsProfile(Map.ofEntries(
Map.entry("adminPassword", "replacePassword1234$"),
Map.entry("adminUsername", "azureuser")
))
.build());
}
}
```
### Create Managed Cluster with EncryptionAtHost enabled
```java
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.containerservice.ManagedCluster;
import com.pulumi.azurenative.containerservice.ManagedClusterArgs;
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 managedCluster = new ManagedCluster("managedCluster", ManagedClusterArgs.builder()
.addonProfiles()
.agentPoolProfiles(Map.ofEntries(
Map.entry("count", 3),
Map.entry("enableEncryptionAtHost", true),
Map.entry("enableNodePublicIP", true),
Map.entry("mode", "System"),
Map.entry("name", "nodepool1"),
Map.entry("osType", "Linux"),
Map.entry("type", "VirtualMachineScaleSets"),
Map.entry("vmSize", "Standard_DS2_v2")
))
.autoScalerProfile(Map.ofEntries(
Map.entry("scaleDownDelayAfterAdd", "15m"),
Map.entry("scanInterval", "20s")
))
.diskEncryptionSetID("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des")
.dnsPrefix("dnsprefix1")
.enablePodSecurityPolicy(true)
.enableRBAC(true)
.kubernetesVersion("")
.linuxProfile(Map.ofEntries(
Map.entry("adminUsername", "azureuser"),
Map.entry("ssh", Map.of("publicKeys", Map.of("keyData", "keydata")))
))
.location("location1")
.networkProfile(Map.ofEntries(
Map.entry("loadBalancerProfile", Map.of("managedOutboundIPs", Map.of("count", 2))),
Map.entry("loadBalancerSku", "standard"),
Map.entry("outboundType", "loadBalancer")
))
.resourceGroupName("rg1")
.resourceName("clustername1")
.servicePrincipalProfile(Map.ofEntries(
Map.entry("clientId", "clientid"),
Map.entry("secret", "secret")
))
.sku(Map.ofEntries(
Map.entry("name", "Basic"),
Map.entry("tier", "Free")
))
.tags(Map.ofEntries(
Map.entry("archv2", ""),
Map.entry("tier", "production")
))
.windowsProfile(Map.ofEntries(
Map.entry("adminPassword", "replacePassword1234$"),
Map.entry("adminUsername", "azureuser")
))
.build());
}
}
```
### Create Managed Cluster with FIPS enabled OS
```java
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.containerservice.ManagedCluster;
import com.pulumi.azurenative.containerservice.ManagedClusterArgs;
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 managedCluster = new ManagedCluster("managedCluster", ManagedClusterArgs.builder()
.addonProfiles()
.agentPoolProfiles(Map.ofEntries(
Map.entry("count", 3),
Map.entry("enableFIPS", true),
Map.entry("enableNodePublicIP", true),
Map.entry("mode", "System"),
Map.entry("name", "nodepool1"),
Map.entry("osType", "Linux"),
Map.entry("type", "VirtualMachineScaleSets"),
Map.entry("vmSize", "Standard_DS2_v2")
))
.autoScalerProfile(Map.ofEntries(
Map.entry("scaleDownDelayAfterAdd", "15m"),
Map.entry("scanInterval", "20s")
))
.diskEncryptionSetID("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des")
.dnsPrefix("dnsprefix1")
.enablePodSecurityPolicy(false)
.enableRBAC(true)
.kubernetesVersion("")
.linuxProfile(Map.ofEntries(
Map.entry("adminUsername", "azureuser"),
Map.entry("ssh", Map.of("publicKeys", Map.of("keyData", "keydata")))
))
.location("location1")
.networkProfile(Map.ofEntries(
Map.entry("loadBalancerProfile", Map.of("managedOutboundIPs", Map.of("count", 2))),
Map.entry("loadBalancerSku", "standard"),
Map.entry("outboundType", "loadBalancer")
))
.resourceGroupName("rg1")
.resourceName("clustername1")
.servicePrincipalProfile(Map.ofEntries(
Map.entry("clientId", "clientid"),
Map.entry("secret", "secret")
))
.sku(Map.ofEntries(
Map.entry("name", "Basic"),
Map.entry("tier", "Free")
))
.tags(Map.ofEntries(
Map.entry("archv2", ""),
Map.entry("tier", "production")
))
.windowsProfile(Map.ofEntries(
Map.entry("adminPassword", "replacePassword1234$"),
Map.entry("adminUsername", "azureuser")
))
.build());
}
}
```
### Create Managed Cluster with GPUMIG
```java
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.containerservice.ManagedCluster;
import com.pulumi.azurenative.containerservice.ManagedClusterArgs;
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 managedCluster = new ManagedCluster("managedCluster", ManagedClusterArgs.builder()
.addonProfiles()
.agentPoolProfiles(Map.ofEntries(
Map.entry("count", 3),
Map.entry("enableNodePublicIP", true),
Map.entry("gpuInstanceProfile", "MIG3g"),
Map.entry("mode", "System"),
Map.entry("name", "nodepool1"),
Map.entry("osType", "Linux"),
Map.entry("type", "VirtualMachineScaleSets"),
Map.entry("vmSize", "Standard_ND96asr_v4")
))
.autoScalerProfile(Map.ofEntries(
Map.entry("scaleDownDelayAfterAdd", "15m"),
Map.entry("scanInterval", "20s")
))
.diskEncryptionSetID("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des")
.dnsPrefix("dnsprefix1")
.enablePodSecurityPolicy(true)
.enableRBAC(true)
.httpProxyConfig(Map.ofEntries(
Map.entry("httpProxy", "http://myproxy.server.com:8080"),
Map.entry("httpsProxy", "https://myproxy.server.com:8080"),
Map.entry("noProxy",
"localhost",
"127.0.0.1"),
Map.entry("trustedCa", "Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=")
))
.kubernetesVersion("")
.linuxProfile(Map.ofEntries(
Map.entry("adminUsername", "azureuser"),
Map.entry("ssh", Map.of("publicKeys", Map.of("keyData", "keydata")))
))
.location("location1")
.networkProfile(Map.ofEntries(
Map.entry("loadBalancerProfile", Map.of("managedOutboundIPs", Map.of("count", 2))),
Map.entry("loadBalancerSku", "standard"),
Map.entry("outboundType", "loadBalancer")
))
.resourceGroupName("rg1")
.resourceName("clustername1")
.servicePrincipalProfile(Map.ofEntries(
Map.entry("clientId", "clientid"),
Map.entry("secret", "secret")
))
.sku(Map.ofEntries(
Map.entry("name", "Basic"),
Map.entry("tier", "Free")
))
.tags(Map.ofEntries(
Map.entry("archv2", ""),
Map.entry("tier", "production")
))
.windowsProfile(Map.ofEntries(
Map.entry("adminPassword", "replacePassword1234$"),
Map.entry("adminUsername", "azureuser")
))
.build());
}
}
```
### Create Managed Cluster with HTTP proxy configured
```java
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.containerservice.ManagedCluster;
import com.pulumi.azurenative.containerservice.ManagedClusterArgs;
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 managedCluster = new ManagedCluster("managedCluster", ManagedClusterArgs.builder()
.addonProfiles()
.agentPoolProfiles(Map.ofEntries(
Map.entry("count", 3),
Map.entry("enableNodePublicIP", true),
Map.entry("mode", "System"),
Map.entry("name", "nodepool1"),
Map.entry("osType", "Linux"),
Map.entry("type", "VirtualMachineScaleSets"),
Map.entry("vmSize", "Standard_DS2_v2")
))
.autoScalerProfile(Map.ofEntries(
Map.entry("scaleDownDelayAfterAdd", "15m"),
Map.entry("scanInterval", "20s")
))
.diskEncryptionSetID("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des")
.dnsPrefix("dnsprefix1")
.enablePodSecurityPolicy(true)
.enableRBAC(true)
.httpProxyConfig(Map.ofEntries(
Map.entry("httpProxy", "http://myproxy.server.com:8080"),
Map.entry("httpsProxy", "https://myproxy.server.com:8080"),
Map.entry("noProxy",
"localhost",
"127.0.0.1"),
Map.entry("trustedCa", "Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=")
))
.kubernetesVersion("")
.linuxProfile(Map.ofEntries(
Map.entry("adminUsername", "azureuser"),
Map.entry("ssh", Map.of("publicKeys", Map.of("keyData", "keydata")))
))
.location("location1")
.networkProfile(Map.ofEntries(
Map.entry("loadBalancerProfile", Map.of("managedOutboundIPs", Map.of("count", 2))),
Map.entry("loadBalancerSku", "standard"),
Map.entry("outboundType", "loadBalancer")
))
.resourceGroupName("rg1")
.resourceName("clustername1")
.servicePrincipalProfile(Map.ofEntries(
Map.entry("clientId", "clientid"),
Map.entry("secret", "secret")
))
.sku(Map.ofEntries(
Map.entry("name", "Basic"),
Map.entry("tier", "Free")
))
.tags(Map.ofEntries(
Map.entry("archv2", ""),
Map.entry("tier", "production")
))
.windowsProfile(Map.ofEntries(
Map.entry("adminPassword", "replacePassword1234$"),
Map.entry("adminUsername", "azureuser")
))
.build());
}
}
```
### Create Managed Cluster with Node Public IP Prefix
```java
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.containerservice.ManagedCluster;
import com.pulumi.azurenative.containerservice.ManagedClusterArgs;
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 managedCluster = new ManagedCluster("managedCluster", ManagedClusterArgs.builder()
.addonProfiles()
.agentPoolProfiles(Map.ofEntries(
Map.entry("count", 3),
Map.entry("enableNodePublicIP", true),
Map.entry("mode", "System"),
Map.entry("name", "nodepool1"),
Map.entry("nodePublicIPPrefixID", "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.Network/publicIPPrefixes/public-ip-prefix"),
Map.entry("osType", "Linux"),
Map.entry("type", "VirtualMachineScaleSets"),
Map.entry("vmSize", "Standard_DS2_v2")
))
.autoScalerProfile(Map.ofEntries(
Map.entry("scaleDownDelayAfterAdd", "15m"),
Map.entry("scanInterval", "20s")
))
.diskEncryptionSetID("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des")
.dnsPrefix("dnsprefix1")
.enablePodSecurityPolicy(true)
.enableRBAC(true)
.kubernetesVersion("")
.linuxProfile(Map.ofEntries(
Map.entry("adminUsername", "azureuser"),
Map.entry("ssh", Map.of("publicKeys", Map.of("keyData", "keydata")))
))
.location("location1")
.networkProfile(Map.ofEntries(
Map.entry("loadBalancerProfile", Map.of("managedOutboundIPs", Map.of("count", 2))),
Map.entry("loadBalancerSku", "standard"),
Map.entry("outboundType", "loadBalancer")
))
.resourceGroupName("rg1")
.resourceName("clustername1")
.servicePrincipalProfile(Map.ofEntries(
Map.entry("clientId", "clientid"),
Map.entry("secret", "secret")
))
.sku(Map.ofEntries(
Map.entry("name", "Basic"),
Map.entry("tier", "Free")
))
.tags(Map.ofEntries(
Map.entry("archv2", ""),
Map.entry("tier", "production")
))
.windowsProfile(Map.ofEntries(
Map.entry("adminPassword", "replacePassword1234$"),
Map.entry("adminUsername", "azureuser")
))
.build());
}
}
```
### Create Managed Cluster with OSSKU
```java
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.containerservice.ManagedCluster;
import com.pulumi.azurenative.containerservice.ManagedClusterArgs;
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 managedCluster = new ManagedCluster("managedCluster", ManagedClusterArgs.builder()
.addonProfiles()
.agentPoolProfiles(Map.ofEntries(
Map.entry("count", 3),
Map.entry("enableNodePublicIP", true),
Map.entry("mode", "System"),
Map.entry("name", "nodepool1"),
Map.entry("osSKU", "CBLMariner"),
Map.entry("osType", "Linux"),
Map.entry("type", "VirtualMachineScaleSets"),
Map.entry("vmSize", "Standard_DS2_v2")
))
.autoScalerProfile(Map.ofEntries(
Map.entry("scaleDownDelayAfterAdd", "15m"),
Map.entry("scanInterval", "20s")
))
.diskEncryptionSetID("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des")
.dnsPrefix("dnsprefix1")
.enablePodSecurityPolicy(true)
.enableRBAC(true)
.httpProxyConfig(Map.ofEntries(
Map.entry("httpProxy", "http://myproxy.server.com:8080"),
Map.entry("httpsProxy", "https://myproxy.server.com:8080"),
Map.entry("noProxy",
"localhost",
"127.0.0.1"),
Map.entry("trustedCa", "Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=")
))
.kubernetesVersion("")
.linuxProfile(Map.ofEntries(
Map.entry("adminUsername", "azureuser"),
Map.entry("ssh", Map.of("publicKeys", Map.of("keyData", "keydata")))
))
.location("location1")
.networkProfile(Map.ofEntries(
Map.entry("loadBalancerProfile", Map.of("managedOutboundIPs", Map.of("count", 2))),
Map.entry("loadBalancerSku", "standard"),
Map.entry("outboundType", "loadBalancer")
))
.resourceGroupName("rg1")
.resourceName("clustername1")
.servicePrincipalProfile(Map.ofEntries(
Map.entry("clientId", "clientid"),
Map.entry("secret", "secret")
))
.sku(Map.ofEntries(
Map.entry("name", "Basic"),
Map.entry("tier", "Free")
))
.tags(Map.ofEntries(
Map.entry("archv2", ""),
Map.entry("tier", "production")
))
.windowsProfile(Map.ofEntries(
Map.entry("adminPassword", "replacePassword1234$"),
Map.entry("adminUsername", "azureuser")
))
.build());
}
}
```
### Create Managed Cluster with PPG
```java
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.containerservice.ManagedCluster;
import com.pulumi.azurenative.containerservice.ManagedClusterArgs;
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 managedCluster = new ManagedCluster("managedCluster", ManagedClusterArgs.builder()
.addonProfiles()
.agentPoolProfiles(Map.ofEntries(
Map.entry("count", 3),
Map.entry("enableNodePublicIP", true),
Map.entry("mode", "System"),
Map.entry("name", "nodepool1"),
Map.entry("osType", "Linux"),
Map.entry("proximityPlacementGroupID", "/subscriptions/subid1/resourcegroups/rg1/providers//Microsoft.Compute/proximityPlacementGroups/ppg1"),
Map.entry("type", "VirtualMachineScaleSets"),
Map.entry("vmSize", "Standard_DS2_v2")
))
.autoScalerProfile(Map.ofEntries(
Map.entry("scaleDownDelayAfterAdd", "15m"),
Map.entry("scanInterval", "20s")
))
.diskEncryptionSetID("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des")
.dnsPrefix("dnsprefix1")
.enablePodSecurityPolicy(true)
.enableRBAC(true)
.kubernetesVersion("")
.linuxProfile(Map.ofEntries(
Map.entry("adminUsername", "azureuser"),
Map.entry("ssh", Map.of("publicKeys", Map.of("keyData", "keydata")))
))
.location("location1")
.networkProfile(Map.ofEntries(
Map.entry("loadBalancerProfile", Map.of("managedOutboundIPs", Map.of("count", 2))),
Map.entry("loadBalancerSku", "standard"),
Map.entry("outboundType", "loadBalancer")
))
.resourceGroupName("rg1")
.resourceName("clustername1")
.servicePrincipalProfile(Map.ofEntries(
Map.entry("clientId", "clientid"),
Map.entry("secret", "secret")
))
.sku(Map.ofEntries(
Map.entry("name", "Basic"),
Map.entry("tier", "Free")
))
.tags(Map.ofEntries(
Map.entry("archv2", ""),
Map.entry("tier", "production")
))
.windowsProfile(Map.ofEntries(
Map.entry("adminPassword", "replacePassword1234$"),
Map.entry("adminUsername", "azureuser")
))
.build());
}
}
```
### Create Managed Cluster with PodIdentity enabled
```java
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.containerservice.ManagedCluster;
import com.pulumi.azurenative.containerservice.ManagedClusterArgs;
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 managedCluster = new ManagedCluster("managedCluster", ManagedClusterArgs.builder()
.addonProfiles()
.agentPoolProfiles(Map.ofEntries(
Map.entry("count", 3),
Map.entry("enableNodePublicIP", true),
Map.entry("mode", "System"),
Map.entry("name", "nodepool1"),
Map.entry("osType", "Linux"),
Map.entry("type", "VirtualMachineScaleSets"),
Map.entry("vmSize", "Standard_DS2_v2")
))
.autoScalerProfile(Map.ofEntries(
Map.entry("scaleDownDelayAfterAdd", "15m"),
Map.entry("scanInterval", "20s")
))
.diskEncryptionSetID("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des")
.dnsPrefix("dnsprefix1")
.enablePodSecurityPolicy(true)
.enableRBAC(true)
.kubernetesVersion("")
.linuxProfile(Map.ofEntries(
Map.entry("adminUsername", "azureuser"),
Map.entry("ssh", Map.of("publicKeys", Map.of("keyData", "keydata")))
))
.location("location1")
.networkProfile(Map.ofEntries(
Map.entry("loadBalancerProfile", Map.of("managedOutboundIPs", Map.of("count", 2))),
Map.entry("loadBalancerSku", "standard"),
Map.entry("outboundType", "loadBalancer")
))
.podIdentityProfile(Map.ofEntries(
Map.entry("allowNetworkPluginKubenet", true),
Map.entry("enabled", true)
))
.resourceGroupName("rg1")
.resourceName("clustername1")
.servicePrincipalProfile(Map.ofEntries(
Map.entry("clientId", "clientid"),
Map.entry("secret", "secret")
))
.sku(Map.ofEntries(
Map.entry("name", "Basic"),
Map.entry("tier", "Free")
))
.tags(Map.ofEntries(
Map.entry("archv2", ""),
Map.entry("tier", "production")
))
.windowsProfile(Map.ofEntries(
Map.entry("adminPassword", "replacePassword1234$"),
Map.entry("adminUsername", "azureuser")
))
.build());
}
}
```
### Create Managed Private Cluster with fqdn subdomain specified
```java
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.containerservice.ManagedCluster;
import com.pulumi.azurenative.containerservice.ManagedClusterArgs;
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 managedCluster = new ManagedCluster("managedCluster", ManagedClusterArgs.builder()
.addonProfiles()
.agentPoolProfiles(Map.ofEntries(
Map.entry("count", 3),
Map.entry("enableEncryptionAtHost", true),
Map.entry("enableNodePublicIP", true),
Map.entry("mode", "System"),
Map.entry("name", "nodepool1"),
Map.entry("osType", "Linux"),
Map.entry("type", "VirtualMachineScaleSets"),
Map.entry("vmSize", "Standard_DS2_v2")
))
.apiServerAccessProfile(Map.ofEntries(
Map.entry("enablePrivateCluster", true),
Map.entry("privateDNSZone", "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.Network/privateDnsZones/privatelink.location1.azmk8s.io")
))
.autoScalerProfile(Map.ofEntries(
Map.entry("scaleDownDelayAfterAdd", "15m"),
Map.entry("scanInterval", "20s")
))
.enablePodSecurityPolicy(true)
.enableRBAC(true)
.fqdnSubdomain("domain1")
.kubernetesVersion("")
.linuxProfile(Map.ofEntries(
Map.entry("adminUsername", "azureuser"),
Map.entry("ssh", Map.of("publicKeys", Map.of("keyData", "keydata")))
))
.location("location1")
.networkProfile(Map.ofEntries(
Map.entry("loadBalancerProfile", Map.of("managedOutboundIPs", Map.of("count", 2))),
Map.entry("loadBalancerSku", "standard"),
Map.entry("outboundType", "loadBalancer")
))
.resourceGroupName("rg1")
.resourceName("clustername1")
.servicePrincipalProfile(Map.ofEntries(
Map.entry("clientId", "clientid"),
Map.entry("secret", "secret")
))
.sku(Map.ofEntries(
Map.entry("name", "Basic"),
Map.entry("tier", "Free")
))
.tags(Map.ofEntries(
Map.entry("archv2", ""),
Map.entry("tier", "production")
))
.windowsProfile(Map.ofEntries(
Map.entry("adminPassword", "replacePassword1234$"),
Map.entry("adminUsername", "azureuser")
))
.build());
}
}
```
### Create/Update AAD Managed Cluster with EnableAzureRBAC
```java
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.containerservice.ManagedCluster;
import com.pulumi.azurenative.containerservice.ManagedClusterArgs;
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 managedCluster = new ManagedCluster("managedCluster", ManagedClusterArgs.builder()
.aadProfile(Map.ofEntries(
Map.entry("enableAzureRBAC", true),
Map.entry("managed", true)
))
.addonProfiles()
.agentPoolProfiles(Map.ofEntries(
Map.entry("availabilityZones",
"1",
"2",
"3"),
Map.entry("count", 3),
Map.entry("enableNodePublicIP", true),
Map.entry("mode", "System"),
Map.entry("name", "nodepool1"),
Map.entry("osType", "Linux"),
Map.entry("type", "VirtualMachineScaleSets"),
Map.entry("vmSize", "Standard_DS1_v2")
))
.autoScalerProfile(Map.ofEntries(
Map.entry("scaleDownDelayAfterAdd", "15m"),
Map.entry("scanInterval", "20s")
))
.diskEncryptionSetID("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des")
.dnsPrefix("dnsprefix1")
.enablePodSecurityPolicy(true)
.enableRBAC(true)
.kubernetesVersion("")
.linuxProfile(Map.ofEntries(
Map.entry("adminUsername", "azureuser"),
Map.entry("ssh", Map.of("publicKeys", Map.of("keyData", "keydata")))
))
.location("location1")
.networkProfile(Map.ofEntries(
Map.entry("loadBalancerProfile", Map.of("managedOutboundIPs", Map.of("count", 2))),
Map.entry("loadBalancerSku", "standard"),
Map.entry("outboundType", "loadBalancer")
))
.resourceGroupName("rg1")
.resourceName("clustername1")
.servicePrincipalProfile(Map.ofEntries(
Map.entry("clientId", "clientid"),
Map.entry("secret", "secret")
))
.sku(Map.ofEntries(
Map.entry("name", "Basic"),
Map.entry("tier", "Free")
))
.tags(Map.ofEntries(
Map.entry("archv2", ""),
Map.entry("tier", "production")
))
.windowsProfile(Map.ofEntries(
Map.entry("adminPassword", "replacePassword1234$"),
Map.entry("adminUsername", "azureuser")
))
.build());
}
}
```
### Create/Update Managed Cluster
```java
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.containerservice.ManagedCluster;
import com.pulumi.azurenative.containerservice.ManagedClusterArgs;
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 managedCluster = new ManagedCluster("managedCluster", ManagedClusterArgs.builder()
.addonProfiles()
.agentPoolProfiles(Map.ofEntries(
Map.entry("availabilityZones",
"1",
"2",
"3"),
Map.entry("count", 3),
Map.entry("enableNodePublicIP", true),
Map.entry("mode", "System"),
Map.entry("name", "nodepool1"),
Map.entry("osType", "Linux"),
Map.entry("type", "VirtualMachineScaleSets"),
Map.entry("vmSize", "Standard_DS1_v2")
))
.autoScalerProfile(Map.ofEntries(
Map.entry("balanceSimilarNodeGroups", "true"),
Map.entry("expander", "priority"),
Map.entry("maxNodeProvisionTime", "15m"),
Map.entry("newPodScaleUpDelay", "1m"),
Map.entry("scaleDownDelayAfterAdd", "15m"),
Map.entry("scanInterval", "20s"),
Map.entry("skipNodesWithSystemPods", "false")
))
.diskEncryptionSetID("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des")
.dnsPrefix("dnsprefix1")
.enablePodSecurityPolicy(true)
.enableRBAC(true)
.identity(Map.ofEntries(
Map.entry("type", "UserAssigned"),
Map.entry("userAssignedIdentities", Map.of("/subscriptions/subid1/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", ))
))
.kubernetesVersion("")
.linuxProfile(Map.ofEntries(
Map.entry("adminUsername", "azureuser"),
Map.entry("ssh", Map.of("publicKeys", Map.of("keyData", "keydata")))
))
.location("location1")
.networkProfile(Map.ofEntries(
Map.entry("loadBalancerProfile", Map.of("managedOutboundIPs", Map.of("count", 2))),
Map.entry("loadBalancerSku", "standard"),
Map.entry("outboundType", "loadBalancer")
))
.resourceGroupName("rg1")
.resourceName("clustername1")
.servicePrincipalProfile(Map.ofEntries(
Map.entry("clientId", "clientid"),
Map.entry("secret", "secret")
))
.sku(Map.ofEntries(
Map.entry("name", "Basic"),
Map.entry("tier", "Free")
))
.tags(Map.ofEntries(
Map.entry("archv2", ""),
Map.entry("tier", "production")
))
.windowsProfile(Map.ofEntries(
Map.entry("adminPassword", "replacePassword1234$"),
Map.entry("adminUsername", "azureuser")
))
.build());
}
}
```
### Create/Update Managed Cluster with EnableAHUB
```java
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.containerservice.ManagedCluster;
import com.pulumi.azurenative.containerservice.ManagedClusterArgs;
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 managedCluster = new ManagedCluster("managedCluster", ManagedClusterArgs.builder()
.addonProfiles()
.agentPoolProfiles(Map.ofEntries(
Map.entry("availabilityZones",
"1",
"2",
"3"),
Map.entry("count", 3),
Map.entry("enableNodePublicIP", true),
Map.entry("mode", "System"),
Map.entry("name", "nodepool1"),
Map.entry("osType", "Linux"),
Map.entry("type", "VirtualMachineScaleSets"),
Map.entry("vmSize", "Standard_DS1_v2")
))
.autoScalerProfile(Map.ofEntries(
Map.entry("scaleDownDelayAfterAdd", "15m"),
Map.entry("scanInterval", "20s")
))
.diskEncryptionSetID("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des")
.dnsPrefix("dnsprefix1")
.enablePodSecurityPolicy(true)
.enableRBAC(true)
.identity(Map.ofEntries(
Map.entry("type", "UserAssigned"),
Map.entry("userAssignedIdentities", Map.of("/subscriptions/subid1/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", ))
))
.kubernetesVersion("")
.linuxProfile(Map.ofEntries(
Map.entry("adminUsername", "azureuser"),
Map.entry("ssh", Map.of("publicKeys", Map.of("keyData", "keydata")))
))
.location("location1")
.networkProfile(Map.ofEntries(
Map.entry("loadBalancerProfile", Map.of("managedOutboundIPs", Map.of("count", 2))),
Map.entry("loadBalancerSku", "standard"),
Map.entry("outboundType", "loadBalancer")
))
.resourceGroupName("rg1")
.resourceName("clustername1")
.servicePrincipalProfile(Map.ofEntries(
Map.entry("clientId", "clientid"),
Map.entry("secret", "secret")
))
.sku(Map.ofEntries(
Map.entry("name", "Basic"),
Map.entry("tier", "Free")
))
.tags(Map.ofEntries(
Map.entry("archv2", ""),
Map.entry("tier", "production")
))
.windowsProfile(Map.ofEntries(
Map.entry("adminPassword", "replacePassword1234$"),
Map.entry("adminUsername", "azureuser"),
Map.entry("licenseType", "Windows_Server")
))
.build());
}
}
```
## Import
An existing resource can be imported using its type token, name, and identifier, e.g.
```sh
$ pulumi import azure-native:containerservice:ManagedCluster clustername1 /subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1
```