azurerm_time_series_insights_event_source_iothub

Manages an Azure IoT Time Series Insights IoTHub Event Source.

Example Usage

resource "azurerm_resource_group" "example" {
  name     = "example"
  location = "West Europe"
}

resource "azurerm_iothub" "example" {
  name                = "example"
  resource_group_name = azurerm_resource_group.example.name
  location            = azurerm_resource_group.example.location

  sku {
    name     = "B1"
    capacity = "1"
  }
}

resource "azurerm_iothub_consumer_group" "example" {
  name                   = "example"
  iothub_name            = azurerm_iothub.example.name
  eventhub_endpoint_name = "events"
  resource_group_name    = azurerm_resource_group.example.name
}

resource "azurerm_storage_account" "storage" {
  name                     = "example"
  location                 = azurerm_resource_group.example.location
  resource_group_name      = azurerm_resource_group.example.name
  account_tier             = "Standard"
  account_replication_type = "LRS"
}

resource "azurerm_iot_time_series_insights_gen2_environment" "example" {
  name                = "example"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  sku_name            = "L1"
  id_properties       = ["id"]

  storage {
    name = azurerm_storage_account.storage.name
    key  = azurerm_storage_account.storage.primary_access_key
  }
}

resource "azurerm_iot_time_series_insights_event_source_iothub" "example" {
  name                     = "example"
  location                 = azurerm_resource_group.example.location
  environment_id           = azurerm_iot_time_series_insights_gen2_environment.example.id
  iothub_name              = azurerm_iothub.example.name
  shared_access_key        = azurerm_iothub.example.shared_access_policy[0].primary_key
  shared_access_key_name   = azurerm_iothub.example.shared_access_policy[0].key_name
  consumer_group_name      = azurerm_iothub_consumer_group.example.name
  event_source_resource_id = azurerm_iothub.example.id
}

Argument Reference

The following arguments are supported:

Attributes Reference

In addition to the Arguments listed above - the following Attributes are exported:

Timeouts

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

Import

Azure IoT Time Series Insights IoTHub Event Source can be imported using the resource id, e.g.

terraform import azurerm_iot_time_series_insights_event_source_iothub.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example/providers/Microsoft.TimeSeriesInsights/environments/environment1/eventSources/example