Enrichment

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

Coming soon!

Coming soon!

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());

    }
}

Coming soon!

Coming soon!

resources:
  exampleResourceGroup:
    type: azure:core:ResourceGroup
    properties:
      location: West Europe
  exampleAccount:
    type: azure:storage:Account
    properties:
      resourceGroupName: ${exampleResourceGroup.name}
      location: ${exampleResourceGroup.location}
      accountTier: Standard
      accountReplicationType: LRS
  exampleContainer:
    type: azure:storage:Container
    properties:
      storageAccountName: ${exampleAccount.name}
      containerAccessType: private
  exampleIoTHub:
    type: azure:iot:IoTHub
    properties:
      resourceGroupName: ${exampleResourceGroup.name}
      location: ${exampleResourceGroup.location}
      sku:
        name: S1
        capacity: 1
      tags:
        purpose: testing
  exampleEndpointStorageContainer:
    type: azure:iot:EndpointStorageContainer
    properties:
      resourceGroupName: ${exampleResourceGroup.name}
      iothubId: ${exampleIoTHub.id}
      connectionString: ${exampleAccount.primaryBlobConnectionString}
      batchFrequencyInSeconds: 60
      maxChunkSizeInBytes: 1.048576e+07
      containerName: ${exampleContainer.name}
      encoding: Avro
      fileNameFormat: '{iothub}/{partition}_{YYYY}_{MM}_{DD}_{HH}_{mm}'
  exampleRoute:
    type: azure:iot:Route
    properties:
      resourceGroupName: ${exampleResourceGroup.name}
      iothubName: ${exampleIoTHub.name}
      source: DeviceMessages
      condition: true
      endpointNames:
        - ${exampleEndpointStorageContainer.name}
      enabled: true
  exampleEnrichment:
    type: azure:iot:Enrichment
    properties:
      resourceGroupName: ${exampleResourceGroup.name}
      iothubName: ${exampleIoTHub.name}
      key: example
      value: my value
      endpointNames:
        - ${exampleEndpointStorageContainer.name}

Create Enrichment Resource

new Enrichment(name: string, args: EnrichmentArgs, opts?: CustomResourceOptions);
@overload
def Enrichment(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               endpoint_names: Optional[Sequence[str]] = None,
               iothub_name: Optional[str] = None,
               key: Optional[str] = None,
               resource_group_name: Optional[str] = None,
               value: Optional[str] = None)
@overload
def Enrichment(resource_name: str,
               args: EnrichmentArgs,
               opts: Optional[ResourceOptions] = None)
func NewEnrichment(ctx *Context, name string, args EnrichmentArgs, opts ...ResourceOption) (*Enrichment, error)
public Enrichment(string name, EnrichmentArgs args, CustomResourceOptions? opts = null)
public Enrichment(String name, EnrichmentArgs args)
public Enrichment(String name, EnrichmentArgs args, CustomResourceOptions options)
type: azure:iot:Enrichment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args EnrichmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args EnrichmentArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args EnrichmentArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args EnrichmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args EnrichmentArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Enrichment Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Enrichment resource accepts the following input properties:

EndpointNames List<string>

The list of endpoints which will be enriched.

IothubName string
Key string

The key of the enrichment.

ResourceGroupName string
Value string

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)

EndpointNames []string

The list of endpoints which will be enriched.

IothubName string
Key string

The key of the enrichment.

ResourceGroupName string
Value string

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)

endpointNames List<String>

The list of endpoints which will be enriched.

iothubName String
key String

The key of the enrichment.

resourceGroupName String
value String

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)

endpointNames string[]

The list of endpoints which will be enriched.

iothubName string
key string

The key of the enrichment.

resourceGroupName string
value string

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)

endpoint_names Sequence[str]

The list of endpoints which will be enriched.

iothub_name str
key str

The key of the enrichment.

resource_group_name str
value str

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)

endpointNames List<String>

The list of endpoints which will be enriched.

iothubName String
key String

The key of the enrichment.

resourceGroupName String
value String

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)

Outputs

All input properties are implicitly available as output properties. Additionally, the Enrichment resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up Existing Enrichment Resource

Get an existing Enrichment resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: EnrichmentState, opts?: CustomResourceOptions): Enrichment
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        endpoint_names: Optional[Sequence[str]] = None,
        iothub_name: Optional[str] = None,
        key: Optional[str] = None,
        resource_group_name: Optional[str] = None,
        value: Optional[str] = None) -> Enrichment
func GetEnrichment(ctx *Context, name string, id IDInput, state *EnrichmentState, opts ...ResourceOption) (*Enrichment, error)
public static Enrichment Get(string name, Input<string> id, EnrichmentState? state, CustomResourceOptions? opts = null)
public static Enrichment get(String name, Output<String> id, EnrichmentState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
EndpointNames List<string>

The list of endpoints which will be enriched.

IothubName string
Key string

The key of the enrichment.

ResourceGroupName string
Value string

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)

EndpointNames []string

The list of endpoints which will be enriched.

IothubName string
Key string

The key of the enrichment.

ResourceGroupName string
Value string

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)

endpointNames List<String>

The list of endpoints which will be enriched.

iothubName String
key String

The key of the enrichment.

resourceGroupName String
value String

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)

endpointNames string[]

The list of endpoints which will be enriched.

iothubName string
key string

The key of the enrichment.

resourceGroupName string
value string

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)

endpoint_names Sequence[str]

The list of endpoints which will be enriched.

iothub_name str
key str

The key of the enrichment.

resource_group_name str
value str

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)

endpointNames List<String>

The list of endpoints which will be enriched.

iothubName String
key String

The key of the enrichment.

resourceGroupName String
value String

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)

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

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes

This Pulumi package is based on the azurerm Terraform Provider.