1. Packages
  2. Azure Classic
  3. API Docs
  4. eventgrid
  5. getTopic

We recommend using Azure Native.

Azure Classic v5.70.0 published on Wednesday, Mar 27, 2024 by Pulumi

azure.eventgrid.getTopic

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.70.0 published on Wednesday, Mar 27, 2024 by Pulumi

    Use this data source to access information about an existing EventGrid Topic

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = azure.eventgrid.getTopic({
        name: "my-eventgrid-topic",
        resourceGroupName: "example-resources",
    });
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.eventgrid.get_topic(name="my-eventgrid-topic",
        resource_group_name="example-resources")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventgrid"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := eventgrid.LookupTopic(ctx, &eventgrid.LookupTopicArgs{
    			Name:              "my-eventgrid-topic",
    			ResourceGroupName: "example-resources",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Azure.EventGrid.GetTopic.Invoke(new()
        {
            Name = "my-eventgrid-topic",
            ResourceGroupName = "example-resources",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.eventgrid.EventgridFunctions;
    import com.pulumi.azure.eventgrid.inputs.GetTopicArgs;
    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 = EventgridFunctions.getTopic(GetTopicArgs.builder()
                .name("my-eventgrid-topic")
                .resourceGroupName("example-resources")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: azure:eventgrid:getTopic
          Arguments:
            name: my-eventgrid-topic
            resourceGroupName: example-resources
    

    Using getTopic

    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 getTopic(args: GetTopicArgs, opts?: InvokeOptions): Promise<GetTopicResult>
    function getTopicOutput(args: GetTopicOutputArgs, opts?: InvokeOptions): Output<GetTopicResult>
    def get_topic(name: Optional[str] = None,
                  resource_group_name: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetTopicResult
    def get_topic_output(name: Optional[pulumi.Input[str]] = None,
                  resource_group_name: Optional[pulumi.Input[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetTopicResult]
    func LookupTopic(ctx *Context, args *LookupTopicArgs, opts ...InvokeOption) (*LookupTopicResult, error)
    func LookupTopicOutput(ctx *Context, args *LookupTopicOutputArgs, opts ...InvokeOption) LookupTopicResultOutput

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

    public static class GetTopic 
    {
        public static Task<GetTopicResult> InvokeAsync(GetTopicArgs args, InvokeOptions? opts = null)
        public static Output<GetTopicResult> Invoke(GetTopicInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetTopicResult> getTopic(GetTopicArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: azure:eventgrid/getTopic:getTopic
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The name of the EventGrid Topic resource.
    ResourceGroupName string
    The name of the resource group in which the EventGrid Topic exists.
    Name string
    The name of the EventGrid Topic resource.
    ResourceGroupName string
    The name of the resource group in which the EventGrid Topic exists.
    name String
    The name of the EventGrid Topic resource.
    resourceGroupName String
    The name of the resource group in which the EventGrid Topic exists.
    name string
    The name of the EventGrid Topic resource.
    resourceGroupName string
    The name of the resource group in which the EventGrid Topic exists.
    name str
    The name of the EventGrid Topic resource.
    resource_group_name str
    The name of the resource group in which the EventGrid Topic exists.
    name String
    The name of the EventGrid Topic resource.
    resourceGroupName String
    The name of the resource group in which the EventGrid Topic exists.

    getTopic Result

    The following output properties are available:

    Endpoint string
    The Endpoint associated with the EventGrid Topic.
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    Name string
    PrimaryAccessKey string
    The Primary Shared Access Key associated with the EventGrid Topic.
    ResourceGroupName string
    SecondaryAccessKey string
    The Secondary Shared Access Key associated with the EventGrid Topic.
    Tags Dictionary<string, string>
    Endpoint string
    The Endpoint associated with the EventGrid Topic.
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    Name string
    PrimaryAccessKey string
    The Primary Shared Access Key associated with the EventGrid Topic.
    ResourceGroupName string
    SecondaryAccessKey string
    The Secondary Shared Access Key associated with the EventGrid Topic.
    Tags map[string]string
    endpoint String
    The Endpoint associated with the EventGrid Topic.
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    name String
    primaryAccessKey String
    The Primary Shared Access Key associated with the EventGrid Topic.
    resourceGroupName String
    secondaryAccessKey String
    The Secondary Shared Access Key associated with the EventGrid Topic.
    tags Map<String,String>
    endpoint string
    The Endpoint associated with the EventGrid Topic.
    id string
    The provider-assigned unique ID for this managed resource.
    location string
    name string
    primaryAccessKey string
    The Primary Shared Access Key associated with the EventGrid Topic.
    resourceGroupName string
    secondaryAccessKey string
    The Secondary Shared Access Key associated with the EventGrid Topic.
    tags {[key: string]: string}
    endpoint str
    The Endpoint associated with the EventGrid Topic.
    id str
    The provider-assigned unique ID for this managed resource.
    location str
    name str
    primary_access_key str
    The Primary Shared Access Key associated with the EventGrid Topic.
    resource_group_name str
    secondary_access_key str
    The Secondary Shared Access Key associated with the EventGrid Topic.
    tags Mapping[str, str]
    endpoint String
    The Endpoint associated with the EventGrid Topic.
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    name String
    primaryAccessKey String
    The Primary Shared Access Key associated with the EventGrid Topic.
    resourceGroupName String
    secondaryAccessKey String
    The Secondary Shared Access Key associated with the EventGrid Topic.
    tags Map<String>

    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.70.0 published on Wednesday, Mar 27, 2024 by Pulumi