1. Packages
  2. Azure Classic
  3. API Docs
  4. notificationhub
  5. getHub

We recommend using Azure Native.

Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi

azure.notificationhub.getHub

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi

    Use this data source to access information about an existing Notification Hub within a Notification Hub Namespace.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = azure.notificationhub.getHub({
        name: "notification-hub",
        namespaceName: "namespace-name",
        resourceGroupName: "resource-group-name",
    });
    export const id = example.then(example => example.id);
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.notificationhub.get_hub(name="notification-hub",
        namespace_name="namespace-name",
        resource_group_name="resource-group-name")
    pulumi.export("id", example.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/notificationhub"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := notificationhub.LookupHub(ctx, &notificationhub.LookupHubArgs{
    			Name:              "notification-hub",
    			NamespaceName:     "namespace-name",
    			ResourceGroupName: "resource-group-name",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("id", example.Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Azure.NotificationHub.GetHub.Invoke(new()
        {
            Name = "notification-hub",
            NamespaceName = "namespace-name",
            ResourceGroupName = "resource-group-name",
        });
    
        return new Dictionary<string, object?>
        {
            ["id"] = example.Apply(getHubResult => getHubResult.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.notificationhub.NotificationhubFunctions;
    import com.pulumi.azure.notificationhub.inputs.GetHubArgs;
    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) {
            final var example = NotificationhubFunctions.getHub(GetHubArgs.builder()
                .name("notification-hub")
                .namespaceName("namespace-name")
                .resourceGroupName("resource-group-name")
                .build());
    
            ctx.export("id", example.applyValue(getHubResult -> getHubResult.id()));
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: azure:notificationhub:getHub
          Arguments:
            name: notification-hub
            namespaceName: namespace-name
            resourceGroupName: resource-group-name
    outputs:
      id: ${example.id}
    

    Using getHub

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getHub(args: GetHubArgs, opts?: InvokeOptions): Promise<GetHubResult>
    function getHubOutput(args: GetHubOutputArgs, opts?: InvokeOptions): Output<GetHubResult>
    def get_hub(name: Optional[str] = None,
                namespace_name: Optional[str] = None,
                resource_group_name: Optional[str] = None,
                opts: Optional[InvokeOptions] = None) -> GetHubResult
    def get_hub_output(name: Optional[pulumi.Input[str]] = None,
                namespace_name: Optional[pulumi.Input[str]] = None,
                resource_group_name: Optional[pulumi.Input[str]] = None,
                opts: Optional[InvokeOptions] = None) -> Output[GetHubResult]
    func LookupHub(ctx *Context, args *LookupHubArgs, opts ...InvokeOption) (*LookupHubResult, error)
    func LookupHubOutput(ctx *Context, args *LookupHubOutputArgs, opts ...InvokeOption) LookupHubResultOutput

    > Note: This function is named LookupHub in the Go SDK.

    public static class GetHub 
    {
        public static Task<GetHubResult> InvokeAsync(GetHubArgs args, InvokeOptions? opts = null)
        public static Output<GetHubResult> Invoke(GetHubInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetHubResult> getHub(GetHubArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: azure:notificationhub/getHub:getHub
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    Specifies the Name of the Notification Hub.
    NamespaceName string
    Specifies the Name of the Notification Hub Namespace which contains the Notification Hub.
    ResourceGroupName string
    Specifies the Name of the Resource Group within which the Notification Hub exists.
    Name string
    Specifies the Name of the Notification Hub.
    NamespaceName string
    Specifies the Name of the Notification Hub Namespace which contains the Notification Hub.
    ResourceGroupName string
    Specifies the Name of the Resource Group within which the Notification Hub exists.
    name String
    Specifies the Name of the Notification Hub.
    namespaceName String
    Specifies the Name of the Notification Hub Namespace which contains the Notification Hub.
    resourceGroupName String
    Specifies the Name of the Resource Group within which the Notification Hub exists.
    name string
    Specifies the Name of the Notification Hub.
    namespaceName string
    Specifies the Name of the Notification Hub Namespace which contains the Notification Hub.
    resourceGroupName string
    Specifies the Name of the Resource Group within which the Notification Hub exists.
    name str
    Specifies the Name of the Notification Hub.
    namespace_name str
    Specifies the Name of the Notification Hub Namespace which contains the Notification Hub.
    resource_group_name str
    Specifies the Name of the Resource Group within which the Notification Hub exists.
    name String
    Specifies the Name of the Notification Hub.
    namespaceName String
    Specifies the Name of the Notification Hub Namespace which contains the Notification Hub.
    resourceGroupName String
    Specifies the Name of the Resource Group within which the Notification Hub exists.

    getHub Result

    The following output properties are available:

    ApnsCredentials List<GetHubApnsCredential>
    A apns_credential block as defined below.
    GcmCredentials List<GetHubGcmCredential>
    A gcm_credential block as defined below.
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    The Azure Region in which this Notification Hub exists.
    Name string
    NamespaceName string
    ResourceGroupName string
    Tags Dictionary<string, string>
    A mapping of tags to assign to the resource.
    ApnsCredentials []GetHubApnsCredential
    A apns_credential block as defined below.
    GcmCredentials []GetHubGcmCredential
    A gcm_credential block as defined below.
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    The Azure Region in which this Notification Hub exists.
    Name string
    NamespaceName string
    ResourceGroupName string
    Tags map[string]string
    A mapping of tags to assign to the resource.
    apnsCredentials List<GetHubApnsCredential>
    A apns_credential block as defined below.
    gcmCredentials List<GetHubGcmCredential>
    A gcm_credential block as defined below.
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    The Azure Region in which this Notification Hub exists.
    name String
    namespaceName String
    resourceGroupName String
    tags Map<String,String>
    A mapping of tags to assign to the resource.
    apnsCredentials GetHubApnsCredential[]
    A apns_credential block as defined below.
    gcmCredentials GetHubGcmCredential[]
    A gcm_credential block as defined below.
    id string
    The provider-assigned unique ID for this managed resource.
    location string
    The Azure Region in which this Notification Hub exists.
    name string
    namespaceName string
    resourceGroupName string
    tags {[key: string]: string}
    A mapping of tags to assign to the resource.
    apns_credentials Sequence[GetHubApnsCredential]
    A apns_credential block as defined below.
    gcm_credentials Sequence[GetHubGcmCredential]
    A gcm_credential block as defined below.
    id str
    The provider-assigned unique ID for this managed resource.
    location str
    The Azure Region in which this Notification Hub exists.
    name str
    namespace_name str
    resource_group_name str
    tags Mapping[str, str]
    A mapping of tags to assign to the resource.
    apnsCredentials List<Property Map>
    A apns_credential block as defined below.
    gcmCredentials List<Property Map>
    A gcm_credential block as defined below.
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    The Azure Region in which this Notification Hub exists.
    name String
    namespaceName String
    resourceGroupName String
    tags Map<String>
    A mapping of tags to assign to the resource.

    Supporting Types

    GetHubApnsCredential

    ApplicationMode string
    The Application Mode which defines which server the APNS Messages should be sent to. Possible values are Production and Sandbox.
    BundleId string
    The Bundle ID of the iOS/macOS application to send push notifications for, such as com.org.example.
    KeyId string
    The Apple Push Notifications Service (APNS) Key.
    TeamId string
    The ID of the team the Token.
    Token string
    The Push Token associated with the Apple Developer Account.
    ApplicationMode string
    The Application Mode which defines which server the APNS Messages should be sent to. Possible values are Production and Sandbox.
    BundleId string
    The Bundle ID of the iOS/macOS application to send push notifications for, such as com.org.example.
    KeyId string
    The Apple Push Notifications Service (APNS) Key.
    TeamId string
    The ID of the team the Token.
    Token string
    The Push Token associated with the Apple Developer Account.
    applicationMode String
    The Application Mode which defines which server the APNS Messages should be sent to. Possible values are Production and Sandbox.
    bundleId String
    The Bundle ID of the iOS/macOS application to send push notifications for, such as com.org.example.
    keyId String
    The Apple Push Notifications Service (APNS) Key.
    teamId String
    The ID of the team the Token.
    token String
    The Push Token associated with the Apple Developer Account.
    applicationMode string
    The Application Mode which defines which server the APNS Messages should be sent to. Possible values are Production and Sandbox.
    bundleId string
    The Bundle ID of the iOS/macOS application to send push notifications for, such as com.org.example.
    keyId string
    The Apple Push Notifications Service (APNS) Key.
    teamId string
    The ID of the team the Token.
    token string
    The Push Token associated with the Apple Developer Account.
    application_mode str
    The Application Mode which defines which server the APNS Messages should be sent to. Possible values are Production and Sandbox.
    bundle_id str
    The Bundle ID of the iOS/macOS application to send push notifications for, such as com.org.example.
    key_id str
    The Apple Push Notifications Service (APNS) Key.
    team_id str
    The ID of the team the Token.
    token str
    The Push Token associated with the Apple Developer Account.
    applicationMode String
    The Application Mode which defines which server the APNS Messages should be sent to. Possible values are Production and Sandbox.
    bundleId String
    The Bundle ID of the iOS/macOS application to send push notifications for, such as com.org.example.
    keyId String
    The Apple Push Notifications Service (APNS) Key.
    teamId String
    The ID of the team the Token.
    token String
    The Push Token associated with the Apple Developer Account.

    GetHubGcmCredential

    ApiKey string
    The API Key associated with the Google Cloud Messaging service.
    ApiKey string
    The API Key associated with the Google Cloud Messaging service.
    apiKey String
    The API Key associated with the Google Cloud Messaging service.
    apiKey string
    The API Key associated with the Google Cloud Messaging service.
    api_key str
    The API Key associated with the Google Cloud Messaging service.
    apiKey String
    The API Key associated with the Google Cloud Messaging service.

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi