» azurerm_iothub_dps

Manages an IotHub Device Provisioning Service.

» Example Usage

resource "azurerm_resource_group" "example" {
  name     = "resourceGroup1"
  location = "West US"
}

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

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

» Argument Reference

The following arguments are supported:

  • name - (Required) Specifies the name of the Iot Device Provisioning Service resource. Changing this forces a new resource to be created.

  • resource_group_name - (Required) The name of the resource group under which the Iot Device Provisioning Service resource has to be created. Changing this forces a new resource to be created.

  • location - (Required) Specifies the supported Azure location where the resource has to be createc. Changing this forces a new resource to be created.

  • sku - (Required) A sku block as defined below.

  • linked_hub - (Optional) A linked_hub block as defined below.

  • tags - (Optional) A mapping of tags to assign to the resource.


A sku block supports the following:

  • name - (Required) The name of the sku. Currently can only be set to S1.

  • capacity - (Required) The number of provisioned IoT Device Provisioning Service units.


A linked_hub block supports the following:

  • connection_string - (Required) The connection string to connect to the IoT Hub. Changing this forces a new resource.

  • location - (Required) The location of the IoT hub. Changing this forces a new resource.

  • apply_allocation_policy - (Optional) Determines whether to apply allocation policies to the IoT Hub. Defaults to false.

  • allocation_weight - (Optional) The weight applied to the IoT Hub. Defaults to 0.

  • hostname - (Computed) The IoT Hub hostname.

» Attributes Reference

The following attributes are exported:

» Timeouts

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

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

» Import

IoT Device Provisioning Service can be imported using the resource id, e.g.

terraform import azurerm_iothub_dps.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Devices/provisioningServices/example