Consumer Group Args
data class ConsumerGroupArgs(val eventhubEndpointName: Output<String>? = null, val iothubName: Output<String>? = null, val name: Output<String>? = null, val resourceGroupName: Output<String>? = null) : ConvertibleToJava<ConsumerGroupArgs>
Manages a Consumer Group within an IotHub
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "example-resources",
location: "West Europe",
});
const exampleIoTHub = new azure.iot.IoTHub("example", {
name: "test",
resourceGroupName: example.name,
location: example.location,
sku: {
name: "S1",
capacity: 1,
},
tags: {
purpose: "testing",
},
});
const exampleConsumerGroup = new azure.iot.ConsumerGroup("example", {
name: "group",
iothubName: exampleIoTHub.name,
eventhubEndpointName: "events",
resourceGroupName: example.name,
});
Content copied to clipboard
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="example-resources",
location="West Europe")
example_io_t_hub = azure.iot.IoTHub("example",
name="test",
resource_group_name=example.name,
location=example.location,
sku={
"name": "S1",
"capacity": 1,
},
tags={
"purpose": "testing",
})
example_consumer_group = azure.iot.ConsumerGroup("example",
name="group",
iothub_name=example_io_t_hub.name,
eventhub_endpoint_name="events",
resource_group_name=example.name)
Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = new Azure.Core.ResourceGroup("example", new()
{
Name = "example-resources",
Location = "West Europe",
});
var exampleIoTHub = new Azure.Iot.IoTHub("example", new()
{
Name = "test",
ResourceGroupName = example.Name,
Location = example.Location,
Sku = new Azure.Iot.Inputs.IoTHubSkuArgs
{
Name = "S1",
Capacity = 1,
},
Tags =
{
{ "purpose", "testing" },
},
});
var exampleConsumerGroup = new Azure.Iot.ConsumerGroup("example", new()
{
Name = "group",
IothubName = exampleIoTHub.Name,
EventhubEndpointName = "events",
ResourceGroupName = example.Name,
});
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/iot"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
Name: pulumi.String("example-resources"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
exampleIoTHub, err := iot.NewIoTHub(ctx, "example", &iot.IoTHubArgs{
Name: pulumi.String("test"),
ResourceGroupName: example.Name,
Location: example.Location,
Sku: &iot.IoTHubSkuArgs{
Name: pulumi.String("S1"),
Capacity: pulumi.Int(1),
},
Tags: pulumi.StringMap{
"purpose": pulumi.String("testing"),
},
})
if err != nil {
return err
}
_, err = iot.NewConsumerGroup(ctx, "example", &iot.ConsumerGroupArgs{
Name: pulumi.String("group"),
IothubName: exampleIoTHub.Name,
EventhubEndpointName: pulumi.String("events"),
ResourceGroupName: example.Name,
})
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.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.iot.IoTHub;
import com.pulumi.azure.iot.IoTHubArgs;
import com.pulumi.azure.iot.inputs.IoTHubSkuArgs;
import com.pulumi.azure.iot.ConsumerGroup;
import com.pulumi.azure.iot.ConsumerGroupArgs;
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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
.name("example-resources")
.location("West Europe")
.build());
var exampleIoTHub = new IoTHub("exampleIoTHub", IoTHubArgs.builder()
.name("test")
.resourceGroupName(example.name())
.location(example.location())
.sku(IoTHubSkuArgs.builder()
.name("S1")
.capacity("1")
.build())
.tags(Map.of("purpose", "testing"))
.build());
var exampleConsumerGroup = new ConsumerGroup("exampleConsumerGroup", ConsumerGroupArgs.builder()
.name("group")
.iothubName(exampleIoTHub.name())
.eventhubEndpointName("events")
.resourceGroupName(example.name())
.build());
}
}
Content copied to clipboard
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example-resources
location: West Europe
exampleIoTHub:
type: azure:iot:IoTHub
name: example
properties:
name: test
resourceGroupName: ${example.name}
location: ${example.location}
sku:
name: S1
capacity: '1'
tags:
purpose: testing
exampleConsumerGroup:
type: azure:iot:ConsumerGroup
name: example
properties:
name: group
iothubName: ${exampleIoTHub.name}
eventhubEndpointName: events
resourceGroupName: ${example.name}
Content copied to clipboard
Import
IoTHub Consumer Groups can be imported using the resource id
, e.g.
$ pulumi import azure:iot/consumerGroup:ConsumerGroup group1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Devices/iotHubs/hub1/eventHubEndpoints/events/consumerGroups/group1
Content copied to clipboard
Properties
Link copied to clipboard
The name of the Event Hub-compatible endpoint in the IoT hub. Changing this forces a new resource to be created.
Link copied to clipboard
The name of the IoT Hub. Changing this forces a new resource to be created.
Link copied to clipboard
The name of the resource group that contains the IoT hub. Changing this forces a new resource to be created.