Skip to content

azurermIothubDps

Manages an IotHub Device Provisioning Service.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "West Europe",
    name: "example-resources",
  }
);
const azurermIothubDpsExample = new azurerm.iothubDps.IothubDps(
  this,
  "example_1",
  {
    allocation_policy: "Hashed",
    location: azurermResourceGroupExample.location,
    name: "example",
    resource_group_name: azurermResourceGroupExample.name,
    sku: [
      {
        capacity: "1",
        name: "S1",
      },
    ],
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermIothubDpsExample.overrideLogicalId("example");

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.

  • resourceGroupName - (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 created. Changing this forces a new resource to be created.

  • allocationPolicy - (Optional) The allocation policy of the IoT Device Provisioning Service (hashed, geoLatency or static). Defaults to hashed.

  • dataResidencyEnabled - (Optional) Specifies if the IoT Device Provisioning Service has data residency and disaster recovery enabled. Defaults to false. Changing this forces a new resource to be created.

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

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

  • publicNetworkAccessEnabled - (Optional) Whether requests from Public Network are allowed. Defaults to true.

  • ipFilterRule - (Optional) An ipFilterRule 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 linkedHub block supports the following:

  • connectionString - (Required) The connection string to connect to the IoT Hub.

  • location - (Required) The location of the IoT hub.

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

  • allocationWeight - (Optional) The weight applied to the IoT Hub. Defaults to 1.

  • hostname - (Computed) The IoT Hub hostname.


An ipFilterRule block supports the following:

  • name - (Required) The name of the filter.

  • ipMask - (Required) The IP address range in CIDR notation for the rule.

  • action - (Required) The desired action for requests captured by this rule. Possible values are accept, reject

  • target - (Optional) Target for requests captured by this rule. Possible values are all, deviceApi and serviceApi.

Attributes Reference

The following attributes are exported:

  • id - The ID of the IoT Device Provisioning Service.

  • deviceProvisioningHostName - The device endpoint of the IoT Device Provisioning Service.

  • idScope - The unique identifier of the IoT Device Provisioning Service.

  • serviceOperationsHostName - The service endpoint of the IoT Device Provisioning Service.

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 resourceId, e.g.

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