Namespace
Notification Hubs Namespace Resource. Uses Azure REST API version 2023-01-01-preview. In version 1.x of the Azure Native provider, it used API version 2017-04-01. Other available API versions: 2017-04-01, 2023-09-01, 2023-10-01-preview.
Example Usage
Namespaces_CreateOrUpdate
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var @namespace = new AzureNative.NotificationHubs.Namespace("namespace", new()
{
Location = "South Central US",
NamespaceName = "nh-sdk-ns",
Properties = new AzureNative.NotificationHubs.Inputs.NamespacePropertiesArgs
{
NetworkAcls = new AzureNative.NotificationHubs.Inputs.NetworkAclsArgs
{
IpRules = new[]
{
new AzureNative.NotificationHubs.Inputs.IpRuleArgs
{
IpMask = "185.48.100.00/24",
Rights = new[]
{
AzureNative.NotificationHubs.AccessRights.Manage,
AzureNative.NotificationHubs.AccessRights.Send,
AzureNative.NotificationHubs.AccessRights.Listen,
},
},
},
PublicNetworkRule = new AzureNative.NotificationHubs.Inputs.PublicInternetAuthorizationRuleArgs
{
Rights = new[]
{
AzureNative.NotificationHubs.AccessRights.Listen,
},
},
},
ZoneRedundancy = AzureNative.NotificationHubs.ZoneRedundancyPreference.Enabled,
},
ResourceGroupName = "5ktrial",
Sku = new AzureNative.NotificationHubs.Inputs.SkuArgs
{
Name = AzureNative.NotificationHubs.SkuName.Standard,
Tier = "Standard",
},
Tags =
{
{ "tag1", "value1" },
{ "tag2", "value2" },
},
});
});
Content copied to clipboard
package main
import (
notificationhubs "github.com/pulumi/pulumi-azure-native-sdk/notificationhubs/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := notificationhubs.NewNamespace(ctx, "namespace", ¬ificationhubs.NamespaceArgs{
Location: pulumi.String("South Central US"),
NamespaceName: pulumi.String("nh-sdk-ns"),
Properties: ¬ificationhubs.NamespacePropertiesArgs{
NetworkAcls: ¬ificationhubs.NetworkAclsArgs{
IpRules: notificationhubs.IpRuleArray{
¬ificationhubs.IpRuleArgs{
IpMask: pulumi.String("185.48.100.00/24"),
Rights: pulumi.StringArray{
pulumi.String(notificationhubs.AccessRightsManage),
pulumi.String(notificationhubs.AccessRightsSend),
pulumi.String(notificationhubs.AccessRightsListen),
},
},
},
PublicNetworkRule: ¬ificationhubs.PublicInternetAuthorizationRuleArgs{
Rights: pulumi.StringArray{
pulumi.String(notificationhubs.AccessRightsListen),
},
},
},
ZoneRedundancy: pulumi.String(notificationhubs.ZoneRedundancyPreferenceEnabled),
},
ResourceGroupName: pulumi.String("5ktrial"),
Sku: ¬ificationhubs.SkuArgs{
Name: pulumi.String(notificationhubs.SkuNameStandard),
Tier: pulumi.String("Standard"),
},
Tags: pulumi.StringMap{
"tag1": pulumi.String("value1"),
"tag2": pulumi.String("value2"),
},
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.notificationhubs.Namespace;
import com.pulumi.azurenative.notificationhubs.NamespaceArgs;
import com.pulumi.azurenative.notificationhubs.inputs.NamespacePropertiesArgs;
import com.pulumi.azurenative.notificationhubs.inputs.NetworkAclsArgs;
import com.pulumi.azurenative.notificationhubs.inputs.PublicInternetAuthorizationRuleArgs;
import com.pulumi.azurenative.notificationhubs.inputs.SkuArgs;
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()
.location("South Central US")
.namespaceName("nh-sdk-ns")
.properties(NamespacePropertiesArgs.builder()
.networkAcls(NetworkAclsArgs.builder()
.ipRules(IpRuleArgs.builder()
.ipMask("185.48.100.00/24")
.rights(
"Manage",
"Send",
"Listen")
.build())
.publicNetworkRule(PublicInternetAuthorizationRuleArgs.builder()
.rights("Listen")
.build())
.build())
.zoneRedundancy("Enabled")
.build())
.resourceGroupName("5ktrial")
.sku(SkuArgs.builder()
.name("Standard")
.tier("Standard")
.build())
.tags(Map.ofEntries(
Map.entry("tag1", "value1"),
Map.entry("tag2", "value2")
))
.build());
}
}
Content copied to clipboard
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:notificationhubs:Namespace nh-sdk-ns /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}
Content copied to clipboard