This example shows how to create an Azure IoT Operations broker authentication using Terraform.
Before running this example, you need:
- Azure CLI installed and authenticated
- Terraform 1.6 or later
- Existing Resource Group in Azure
- Existing IoT Operations Instance
- Existing IoT Operations Broker
Create a terraform.tfvars file:
# Prefix for resource naming
prefix = "mycompany"
# Existing Resource Group
resource_group_name = "existing-resource-group-name"
# Existing IoT Operations Instance
instance_name = "existing-iotoperations-instance"
# Existing IoT Operations Broker
broker_name = "existing-iotoperations-broker"
# Authentication audience (optional)
audience = "aio-internal"terraform init
terraform plan
terraform apply| Name | Description | Type | Default | Required |
|---|---|---|---|---|
prefix |
Prefix for resource naming | string |
n/a | yes |
resource_group_name |
Name of existing resource group | string |
n/a | yes |
instance_name |
Name of existing IoT Operations instance | string |
n/a | yes |
broker_name |
Name of existing IoT Operations broker | string |
n/a | yes |
audience |
Authentication audience | string |
"aio-internal" |
no |
| Name | Description |
|---|---|
iotoperations_broker_authentication_id |
ARM resource ID of the IoT Operations broker authentication |
This example creates:
- IoT Operations Broker Authentication (named
{prefix}-broker-auth) within an existing IoT Operations broker
The broker authentication requires:
- An existing Resource Group
- An existing IoT Operations Instance
- An existing IoT Operations Broker
The example configures:
- ServiceAccountToken authentication method
- Custom settings with audience configuration
terraform destroyNote: This will only destroy the broker authentication. The broker, IoT Operations instance, and resource group will remain.