Azure IoT Hub DPS
This page shows how to write Terraform and Azure Resource Manager for IoT Hub DPS and write them securely.
azurerm_iothub_dps (Terraform)
The DPS in IoT Hub can be configured in Terraform with the resource name azurerm_iothub_dps
. The following sections describe 9 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "azurerm_iothub_dps" "raspberry_pi_temp" {
name = "raspberrypitemp"
resource_group_name = azurerm_resource_group.azure_iot_resource_group.name
location = var.location
#allocation_policy = "Hashed"
resource "azurerm_iothub_dps" "b59dps" {
name = "b59dps"
resource_group_name = azurerm_resource_group.b59.name
location = azurerm_resource_group.b59.location
sku {
resource "azurerm_iothub_dps" "iotdps" {
name = "__var.resourceiotdps__"
resource_group_name = data.azurerm_resource_group.resourcegroupiotdps.name
location = data.azurerm_resource_group.resourcegroupiotdps.location
sku {
resource "azurerm_iothub_dps" "primary" {
name = local.iot_hub_dps_name
resource_group_name = azurerm_resource_group.primary.name
location = azurerm_resource_group.primary.location
sku {
resource "azurerm_iothub_dps" "this" {
location = var.location
name = var.name
resource_group_name = var.resource_group_name
tags = var.tags
resource "azurerm_iothub_dps" "this" {
location = var.location
name = var.name
resource_group_name = var.resource_group_name
tags = var.tags
resource "azurerm_iothub_dps" "primary" {
name = local.iot_hub_dps_name
resource_group_name = azurerm_resource_group.primary.name
location = azurerm_resource_group.primary.location
sku {
resource "azurerm_iothub_dps" "iot_hub_paessler" {
name = "sigfoxpaessler"
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
allocation_policy = "Hashed"
resource "azurerm_iothub_dps" "airq-iot-hub-dps" {
name = "airq-iot-hub-dps"
resource_group_name = azurerm_resource_group.airq-rg.name
location = azurerm_resource_group.airq-rg.location
sku {
Parameters
-
allocation_policy
optional computed - string -
device_provisioning_host_name
optional computed - string -
id
optional computed - string -
id_scope
optional computed - string -
location
required - string -
name
required - string -
resource_group_name
required - string -
service_operations_host_name
optional computed - string -
tags
optional - map from string to string -
linked_hub
list block-
allocation_weight
optional - number -
apply_allocation_policy
optional - bool -
connection_string
required - string -
hostname
optional computed - string -
location
required - string
-
-
sku
list block -
timeouts
single block
Explanation in Terraform Registry
Manages an IotHub Device Provisioning Service.
Microsoft.Devices/provisioningServices (Azure Resource Manager)
The provisioningServices in Microsoft.Devices can be configured in Azure Resource Manager with the resource name Microsoft.Devices/provisioningServices
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
"type": "Microsoft.Devices/provisioningServices",
"apiVersion": "2020-03-01",
"name": "[parameters('provisioningServices_P4_DPS_name')]",
"location": "westeurope",
"sku": {
"name": "S1",
"type": "Microsoft.Devices/provisioningServices",
"apiVersion": "2017-11-15",
"location": "West US",
"sku": {
"name": "S1",
"tier": "standard",
"type": "Microsoft.Devices/provisioningServices",
"apiVersion": "2017-08-21-preview",
"location": "West US",
"sku": {
"name": "S1",
"tier": "standard",
"type": "Microsoft.Devices/provisioningServices",
"apiVersion": "2020-01-01",
"name": "{0}",
"location": "{1}",
"sku": {{
"name": "S1",
"type": "Microsoft.Devices/provisioningServices",
"apiVersion": "2020-01-01",
"name": "[parameters('dpsName')]",
"location": "[parameters('location')]",
"sku": "[parameters('sku')]",
"properties": {
"type": "Microsoft.Devices/provisioningServices"
}
]
Frequently asked questions
What is Azure IoT Hub DPS?
Azure IoT Hub DPS is a resource for IoT Hub of Microsoft Azure. Settings can be wrote in Terraform.
Where can I find the example code for the Azure IoT Hub DPS?
For Terraform, the LucasBurgessDev/PortfolioAWSTerraform, mysticrenji/terraform-azure and osmodies/github-move source code examples are useful. See the Terraform Example section for further details.
For Azure Resource Manager, the Skarlyne/iotamazonia, Azure/azure-resource-manager-schemas and Azure/azure-resource-manager-schemas source code examples are useful. See the Azure Resource Manager Example section for further details.