Terraform-provider-azurerm: IoT Device Provisioning Resource

Created on 2 Aug 2018  ·  5Comments  ·  Source: terraform-providers/terraform-provider-azurerm

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

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

New or Affected Resource(s)

This would be a new resource. Something like:

  • azurerm_iotdps
    OR
  • azurerm_iot_dps

Potential Terraform Configuration

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"
  }
}

References

new-resource serviciothub

Most helpful comment

what about the possibility to link an iot hub to the newly created dps? that would be great.

All 5 comments

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!

Was this page helpful?
0 / 5 - 0 ratings