StreamInputIotHub

Manages a Stream Analytics Stream Input IoTHub.

Example Usage

using Pulumi;
using Azure = Pulumi.Azure;

class MyStack : Stack
{
    public MyStack()
    {
        var exampleResourceGroup = Output.Create(Azure.Core.GetResourceGroup.InvokeAsync(new Azure.Core.GetResourceGroupArgs
        {
            Name = "example-resources",
        }));
        var exampleJob = Output.Create(Azure.StreamAnalytics.GetJob.InvokeAsync(new Azure.StreamAnalytics.GetJobArgs
        {
            Name = "example-job",
            ResourceGroupName = azurerm_resource_group.Example.Name,
        }));
        var exampleIoTHub = new Azure.Iot.IoTHub("exampleIoTHub", new Azure.Iot.IoTHubArgs
        {
            ResourceGroupName = azurerm_resource_group.Example.Name,
            Location = azurerm_resource_group.Example.Location,
            Sku = new Azure.Iot.Inputs.IoTHubSkuArgs
            {
                Name = "S1",
                Capacity = 1,
            },
        });
        var exampleStreamInputIotHub = new Azure.StreamAnalytics.StreamInputIotHub("exampleStreamInputIotHub", new Azure.StreamAnalytics.StreamInputIotHubArgs
        {
            StreamAnalyticsJobName = exampleJob.Apply(exampleJob => exampleJob.Name),
            ResourceGroupName = exampleJob.Apply(exampleJob => exampleJob.ResourceGroupName),
            Endpoint = "messages/events",
            EventhubConsumerGroupName = "$Default",
            IothubNamespace = exampleIoTHub.Name,
            SharedAccessPolicyKey = exampleIoTHub.SharedAccessPolicies.Apply(sharedAccessPolicies => sharedAccessPolicies[0].PrimaryKey),
            SharedAccessPolicyName = "iothubowner",
            Serialization = new Azure.StreamAnalytics.Inputs.StreamInputIotHubSerializationArgs
            {
                Type = "Json",
                Encoding = "UTF8",
            },
        });
    }

}
package main

import (
    "fmt"

    "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/core"
    "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/iot"
    "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/streamanalytics"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := core.LookupResourceGroup(ctx, &core.LookupResourceGroupArgs{
            Name: "example-resources",
        }, nil)
        if err != nil {
            return err
        }
        exampleJob, err := streamanalytics.LookupJob(ctx, &streamanalytics.LookupJobArgs{
            Name:              "example-job",
            ResourceGroupName: azurerm_resource_group.Example.Name,
        }, nil)
        if err != nil {
            return err
        }
        exampleIoTHub, err := iot.NewIoTHub(ctx, "exampleIoTHub", &iot.IoTHubArgs{
            ResourceGroupName: pulumi.String(azurerm_resource_group.Example.Name),
            Location:          pulumi.String(azurerm_resource_group.Example.Location),
            Sku: &iot.IoTHubSkuArgs{
                Name:     pulumi.String("S1"),
                Capacity: pulumi.Int(1),
            },
        })
        if err != nil {
            return err
        }
        _, err = streamanalytics.NewStreamInputIotHub(ctx, "exampleStreamInputIotHub", &streamanalytics.StreamInputIotHubArgs{
            StreamAnalyticsJobName:    pulumi.String(exampleJob.Name),
            ResourceGroupName:         pulumi.String(exampleJob.ResourceGroupName),
            Endpoint:                  pulumi.String("messages/events"),
            EventhubConsumerGroupName: pulumi.String(fmt.Sprintf("%v%v", "$", "Default")),
            IothubNamespace:           exampleIoTHub.Name,
            SharedAccessPolicyKey: pulumi.String(exampleIoTHub.SharedAccessPolicies.ApplyT(func(sharedAccessPolicies []iot.IoTHubSharedAccessPolicy) (string, error) {
                return sharedAccessPolicies[0].PrimaryKey, nil
            }).(pulumi.StringOutput)),
            SharedAccessPolicyName: pulumi.String("iothubowner"),
            Serialization: &streamanalytics.StreamInputIotHubSerializationArgs{
                Type:     pulumi.String("Json"),
                Encoding: pulumi.String("UTF8"),
            },
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_azure as azure

example_resource_group = azure.core.get_resource_group(name="example-resources")
example_job = azure.streamanalytics.get_job(name="example-job",
    resource_group_name=azurerm_resource_group["example"]["name"])
example_io_t_hub = azure.iot.IoTHub("exampleIoTHub",
    resource_group_name=azurerm_resource_group["example"]["name"],
    location=azurerm_resource_group["example"]["location"],
    sku={
        "name": "S1",
        "capacity": "1",
    })
example_stream_input_iot_hub = azure.streamanalytics.StreamInputIotHub("exampleStreamInputIotHub",
    stream_analytics_job_name=example_job.name,
    resource_group_name=example_job.resource_group_name,
    endpoint="messages/events",
    eventhub_consumer_group_name="$Default",
    iothub_namespace=example_io_t_hub.name,
    shared_access_policy_key=example_io_t_hub.shared_access_policies[0]["primary_key"],
    shared_access_policy_name="iothubowner",
    serialization={
        "type": "Json",
        "encoding": "UTF8",
    })
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleResourceGroup = azure.core.getResourceGroup({
    name: "example-resources",
});
const exampleJob = azure.streamanalytics.getJob({
    name: "example-job",
    resourceGroupName: azurerm_resource_group.example.name,
});
const exampleIoTHub = new azure.iot.IoTHub("exampleIoTHub", {
    resourceGroupName: azurerm_resource_group.example.name,
    location: azurerm_resource_group.example.location,
    sku: {
        name: "S1",
        capacity: "1",
    },
});
const exampleStreamInputIotHub = new azure.streamanalytics.StreamInputIotHub("exampleStreamInputIotHub", {
    streamAnalyticsJobName: exampleJob.then(exampleJob => exampleJob.name),
    resourceGroupName: exampleJob.then(exampleJob => exampleJob.resourceGroupName),
    endpoint: "messages/events",
    eventhubConsumerGroupName: `$Default`,
    iothubNamespace: exampleIoTHub.name,
    sharedAccessPolicyKey: exampleIoTHub.sharedAccessPolicies.apply(sharedAccessPolicies => sharedAccessPolicies[0].primaryKey),
    sharedAccessPolicyName: "iothubowner",
    serialization: {
        type: "Json",
        encoding: "UTF8",
    },
});

Create a StreamInputIotHub Resource

def StreamInputIotHub(resource_name, opts=None, endpoint=None, eventhub_consumer_group_name=None, iothub_namespace=None, name=None, resource_group_name=None, serialization=None, shared_access_policy_key=None, shared_access_policy_name=None, stream_analytics_job_name=None, __props__=None);
name string
The unique name of the resource.
args StreamInputIotHubArgs
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 StreamInputIotHubArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args StreamInputIotHubArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

StreamInputIotHub Resource Properties

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

Inputs

The StreamInputIotHub resource accepts the following input properties:

Endpoint string

The IoT Hub endpoint to connect to (ie. messages/events, messages/operationsMonitoringEvents, etc.).

EventhubConsumerGroupName string

The name of an Event Hub Consumer Group that should be used to read events from the Event Hub. Specifying distinct consumer group names for multiple inputs allows each of those inputs to receive the same events from the Event Hub.

IothubNamespace string

The name or the URI of the IoT Hub.

ResourceGroupName string

The name of the Resource Group where the Stream Analytics Job exists. Changing this forces a new resource to be created.

Serialization StreamInputIotHubSerializationArgs

A serialization block as defined below.

SharedAccessPolicyKey string

The shared access policy key for the specified shared access policy.

SharedAccessPolicyName string

The shared access policy name for the Event Hub, Service Bus Queue, Service Bus Topic, etc.

StreamAnalyticsJobName string

The name of the Stream Analytics Job. Changing this forces a new resource to be created.

Name string

The name of the Stream Input IoTHub. Changing this forces a new resource to be created.

Endpoint string

The IoT Hub endpoint to connect to (ie. messages/events, messages/operationsMonitoringEvents, etc.).

EventhubConsumerGroupName string

The name of an Event Hub Consumer Group that should be used to read events from the Event Hub. Specifying distinct consumer group names for multiple inputs allows each of those inputs to receive the same events from the Event Hub.

IothubNamespace string

The name or the URI of the IoT Hub.

ResourceGroupName string

The name of the Resource Group where the Stream Analytics Job exists. Changing this forces a new resource to be created.

Serialization StreamInputIotHubSerialization

A serialization block as defined below.

SharedAccessPolicyKey string

The shared access policy key for the specified shared access policy.

SharedAccessPolicyName string

The shared access policy name for the Event Hub, Service Bus Queue, Service Bus Topic, etc.

StreamAnalyticsJobName string

The name of the Stream Analytics Job. Changing this forces a new resource to be created.

Name string

The name of the Stream Input IoTHub. Changing this forces a new resource to be created.

endpoint string

The IoT Hub endpoint to connect to (ie. messages/events, messages/operationsMonitoringEvents, etc.).

eventhubConsumerGroupName string

The name of an Event Hub Consumer Group that should be used to read events from the Event Hub. Specifying distinct consumer group names for multiple inputs allows each of those inputs to receive the same events from the Event Hub.

iothubNamespace string

The name or the URI of the IoT Hub.

resourceGroupName string

The name of the Resource Group where the Stream Analytics Job exists. Changing this forces a new resource to be created.

serialization StreamInputIotHubSerialization

A serialization block as defined below.

sharedAccessPolicyKey string

The shared access policy key for the specified shared access policy.

sharedAccessPolicyName string

The shared access policy name for the Event Hub, Service Bus Queue, Service Bus Topic, etc.

streamAnalyticsJobName string

The name of the Stream Analytics Job. Changing this forces a new resource to be created.

name string

The name of the Stream Input IoTHub. Changing this forces a new resource to be created.

endpoint str

The IoT Hub endpoint to connect to (ie. messages/events, messages/operationsMonitoringEvents, etc.).

eventhub_consumer_group_name str

The name of an Event Hub Consumer Group that should be used to read events from the Event Hub. Specifying distinct consumer group names for multiple inputs allows each of those inputs to receive the same events from the Event Hub.

iothub_namespace str

The name or the URI of the IoT Hub.

resource_group_name str

The name of the Resource Group where the Stream Analytics Job exists. Changing this forces a new resource to be created.

serialization Dict[StreamInputIotHubSerialization]

A serialization block as defined below.

shared_access_policy_key str

The shared access policy key for the specified shared access policy.

shared_access_policy_name str

The shared access policy name for the Event Hub, Service Bus Queue, Service Bus Topic, etc.

stream_analytics_job_name str

The name of the Stream Analytics Job. Changing this forces a new resource to be created.

name str

The name of the Stream Input IoTHub. Changing this forces a new resource to be created.

Outputs

All input properties are implicitly available as output properties. Additionally, the StreamInputIotHub 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 StreamInputIotHub Resource

Get an existing StreamInputIotHub 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?: StreamInputIotHubState, opts?: CustomResourceOptions): StreamInputIotHub
static get(resource_name, id, opts=None, endpoint=None, eventhub_consumer_group_name=None, iothub_namespace=None, name=None, resource_group_name=None, serialization=None, shared_access_policy_key=None, shared_access_policy_name=None, stream_analytics_job_name=None, __props__=None);
func GetStreamInputIotHub(ctx *Context, name string, id IDInput, state *StreamInputIotHubState, opts ...ResourceOption) (*StreamInputIotHub, error)
public static StreamInputIotHub Get(string name, Input<string> id, StreamInputIotHubState? 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:

Endpoint string

The IoT Hub endpoint to connect to (ie. messages/events, messages/operationsMonitoringEvents, etc.).

EventhubConsumerGroupName string

The name of an Event Hub Consumer Group that should be used to read events from the Event Hub. Specifying distinct consumer group names for multiple inputs allows each of those inputs to receive the same events from the Event Hub.

IothubNamespace string

The name or the URI of the IoT Hub.

Name string

The name of the Stream Input IoTHub. Changing this forces a new resource to be created.

ResourceGroupName string

The name of the Resource Group where the Stream Analytics Job exists. Changing this forces a new resource to be created.

Serialization StreamInputIotHubSerializationArgs

A serialization block as defined below.

SharedAccessPolicyKey string

The shared access policy key for the specified shared access policy.

SharedAccessPolicyName string

The shared access policy name for the Event Hub, Service Bus Queue, Service Bus Topic, etc.

StreamAnalyticsJobName string

The name of the Stream Analytics Job. Changing this forces a new resource to be created.

Endpoint string

The IoT Hub endpoint to connect to (ie. messages/events, messages/operationsMonitoringEvents, etc.).

EventhubConsumerGroupName string

The name of an Event Hub Consumer Group that should be used to read events from the Event Hub. Specifying distinct consumer group names for multiple inputs allows each of those inputs to receive the same events from the Event Hub.

IothubNamespace string

The name or the URI of the IoT Hub.

Name string

The name of the Stream Input IoTHub. Changing this forces a new resource to be created.

ResourceGroupName string

The name of the Resource Group where the Stream Analytics Job exists. Changing this forces a new resource to be created.

Serialization StreamInputIotHubSerialization

A serialization block as defined below.

SharedAccessPolicyKey string

The shared access policy key for the specified shared access policy.

SharedAccessPolicyName string

The shared access policy name for the Event Hub, Service Bus Queue, Service Bus Topic, etc.

StreamAnalyticsJobName string

The name of the Stream Analytics Job. Changing this forces a new resource to be created.

endpoint string

The IoT Hub endpoint to connect to (ie. messages/events, messages/operationsMonitoringEvents, etc.).

eventhubConsumerGroupName string

The name of an Event Hub Consumer Group that should be used to read events from the Event Hub. Specifying distinct consumer group names for multiple inputs allows each of those inputs to receive the same events from the Event Hub.

iothubNamespace string

The name or the URI of the IoT Hub.

name string

The name of the Stream Input IoTHub. Changing this forces a new resource to be created.

resourceGroupName string

The name of the Resource Group where the Stream Analytics Job exists. Changing this forces a new resource to be created.

serialization StreamInputIotHubSerialization

A serialization block as defined below.

sharedAccessPolicyKey string

The shared access policy key for the specified shared access policy.

sharedAccessPolicyName string

The shared access policy name for the Event Hub, Service Bus Queue, Service Bus Topic, etc.

streamAnalyticsJobName string

The name of the Stream Analytics Job. Changing this forces a new resource to be created.

endpoint str

The IoT Hub endpoint to connect to (ie. messages/events, messages/operationsMonitoringEvents, etc.).

eventhub_consumer_group_name str

The name of an Event Hub Consumer Group that should be used to read events from the Event Hub. Specifying distinct consumer group names for multiple inputs allows each of those inputs to receive the same events from the Event Hub.

iothub_namespace str

The name or the URI of the IoT Hub.

name str

The name of the Stream Input IoTHub. Changing this forces a new resource to be created.

resource_group_name str

The name of the Resource Group where the Stream Analytics Job exists. Changing this forces a new resource to be created.

serialization Dict[StreamInputIotHubSerialization]

A serialization block as defined below.

shared_access_policy_key str

The shared access policy key for the specified shared access policy.

shared_access_policy_name str

The shared access policy name for the Event Hub, Service Bus Queue, Service Bus Topic, etc.

stream_analytics_job_name str

The name of the Stream Analytics Job. Changing this forces a new resource to be created.

Supporting Types

StreamInputIotHubSerialization

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Type string

The serialization format used for incoming data streams. Possible values are Avro, Csv and Json.

Encoding string

The encoding of the incoming data in the case of input and the encoding of outgoing data in the case of output. It currently can only be set to UTF8.

FieldDelimiter string

The delimiter that will be used to separate comma-separated value (CSV) records. Possible values are (space), , (comma), (tab), | (pipe) and ;.

Type string

The serialization format used for incoming data streams. Possible values are Avro, Csv and Json.

Encoding string

The encoding of the incoming data in the case of input and the encoding of outgoing data in the case of output. It currently can only be set to UTF8.

FieldDelimiter string

The delimiter that will be used to separate comma-separated value (CSV) records. Possible values are (space), , (comma), (tab), | (pipe) and ;.

type string

The serialization format used for incoming data streams. Possible values are Avro, Csv and Json.

encoding string

The encoding of the incoming data in the case of input and the encoding of outgoing data in the case of output. It currently can only be set to UTF8.

fieldDelimiter string

The delimiter that will be used to separate comma-separated value (CSV) records. Possible values are (space), , (comma), (tab), | (pipe) and ;.

type str

The serialization format used for incoming data streams. Possible values are Avro, Csv and Json.

encoding str

The encoding of the incoming data in the case of input and the encoding of outgoing data in the case of output. It currently can only be set to UTF8.

fieldDelimiter str

The delimiter that will be used to separate comma-separated value (CSV) records. Possible values are (space), , (comma), (tab), | (pipe) and ;.

Package Details

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