EndpointEventhub

Manages an IotHub EventHub Endpoint

NOTE: Endpoints can be defined either directly on the azure.iot.IoTHub resource, or using the azurerm_iothub_endpoint_* resources - but the two ways of defining the endpoints cannot be used together. If both are used against the same IoTHub, spurious changes will occur. Also, defining a azurerm_iothub_endpoint_* resource and another endpoint of a different type directly on the azure.iot.IoTHub resource is not supported.

Example Usage

using Pulumi;
using Azure = Pulumi.Azure;

class MyStack : Stack
{
    public MyStack()
    {
        var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new Azure.Core.ResourceGroupArgs
        {
            Location = "East US",
        });
        var exampleEventHubNamespace = new Azure.EventHub.EventHubNamespace("exampleEventHubNamespace", new Azure.EventHub.EventHubNamespaceArgs
        {
            Location = exampleResourceGroup.Location,
            ResourceGroupName = exampleResourceGroup.Name,
            Sku = "Basic",
        });
        var exampleEventHub = new Azure.EventHub.EventHub("exampleEventHub", new Azure.EventHub.EventHubArgs
        {
            NamespaceName = exampleEventHubNamespace.Name,
            ResourceGroupName = exampleResourceGroup.Name,
            PartitionCount = 2,
            MessageRetention = 1,
        });
        var exampleAuthorizationRule = new Azure.EventHub.AuthorizationRule("exampleAuthorizationRule", new Azure.EventHub.AuthorizationRuleArgs
        {
            NamespaceName = exampleEventHubNamespace.Name,
            EventhubName = exampleEventHub.Name,
            ResourceGroupName = exampleResourceGroup.Name,
            Listen = false,
            Send = true,
            Manage = false,
        });
        var exampleIoTHub = new Azure.Iot.IoTHub("exampleIoTHub", new Azure.Iot.IoTHubArgs
        {
            ResourceGroupName = exampleResourceGroup.Name,
            Location = exampleResourceGroup.Location,
            Sku = new Azure.Iot.Inputs.IoTHubSkuArgs
            {
                Name = "B1",
                Tier = "Basic",
                Capacity = 1,
            },
            Tags = 
            {
                { "purpose", "example" },
            },
        });
        var exampleEndpointEventhub = new Azure.Iot.EndpointEventhub("exampleEndpointEventhub", new Azure.Iot.EndpointEventhubArgs
        {
            ResourceGroupName = exampleResourceGroup.Name,
            IothubName = exampleIoTHub.Name,
            ConnectionString = exampleAuthorizationRule.PrimaryConnectionString,
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/core"
    "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/eventhub"
    "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/iot"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
            Location: pulumi.String("East US"),
        })
        if err != nil {
            return err
        }
        exampleEventHubNamespace, err := eventhub.NewEventHubNamespace(ctx, "exampleEventHubNamespace", &eventhub.EventHubNamespaceArgs{
            Location:          exampleResourceGroup.Location,
            ResourceGroupName: exampleResourceGroup.Name,
            Sku:               pulumi.String("Basic"),
        })
        if err != nil {
            return err
        }
        exampleEventHub, err := eventhub.NewEventHub(ctx, "exampleEventHub", &eventhub.EventHubArgs{
            NamespaceName:     exampleEventHubNamespace.Name,
            ResourceGroupName: exampleResourceGroup.Name,
            PartitionCount:    pulumi.Int(2),
            MessageRetention:  pulumi.Int(1),
        })
        if err != nil {
            return err
        }
        exampleAuthorizationRule, err := eventhub.NewAuthorizationRule(ctx, "exampleAuthorizationRule", &eventhub.AuthorizationRuleArgs{
            NamespaceName:     exampleEventHubNamespace.Name,
            EventhubName:      exampleEventHub.Name,
            ResourceGroupName: exampleResourceGroup.Name,
            Listen:            pulumi.Bool(false),
            Send:              pulumi.Bool(true),
            Manage:            pulumi.Bool(false),
        })
        if err != nil {
            return err
        }
        exampleIoTHub, err := iot.NewIoTHub(ctx, "exampleIoTHub", &iot.IoTHubArgs{
            ResourceGroupName: exampleResourceGroup.Name,
            Location:          exampleResourceGroup.Location,
            Sku: &iot.IoTHubSkuArgs{
                Name:     pulumi.String("B1"),
                Tier:     pulumi.String("Basic"),
                Capacity: pulumi.Int(1),
            },
            Tags: pulumi.Map{
                "purpose": pulumi.String("example"),
            },
        })
        if err != nil {
            return err
        }
        _, err = iot.NewEndpointEventhub(ctx, "exampleEndpointEventhub", &iot.EndpointEventhubArgs{
            ResourceGroupName: exampleResourceGroup.Name,
            IothubName:        exampleIoTHub.Name,
            ConnectionString:  exampleAuthorizationRule.PrimaryConnectionString,
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_azure as azure

example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="East US")
example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace",
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name,
    sku="Basic")
example_event_hub = azure.eventhub.EventHub("exampleEventHub",
    namespace_name=example_event_hub_namespace.name,
    resource_group_name=example_resource_group.name,
    partition_count=2,
    message_retention=1)
example_authorization_rule = azure.eventhub.AuthorizationRule("exampleAuthorizationRule",
    namespace_name=example_event_hub_namespace.name,
    eventhub_name=example_event_hub.name,
    resource_group_name=example_resource_group.name,
    listen=False,
    send=True,
    manage=False)
example_io_t_hub = azure.iot.IoTHub("exampleIoTHub",
    resource_group_name=example_resource_group.name,
    location=example_resource_group.location,
    sku={
        "name": "B1",
        "tier": "Basic",
        "capacity": "1",
    },
    tags={
        "purpose": "example",
    })
example_endpoint_eventhub = azure.iot.EndpointEventhub("exampleEndpointEventhub",
    resource_group_name=example_resource_group.name,
    iothub_name=example_io_t_hub.name,
    connection_string=example_authorization_rule.primary_connection_string)
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "East US"});
const exampleEventHubNamespace = new azure.eventhub.EventHubNamespace("exampleEventHubNamespace", {
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
    sku: "Basic",
});
const exampleEventHub = new azure.eventhub.EventHub("exampleEventHub", {
    namespaceName: exampleEventHubNamespace.name,
    resourceGroupName: exampleResourceGroup.name,
    partitionCount: 2,
    messageRetention: 1,
});
const exampleAuthorizationRule = new azure.eventhub.AuthorizationRule("exampleAuthorizationRule", {
    namespaceName: exampleEventHubNamespace.name,
    eventhubName: exampleEventHub.name,
    resourceGroupName: exampleResourceGroup.name,
    listen: false,
    send: true,
    manage: false,
});
const exampleIoTHub = new azure.iot.IoTHub("exampleIoTHub", {
    resourceGroupName: exampleResourceGroup.name,
    location: exampleResourceGroup.location,
    sku: {
        name: "B1",
        tier: "Basic",
        capacity: "1",
    },
    tags: {
        purpose: "example",
    },
});
const exampleEndpointEventhub = new azure.iot.EndpointEventhub("exampleEndpointEventhub", {
    resourceGroupName: exampleResourceGroup.name,
    iothubName: exampleIoTHub.name,
    connectionString: exampleAuthorizationRule.primaryConnectionString,
});

Create a EndpointEventhub Resource

def EndpointEventhub(resource_name, opts=None, connection_string=None, iothub_name=None, name=None, resource_group_name=None, __props__=None);
name string
The unique name of the resource.
args EndpointEventhubArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args EndpointEventhubArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args EndpointEventhubArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

EndpointEventhub Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The EndpointEventhub resource accepts the following input properties:

ConnectionString string

The connection string for the endpoint.

IothubName string
ResourceGroupName string
Name string

The name of the endpoint. The name must be unique across endpoint types. The following names are reserved: events, operationsMonitoringEvents, fileNotifications and $default.

ConnectionString string

The connection string for the endpoint.

IothubName string
ResourceGroupName string
Name string

The name of the endpoint. The name must be unique across endpoint types. The following names are reserved: events, operationsMonitoringEvents, fileNotifications and $default.

connectionString string

The connection string for the endpoint.

iothubName string
resourceGroupName string
name string

The name of the endpoint. The name must be unique across endpoint types. The following names are reserved: events, operationsMonitoringEvents, fileNotifications and $default.

connection_string str

The connection string for the endpoint.

iothub_name str
resource_group_name str
name str

The name of the endpoint. The name must be unique across endpoint types. The following names are reserved: events, operationsMonitoringEvents, fileNotifications and $default.

Outputs

All input properties are implicitly available as output properties. Additionally, the EndpointEventhub resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing EndpointEventhub Resource

Get an existing EndpointEventhub resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: EndpointEventhubState, opts?: CustomResourceOptions): EndpointEventhub
static get(resource_name, id, opts=None, connection_string=None, iothub_name=None, name=None, resource_group_name=None, __props__=None);
func GetEndpointEventhub(ctx *Context, name string, id IDInput, state *EndpointEventhubState, opts ...ResourceOption) (*EndpointEventhub, error)
public static EndpointEventhub Get(string name, Input<string> id, EndpointEventhubState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

ConnectionString string

The connection string for the endpoint.

IothubName string
Name string

The name of the endpoint. The name must be unique across endpoint types. The following names are reserved: events, operationsMonitoringEvents, fileNotifications and $default.

ResourceGroupName string
ConnectionString string

The connection string for the endpoint.

IothubName string
Name string

The name of the endpoint. The name must be unique across endpoint types. The following names are reserved: events, operationsMonitoringEvents, fileNotifications and $default.

ResourceGroupName string
connectionString string

The connection string for the endpoint.

iothubName string
name string

The name of the endpoint. The name must be unique across endpoint types. The following names are reserved: events, operationsMonitoringEvents, fileNotifications and $default.

resourceGroupName string
connection_string str

The connection string for the endpoint.

iothub_name str
name str

The name of the endpoint. The name must be unique across endpoint types. The following names are reserved: events, operationsMonitoringEvents, fileNotifications and $default.

resource_group_name str

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.