Manages a Consumer Group within an IotHub
resource "azurerm_resource_group" "example" {
name = "example-resources"
location = "West Europe"
}
resource "azurerm_iothub" "example" {
name = "test"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
sku {
name = "S1"
capacity = "1"
}
tags = {
purpose = "testing"
}
}
resource "azurerm_iothub_consumer_group" "example" {
name = "terraform"
iothub_name = azurerm_iothub.example.name
eventhub_endpoint_name = "events"
resource_group_name = azurerm_resource_group.example.name
}
The following arguments are supported:
name
- (Required) The name of this Consumer Group. Changing this forces a new resource to be created.
iothub_name
- (Required) The name of the IoT Hub. Changing this forces a new resource to be created.
eventhub_endpoint_name
- (Required) The name of the Event Hub-compatible endpoint in the IoT hub. Changing this forces a new resource to be created.
resource_group_name
- (Required) The name of the resource group that contains the IoT hub. Changing this forces a new resource to be created.
In addition to the Arguments listed above - the following Attributes are exported:
id
- The ID of the IoTHub Consumer Group.The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 30 minutes) Used when creating 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.IoTHub Consumer Groups can be imported using the resource id
, 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