We recommend using Azure Native.
azure.iot.Enrichment
Explore with Pulumi AI
Manages an IotHub Enrichment
NOTE: Enrichment can be defined either directly on the
azure.iot.IoTHub
resource, or using theazure.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:
- Endpoint
Names List<string> The list of endpoints which will be enriched.
- Iothub
Name string The IoTHub name of the enrichment. Changing this forces a new resource to be created.
- Key string
The key of the enrichment. Changing this forces a new resource to be created.
- Resource
Group stringName The name of the resource group under which the IoTHub resource is created. Changing this forces a new resource to be created.
- 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 []string The list of endpoints which will be enriched.
- Iothub
Name string The IoTHub name of the enrichment. Changing this forces a new resource to be created.
- Key string
The key of the enrichment. Changing this forces a new resource to be created.
- Resource
Group stringName The name of the resource group under which the IoTHub resource is created. Changing this forces a new resource to be created.
- 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 List<String> The list of endpoints which will be enriched.
- iothub
Name String The IoTHub name of the enrichment. Changing this forces a new resource to be created.
- key String
The key of the enrichment. Changing this forces a new resource to be created.
- resource
Group StringName The name of the resource group under which the IoTHub resource is created. Changing this forces a new resource to be created.
- 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 string[] The list of endpoints which will be enriched.
- iothub
Name string The IoTHub name of the enrichment. Changing this forces a new resource to be created.
- key string
The key of the enrichment. Changing this forces a new resource to be created.
- resource
Group stringName The name of the resource group under which the IoTHub resource is created. Changing this forces a new resource to be created.
- 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 The IoTHub name of the enrichment. Changing this forces a new resource to be created.
- key str
The key of the enrichment. Changing this forces a new resource to be created.
- resource_
group_ strname The name of the resource group under which the IoTHub resource is created. Changing this forces a new resource to be created.
- 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
)
- endpoint
Names List<String> The list of endpoints which will be enriched.
- iothub
Name String The IoTHub name of the enrichment. Changing this forces a new resource to be created.
- key String
The key of the enrichment. Changing this forces a new resource to be created.
- resource
Group StringName The name of the resource group under which the IoTHub resource is created. Changing this forces a new resource to be created.
- 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.
- Endpoint
Names List<string> The list of endpoints which will be enriched.
- Iothub
Name string The IoTHub name of the enrichment. Changing this forces a new resource to be created.
- Key string
The key of the enrichment. Changing this forces a new resource to be created.
- Resource
Group stringName The name of the resource group under which the IoTHub resource is created. Changing this forces a new resource to be created.
- 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 []string The list of endpoints which will be enriched.
- Iothub
Name string The IoTHub name of the enrichment. Changing this forces a new resource to be created.
- Key string
The key of the enrichment. Changing this forces a new resource to be created.
- Resource
Group stringName The name of the resource group under which the IoTHub resource is created. Changing this forces a new resource to be created.
- 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 List<String> The list of endpoints which will be enriched.
- iothub
Name String The IoTHub name of the enrichment. Changing this forces a new resource to be created.
- key String
The key of the enrichment. Changing this forces a new resource to be created.
- resource
Group StringName The name of the resource group under which the IoTHub resource is created. Changing this forces a new resource to be created.
- 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 string[] The list of endpoints which will be enriched.
- iothub
Name string The IoTHub name of the enrichment. Changing this forces a new resource to be created.
- key string
The key of the enrichment. Changing this forces a new resource to be created.
- resource
Group stringName The name of the resource group under which the IoTHub resource is created. Changing this forces a new resource to be created.
- 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 The IoTHub name of the enrichment. Changing this forces a new resource to be created.
- key str
The key of the enrichment. Changing this forces a new resource to be created.
- resource_
group_ strname The name of the resource group under which the IoTHub resource is created. Changing this forces a new resource to be created.
- 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
)
- endpoint
Names List<String> The list of endpoints which will be enriched.
- iothub
Name String The IoTHub name of the enrichment. Changing this forces a new resource to be created.
- key String
The key of the enrichment. Changing this forces a new resource to be created.
- resource
Group StringName The name of the resource group under which the IoTHub resource is created. Changing this forces a new resource to be created.
- 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
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
azurerm
Terraform Provider.