Skip to content

Data Source: azurermIothub

Use this data source to access information about an existing IoTHub.

Example Usage

import * as cdktf from "cdktf";
/*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 dataAzurermIothubExample =
  new azurerm.dataAzurermIothub.DataAzurermIothub(this, "example", {
    name: "existing",
    resource_group_name: "existing",
  });
new cdktf.TerraformOutput(this, "id", {
  value: dataAzurermIothubExample.id,
});

Arguments Reference

The following arguments are supported:

  • name - (Required) The name of this IoTHub.

  • resourceGroupName - (Required) The name of the Resource Group where the IoTHub exists.


  • tags - (Optional) A mapping of tags which should be assigned to the IoTHub.

Attributes Reference

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

  • id - The ID of the IoTHub.
  • hostname - The Hostname of the IoTHub.
  • identity - A identity block as defined below.

An identity block exports the following:

  • identityIds - The list of User Managed Identity IDs which are assigned to the Virtual Machine.

  • principalId - The ID of the System Managed Service Principal assigned to the Virtual Machine.

  • tenantId - The ID of the Tenant of the System Managed Service Principal assigned to the Virtual Machine.

  • type - The identity type of the Managed Identity assigned to the Virtual Machine.

Timeouts

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

  • read - (Defaults to 5 minutes) Used when retrieving the IoTHub.