Add a resource for Azure IoT Device Provisioning Service. This would likely be a new resource; something like azurerm_iotdps. This command would be completed through the Azure-CLI through a command like that below.
az iot dps create --name MyDps --resource-group MyResourceGroup --location westus
This would be a new resource. Something like:
resource "azurerm_iot_dps" "test" {
name = "test"
resource_group_name = "test"
location = "West US"
sku = "S1"
tags {
"purpose" = "testing"
}
}
An extended version of this would include the options for access-policy, certificate, and linked-hub. That might look something like:
resource "azurerm_iot_dps" "test" {
name = "test"
resource_group_name = "test"
location = "West US"
sku = "S1"
access_policy {
name = "test_policy"
rights = "DeviceConnect"
shared_access_policy {
primary_key = "123"
secondary_key = "abc"
}
}
certificate {
contents = "${base64encode(file("certificate-to-import.pfx"))}"
password = "Pass@word1"
}
linked-hub = "${azurerm_iothub.test.name}"
tags {
"purpose" = "testing"
}
}
what about the possibility to link an iot hub to the newly created dps? that would be great.
Agreed we need the IoT hub linkage to make this useful - Glad to see this started but without the hubs it does not add a lot of value.
Hey @ezhaar and @ukphillips, #3922 should finish up this issue by adding support for linked hubs
@mbfrahry I found another issue with the DPS resource. I filed a bug report in the TF repo. Perhaps I should file it here instead? https://github.com/hashicorp/terraform/issues/22228
I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!
Most helpful comment
what about the possibility to link an iot hub to the newly created dps? that would be great.