Namespace

class Namespace : KotlinCustomResource

Namespace managed by ARM. Uses Azure REST API version 2025-02-02-preview.

Example Usage

Create/Update Namespace

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var @namespace = new AzureNative.ContainerService.Namespace("namespace", new()
{
NamespaceName = "namespace1",
Properties = new AzureNative.ContainerService.Inputs.NamespacePropertiesArgs
{
AdoptionPolicy = AzureNative.ContainerService.AdoptionPolicy.IfIdentical,
Annotations =
{
{ "annatationKey", "annatationValue" },
},
DefaultNetworkPolicy = new AzureNative.ContainerService.Inputs.NetworkPoliciesArgs
{
Egress = AzureNative.ContainerService.PolicyRule.AllowAll,
Ingress = AzureNative.ContainerService.PolicyRule.AllowSameNamespace,
},
DefaultResourceQuota = new AzureNative.ContainerService.Inputs.ResourceQuotaArgs
{
CpuLimit = "3m",
CpuRequest = "3m",
MemoryLimit = "5Gi",
MemoryRequest = "5Gi",
},
DeletePolicy = AzureNative.ContainerService.DeletePolicy.Keep,
Labels =
{
{ "kubernetes.io/metadata.name", "true" },
},
},
ResourceGroupName = "rg1",
ResourceName = "clustername1",
Tags =
{
{ "tagKey1", "tagValue1" },
},
});
});
package main
import (
containerservice "github.com/pulumi/pulumi-azure-native-sdk/containerservice/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := containerservice.NewNamespace(ctx, "namespace", &containerservice.NamespaceArgs{
NamespaceName: pulumi.String("namespace1"),
Properties: &containerservice.NamespacePropertiesArgs{
AdoptionPolicy: pulumi.String(containerservice.AdoptionPolicyIfIdentical),
Annotations: pulumi.StringMap{
"annatationKey": pulumi.String("annatationValue"),
},
DefaultNetworkPolicy: &containerservice.NetworkPoliciesArgs{
Egress: pulumi.String(containerservice.PolicyRuleAllowAll),
Ingress: pulumi.String(containerservice.PolicyRuleAllowSameNamespace),
},
DefaultResourceQuota: &containerservice.ResourceQuotaArgs{
CpuLimit: pulumi.String("3m"),
CpuRequest: pulumi.String("3m"),
MemoryLimit: pulumi.String("5Gi"),
MemoryRequest: pulumi.String("5Gi"),
},
DeletePolicy: pulumi.String(containerservice.DeletePolicyKeep),
Labels: pulumi.StringMap{
"kubernetes.io/metadata.name": pulumi.String("true"),
},
},
ResourceGroupName: pulumi.String("rg1"),
ResourceName: pulumi.String("clustername1"),
Tags: pulumi.StringMap{
"tagKey1": pulumi.String("tagValue1"),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.containerservice.Namespace;
import com.pulumi.azurenative.containerservice.NamespaceArgs;
import com.pulumi.azurenative.containerservice.inputs.NamespacePropertiesArgs;
import com.pulumi.azurenative.containerservice.inputs.NetworkPoliciesArgs;
import com.pulumi.azurenative.containerservice.inputs.ResourceQuotaArgs;
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 namespace = new Namespace("namespace", NamespaceArgs.builder()
.namespaceName("namespace1")
.properties(NamespacePropertiesArgs.builder()
.adoptionPolicy("IfIdentical")
.annotations(Map.of("annatationKey", "annatationValue"))
.defaultNetworkPolicy(NetworkPoliciesArgs.builder()
.egress("AllowAll")
.ingress("AllowSameNamespace")
.build())
.defaultResourceQuota(ResourceQuotaArgs.builder()
.cpuLimit("3m")
.cpuRequest("3m")
.memoryLimit("5Gi")
.memoryRequest("5Gi")
.build())
.deletePolicy("Keep")
.labels(Map.of("kubernetes.io/metadata.name", "true"))
.build())
.resourceGroupName("rg1")
.resourceName("clustername1")
.tags(Map.of("tagKey1", "tagValue1"))
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:containerservice:Namespace namespace1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/namespaces/{namespaceName}

Properties

Link copied to clipboard
val azureApiVersion: Output<String>

The Azure API version of the resource.

Link copied to clipboard
val eTag: Output<String>

Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is updated. Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable optimistic concurrency per the normal etag convention.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val location: Output<String>?

The location of the namespace.

Link copied to clipboard
val name: Output<String>

The name of the resource that is unique within a resource group. This name can be used to access the resource.

Link copied to clipboard

Properties of a namespace.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The system metadata relating to this resource.

Link copied to clipboard
val tags: Output<Map<String, String>>?

The tags to be persisted on the managed cluster namespace.

Link copied to clipboard
val type: Output<String>

Resource type

Link copied to clipboard
val urn: Output<String>