EnrichmentArgs

data class EnrichmentArgs(val endpointNames: Output<List<String>>? = null, val iothubName: Output<String>? = null, val key: Output<String>? = null, val resourceGroupName: Output<String>? = null, val value: Output<String>? = null) : ConvertibleToJava<EnrichmentArgs>

Manages an IotHub Enrichment

NOTE: Enrichment can be defined either directly on the azure.iot.IoTHub resource, or using the azure.iot.Enrichment resources - but the two cannot be used together. If both are used against the same IoTHub, spurious changes will occur.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.storage.Account;
import com.pulumi.azure.storage.AccountArgs;
import com.pulumi.azure.storage.Container;
import com.pulumi.azure.storage.ContainerArgs;
import com.pulumi.azure.iot.IoTHub;
import com.pulumi.azure.iot.IoTHubArgs;
import com.pulumi.azure.iot.inputs.IoTHubSkuArgs;
import com.pulumi.azure.iot.EndpointStorageContainer;
import com.pulumi.azure.iot.EndpointStorageContainerArgs;
import com.pulumi.azure.iot.Route;
import com.pulumi.azure.iot.RouteArgs;
import com.pulumi.azure.iot.Enrichment;
import com.pulumi.azure.iot.EnrichmentArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
.location("West Europe")
.build());
var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.location(exampleResourceGroup.location())
.accountTier("Standard")
.accountReplicationType("LRS")
.build());
var exampleContainer = new Container("exampleContainer", ContainerArgs.builder()
.storageAccountName(exampleAccount.name())
.containerAccessType("private")
.build());
var exampleIoTHub = new IoTHub("exampleIoTHub", IoTHubArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.location(exampleResourceGroup.location())
.sku(IoTHubSkuArgs.builder()
.name("S1")
.capacity("1")
.build())
.tags(Map.of("purpose", "testing"))
.build());
var exampleEndpointStorageContainer = new EndpointStorageContainer("exampleEndpointStorageContainer", EndpointStorageContainerArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.iothubId(exampleIoTHub.id())
.connectionString(exampleAccount.primaryBlobConnectionString())
.batchFrequencyInSeconds(60)
.maxChunkSizeInBytes(10485760)
.containerName(exampleContainer.name())
.encoding("Avro")
.fileNameFormat("{iothub}/{partition}_{YYYY}_{MM}_{DD}_{HH}_{mm}")
.build());
var exampleRoute = new Route("exampleRoute", RouteArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.iothubName(exampleIoTHub.name())
.source("DeviceMessages")
.condition("true")
.endpointNames(exampleEndpointStorageContainer.name())
.enabled(true)
.build());
var exampleEnrichment = new Enrichment("exampleEnrichment", EnrichmentArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.iothubName(exampleIoTHub.name())
.key("example")
.value("my value")
.endpointNames(exampleEndpointStorageContainer.name())
.build());
}
}

Import

IoTHub Enrichment can be imported using the resource id, e.g.

$ pulumi import azure:iot/enrichment:Enrichment enrichment1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Devices/iotHubs/hub1/enrichments/enrichment1

Constructors

Link copied to clipboard
fun EnrichmentArgs(endpointNames: Output<List<String>>? = null, iothubName: Output<String>? = null, key: Output<String>? = null, resourceGroupName: Output<String>? = null, value: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): EnrichmentArgs

Properties

Link copied to clipboard
val endpointNames: Output<List<String>>? = null

The list of endpoints which will be enriched.

Link copied to clipboard
val iothubName: Output<String>? = null

The IoTHub name of the enrichment. Changing this forces a new resource to be created.

Link copied to clipboard
val key: Output<String>? = null

The key of the enrichment. Changing this forces a new resource to be created.

Link copied to clipboard
val resourceGroupName: Output<String>? = null

The name of the resource group under which the IoTHub resource is created. Changing this forces a new resource to be created.

Link copied to clipboard
val value: Output<String>? = null

The value of the enrichment. Value can be any static string, the name of the IoT hub sending the message (use $iothubname) or information from the device twin (ex: $twin.tags.latitude)