Azure IoT Hub DPS Shared Access Policy
This page shows how to write Terraform and Azure Resource Manager for IoT Hub DPS Shared Access Policy and write them securely.
azurerm_iothub_dps_shared_access_policy (Terraform)
The DPS Shared Access Policy in IoT Hub can be configured in Terraform with the resource name azurerm_iothub_dps_shared_access_policy
. The following sections describe 3 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "azurerm_iothub_dps_shared_access_policy" "raspberry_pi_temp_shared_access_policy" {
name = "raspberry-pi-temp-shared-access-policy"
resource_group_name = azurerm_resource_group.azure_iot_resource_group.name
iothub_dps_name = azurerm_iothub_dps.raspberry_pi_temp.name
enrollment_write = true
enrollment_read = true
resource "azurerm_iothub_dps_shared_access_policy" "this" {
enrollment_read = var.enrollment_read
enrollment_write = var.enrollment_write
iothub_dps_name = var.iothub_dps_name
name = var.name
registration_read = var.registration_read
resource "azurerm_iothub_dps_shared_access_policy" "this" {
enrollment_read = var.enrollment_read
enrollment_write = var.enrollment_write
iothub_dps_name = var.iothub_dps_name
name = var.name
registration_read = var.registration_read
Parameters
-
enrollment_read
optional - bool -
enrollment_write
optional - bool -
id
optional computed - string -
iothub_dps_name
required - string -
name
required - string -
primary_connection_string
optional computed - string -
primary_key
optional computed - string -
registration_read
optional - bool -
registration_write
optional - bool -
resource_group_name
required - string -
secondary_connection_string
optional computed - string -
secondary_key
optional computed - string -
service_config
optional - bool -
timeouts
single block
Explanation in Terraform Registry
Manages an IotHub Device Provisioning Service Shared Access Policy
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 Shared Access Policy?
Azure IoT Hub DPS Shared Access Policy 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 Shared Access Policy?
For Terraform, the LucasBurgessDev/PortfolioAWSTerraform, kevinhead/azurerm and niveklabs/azurerm 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.