Skip to content

azurermIothubConsumerGroup

Manages a Consumer Group within an IotHub

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "West Europe",
    name: "example-resources",
  }
);
const azurermIothubExample = new azurerm.iothub.Iothub(this, "example_1", {
  location: azurermResourceGroupExample.location,
  name: "test",
  resource_group_name: azurermResourceGroupExample.name,
  sku: [
    {
      capacity: "1",
      name: "S1",
    },
  ],
  tags: {
    purpose: "testing",
  },
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermIothubExample.overrideLogicalId("example");
const azurermIothubConsumerGroupExample =
  new azurerm.iothubConsumerGroup.IothubConsumerGroup(this, "example_2", {
    eventhub_endpoint_name: "events",
    iothub_name: azurermIothubExample.name,
    name: "terraform",
    resource_group_name: azurermResourceGroupExample.name,
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermIothubConsumerGroupExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • name - (Required) The name of this Consumer Group. Changing this forces a new resource to be created.

  • iothubName - (Required) The name of the IoT Hub. Changing this forces a new resource to be created.

  • eventhubEndpointName - (Required) The name of the Event Hub-compatible endpoint in the IoT hub. Changing this forces a new resource to be created.

  • resourceGroupName - (Required) The name of the resource group that contains the IoT hub. Changing this forces a new resource to be created.

Attributes Reference

The following attributes are exported:

  • id - The ID of the IoTHub Consumer Group.

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • create - (Defaults to 30 minutes) Used when creating the IotHub Consumer Group.
  • update - (Defaults to 30 minutes) Used when updating the IotHub Consumer Group.
  • read - (Defaults to 5 minutes) Used when retrieving the IotHub Consumer Group.
  • delete - (Defaults to 30 minutes) Used when deleting the IotHub Consumer Group.

Import

IoTHub Consumer Groups can be imported using the resourceId, e.g.

terraform import azurerm_iothub_consumer_group.group1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Devices/iotHubs/hub1/eventHubEndpoints/events/consumerGroups/group1