import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Manages an IotHub * * > **Note:** Endpoints can be defined either directly on the `azure.iot.IoTHub` resource, or using the `azurerm_iothub_endpoint_*` resources - but the two ways of defining the endpoints cannot be used together. If both are used against the same IoTHub, spurious changes will occur. Also, defining a `azurerm_iothub_endpoint_*` resource and another endpoint of a different type directly on the `azure.iot.IoTHub` resource is not supported. * * > **Note:** Routes can be defined either directly on the `azure.iot.IoTHub` resource, or using the `azure.iot.Route` resource - but the two cannot be used together. If both are used against the same IoTHub, spurious changes will occur. * * > **Note:** Enrichments can be defined either directly on the `azure.iot.IoTHub` resource, or using the `azure.iot.Enrichment` resource - but the two cannot be used together. If both are used against the same IoTHub, spurious changes will occur. * * > **Note:** Fallback route can be defined either directly on the `azure.iot.IoTHub` resource, or using the `azure.iot.FallbackRoute` resource - but the two cannot be used together. If both are used against the same IoTHub, spurious changes will occur. * * > **Note:** File upload can be defined either directly on the `azure.iot.IoTHub` resource, or using the `azure.iot.FileUpload` resource - but the two cannot be used together. If both are used against the same IoTHub, spurious changes will occur. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azure from "@pulumi/azure"; * * const example = new azure.core.ResourceGroup("example", { * name: "example-resources", * location: "West Europe", * }); * const exampleAccount = new azure.storage.Account("example", { * name: "examplestorage", * resourceGroupName: example.name, * location: example.location, * accountTier: "Standard", * accountReplicationType: "LRS", * }); * const exampleContainer = new azure.storage.Container("example", { * name: "examplecontainer", * storageAccountName: exampleAccount.name, * containerAccessType: "private", * }); * const exampleEventHubNamespace = new azure.eventhub.EventHubNamespace("example", { * name: "example-namespace", * resourceGroupName: example.name, * location: example.location, * sku: "Basic", * }); * const exampleEventHub = new azure.eventhub.EventHub("example", { * name: "example-eventhub", * namespaceId: exampleEventHubNamespace.id, * partitionCount: 2, * messageRetention: 1, * }); * const exampleAuthorizationRule = new azure.eventhub.AuthorizationRule("example", { * resourceGroupName: example.name, * namespaceName: exampleEventHubNamespace.name, * eventhubName: exampleEventHub.name, * name: "acctest", * send: true, * }); * const exampleIoTHub = new azure.iot.IoTHub("example", { * name: "Example-IoTHub", * resourceGroupName: example.name, * location: example.location, * localAuthenticationEnabled: false, * sku: { * name: "S1", * capacity: 1, * }, * endpoints: [ * { * type: "AzureIotHub.StorageContainer", * connectionString: exampleAccount.primaryBlobConnectionString, * name: "export", * batchFrequencyInSeconds: 60, * maxChunkSizeInBytes: 10485760, * containerName: exampleContainer.name, * encoding: "Avro", * fileNameFormat: "{iothub}/{partition}_{YYYY}_{MM}_{DD}_{HH}_{mm}", * }, * { * type: "AzureIotHub.EventHub", * connectionString: exampleAuthorizationRule.primaryConnectionString, * name: "export2", * }, * ], * routes: [ * { * name: "export", * source: "DeviceMessages", * condition: "true", * endpointNames: ["export"], * enabled: true, * }, * { * name: "export2", * source: "DeviceMessages", * condition: "true", * endpointNames: ["export2"], * enabled: true, * }, * ], * enrichments: [{ * key: "tenant", * value: "$twin.tags.Tenant", * endpointNames: [ * "export", * "export2", * ], * }], * cloudToDevice: { * maxDeliveryCount: 30, * defaultTtl: "PT1H", * feedbacks: [{ * timeToLive: "PT1H10M", * maxDeliveryCount: 15, * lockDuration: "PT30S", * }], * }, * tags: { * purpose: "testing", * }, * }); * ``` * * ## Import * * IoTHubs can be imported using the `resource id`, e.g. * * ```sh * $ pulumi import azure:iot/ioTHub:IoTHub hub1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Devices/iotHubs/hub1 * ``` */ export declare class IoTHub extends pulumi.CustomResource { /** * Get an existing IoTHub resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: IoTHubState, opts?: pulumi.CustomResourceOptions): IoTHub; /** * Returns true if the given object is an instance of IoTHub. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is IoTHub; readonly cloudToDevice: pulumi.Output; /** * An `endpoint` block as defined below. */ readonly endpoints: pulumi.Output; readonly enrichments: pulumi.Output; /** * The EventHub compatible endpoint for events data */ readonly eventHubEventsEndpoint: pulumi.Output; /** * The EventHub namespace for events data */ readonly eventHubEventsNamespace: pulumi.Output; /** * The EventHub compatible path for events data */ readonly eventHubEventsPath: pulumi.Output; /** * The EventHub compatible endpoint for operational data */ readonly eventHubOperationsEndpoint: pulumi.Output; /** * The EventHub compatible path for operational data */ readonly eventHubOperationsPath: pulumi.Output; /** * The number of device-to-cloud partitions used by backing event hubs. Must be between `2` and `128`. Defaults to `4`. */ readonly eventHubPartitionCount: pulumi.Output; /** * The event hub retention to use in days. Must be between `1` and `7`. Defaults to `1`. */ readonly eventHubRetentionInDays: pulumi.Output; /** * A `fallbackRoute` block as defined below. If the fallback route is enabled, messages that don't match any of the supplied routes are automatically sent to this route. Defaults to messages/events. * * > **Note:** If `fallbackRoute` isn't explicitly specified, the fallback route wouldn't be enabled by default. */ readonly fallbackRoute: pulumi.Output; /** * A `fileUpload` block as defined below. */ readonly fileUpload: pulumi.Output; /** * The hostname of the IotHub Resource. */ readonly hostname: pulumi.Output; /** * An `identity` block as defined below. */ readonly identity: pulumi.Output; /** * If false, SAS tokens with Iot hub scoped SAS keys cannot be used for authentication. Defaults to `true`. */ readonly localAuthenticationEnabled: pulumi.Output; /** * Specifies the supported Azure location where the resource has to be created. Changing this forces a new resource to be created. */ readonly location: pulumi.Output; readonly minTlsVersion: pulumi.Output; /** * Specifies the name of the IotHub resource. Changing this forces a new resource to be created. */ readonly name: pulumi.Output; /** * A `networkRuleSet` block as defined below. */ readonly networkRuleSets: pulumi.Output; readonly publicNetworkAccessEnabled: pulumi.Output; /** * The name of the resource group under which the IotHub resource has to be created. Changing this forces a new resource to be created. */ readonly resourceGroupName: pulumi.Output; readonly routes: pulumi.Output; /** * One or more `sharedAccessPolicy` blocks as defined below. */ readonly sharedAccessPolicies: pulumi.Output; /** * A `sku` block as defined below. */ readonly sku: pulumi.Output; readonly tags: pulumi.Output<{ [key: string]: string; } | undefined>; readonly type: pulumi.Output; /** * Create a IoTHub resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: IoTHubArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering IoTHub resources. */ export interface IoTHubState { cloudToDevice?: pulumi.Input; /** * An `endpoint` block as defined below. */ endpoints?: pulumi.Input[]>; enrichments?: pulumi.Input[]>; /** * The EventHub compatible endpoint for events data */ eventHubEventsEndpoint?: pulumi.Input; /** * The EventHub namespace for events data */ eventHubEventsNamespace?: pulumi.Input; /** * The EventHub compatible path for events data */ eventHubEventsPath?: pulumi.Input; /** * The EventHub compatible endpoint for operational data */ eventHubOperationsEndpoint?: pulumi.Input; /** * The EventHub compatible path for operational data */ eventHubOperationsPath?: pulumi.Input; /** * The number of device-to-cloud partitions used by backing event hubs. Must be between `2` and `128`. Defaults to `4`. */ eventHubPartitionCount?: pulumi.Input; /** * The event hub retention to use in days. Must be between `1` and `7`. Defaults to `1`. */ eventHubRetentionInDays?: pulumi.Input; /** * A `fallbackRoute` block as defined below. If the fallback route is enabled, messages that don't match any of the supplied routes are automatically sent to this route. Defaults to messages/events. * * > **Note:** If `fallbackRoute` isn't explicitly specified, the fallback route wouldn't be enabled by default. */ fallbackRoute?: pulumi.Input; /** * A `fileUpload` block as defined below. */ fileUpload?: pulumi.Input; /** * The hostname of the IotHub Resource. */ hostname?: pulumi.Input; /** * An `identity` block as defined below. */ identity?: pulumi.Input; /** * If false, SAS tokens with Iot hub scoped SAS keys cannot be used for authentication. Defaults to `true`. */ localAuthenticationEnabled?: pulumi.Input; /** * Specifies the supported Azure location where the resource has to be created. Changing this forces a new resource to be created. */ location?: pulumi.Input; minTlsVersion?: pulumi.Input; /** * Specifies the name of the IotHub resource. Changing this forces a new resource to be created. */ name?: pulumi.Input; /** * A `networkRuleSet` block as defined below. */ networkRuleSets?: pulumi.Input[]>; publicNetworkAccessEnabled?: pulumi.Input; /** * The name of the resource group under which the IotHub resource has to be created. Changing this forces a new resource to be created. */ resourceGroupName?: pulumi.Input; routes?: pulumi.Input[]>; /** * One or more `sharedAccessPolicy` blocks as defined below. */ sharedAccessPolicies?: pulumi.Input[]>; /** * A `sku` block as defined below. */ sku?: pulumi.Input; tags?: pulumi.Input<{ [key: string]: pulumi.Input; }>; type?: pulumi.Input; } /** * The set of arguments for constructing a IoTHub resource. */ export interface IoTHubArgs { cloudToDevice?: pulumi.Input; /** * An `endpoint` block as defined below. */ endpoints?: pulumi.Input[]>; enrichments?: pulumi.Input[]>; /** * The number of device-to-cloud partitions used by backing event hubs. Must be between `2` and `128`. Defaults to `4`. */ eventHubPartitionCount?: pulumi.Input; /** * The event hub retention to use in days. Must be between `1` and `7`. Defaults to `1`. */ eventHubRetentionInDays?: pulumi.Input; /** * A `fallbackRoute` block as defined below. If the fallback route is enabled, messages that don't match any of the supplied routes are automatically sent to this route. Defaults to messages/events. * * > **Note:** If `fallbackRoute` isn't explicitly specified, the fallback route wouldn't be enabled by default. */ fallbackRoute?: pulumi.Input; /** * A `fileUpload` block as defined below. */ fileUpload?: pulumi.Input; /** * An `identity` block as defined below. */ identity?: pulumi.Input; /** * If false, SAS tokens with Iot hub scoped SAS keys cannot be used for authentication. Defaults to `true`. */ localAuthenticationEnabled?: pulumi.Input; /** * Specifies the supported Azure location where the resource has to be created. Changing this forces a new resource to be created. */ location?: pulumi.Input; minTlsVersion?: pulumi.Input; /** * Specifies the name of the IotHub resource. Changing this forces a new resource to be created. */ name?: pulumi.Input; /** * A `networkRuleSet` block as defined below. */ networkRuleSets?: pulumi.Input[]>; publicNetworkAccessEnabled?: pulumi.Input; /** * The name of the resource group under which the IotHub resource has to be created. Changing this forces a new resource to be created. */ resourceGroupName: pulumi.Input; routes?: pulumi.Input[]>; /** * A `sku` block as defined below. */ sku: pulumi.Input; tags?: pulumi.Input<{ [key: string]: pulumi.Input; }>; }