IotHubResourceArgs

data class IotHubResourceArgs(val identity: Output<ArmIdentityArgs>? = null, val location: Output<String>? = null, val properties: Output<IotHubPropertiesArgs>? = null, val resourceGroupName: Output<String>? = null, val resourceName: Output<String>? = null, val sku: Output<IotHubSkuInfoArgs>? = null, val tags: Output<Map<String, String>>? = null) : ConvertibleToJava<IotHubResourceArgs>

The description of the IoT hub. Uses Azure REST API version 2022-04-30-preview. In version 1.x of the Azure Native provider, it used API version 2020-08-31. Other available API versions: 2022-11-15-preview, 2023-06-30, 2023-06-30-preview.

Example Usage

IotHubResource_CreateOrUpdate

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var iotHubResource = new AzureNative.Devices.IotHubResource("iotHubResource", new()
{
Location = "centraluseuap",
Properties = new AzureNative.Devices.Inputs.IotHubPropertiesArgs
{
CloudToDevice = new AzureNative.Devices.Inputs.CloudToDevicePropertiesArgs
{
DefaultTtlAsIso8601 = "PT1H",
Feedback = new AzureNative.Devices.Inputs.FeedbackPropertiesArgs
{
LockDurationAsIso8601 = "PT1M",
MaxDeliveryCount = 10,
TtlAsIso8601 = "PT1H",
},
MaxDeliveryCount = 10,
},
EnableDataResidency = true,
EnableFileUploadNotifications = false,
EventHubEndpoints =
{
{ "events", new AzureNative.Devices.Inputs.EventHubPropertiesArgs
{
PartitionCount = 2,
RetentionTimeInDays = 1,
} },
},
Features = AzureNative.Devices.Capabilities.None,
IpFilterRules = new() { },
MessagingEndpoints =
{
{ "fileNotifications", new AzureNative.Devices.Inputs.MessagingEndpointPropertiesArgs
{
LockDurationAsIso8601 = "PT1M",
MaxDeliveryCount = 10,
TtlAsIso8601 = "PT1H",
} },
},
MinTlsVersion = "1.2",
NetworkRuleSets = new AzureNative.Devices.Inputs.NetworkRuleSetPropertiesArgs
{
ApplyToBuiltInEventHubEndpoint = true,
DefaultAction = AzureNative.Devices.DefaultAction.Deny,
IpRules = new[]
{
new AzureNative.Devices.Inputs.NetworkRuleSetIpRuleArgs
{
Action = AzureNative.Devices.NetworkRuleIPAction.Allow,
FilterName = "rule1",
IpMask = "131.117.159.53",
},
new AzureNative.Devices.Inputs.NetworkRuleSetIpRuleArgs
{
Action = AzureNative.Devices.NetworkRuleIPAction.Allow,
FilterName = "rule2",
IpMask = "157.55.59.128/25",
},
},
},
RootCertificate = new AzureNative.Devices.Inputs.RootCertificatePropertiesArgs
{
EnableRootCertificateV2 = true,
},
Routing = new AzureNative.Devices.Inputs.RoutingPropertiesArgs
{
Endpoints = new AzureNative.Devices.Inputs.RoutingEndpointsArgs
{
EventHubs = new() { },
ServiceBusQueues = new() { },
ServiceBusTopics = new() { },
StorageContainers = new() { },
},
FallbackRoute = new AzureNative.Devices.Inputs.FallbackRoutePropertiesArgs
{
Condition = "true",
EndpointNames = new[]
{
"events",
},
IsEnabled = true,
Name = "$fallback",
Source = AzureNative.Devices.RoutingSource.DeviceMessages,
},
Routes = new() { },
},
StorageEndpoints =
{
{ "$default", new AzureNative.Devices.Inputs.StorageEndpointPropertiesArgs
{
ConnectionString = "",
ContainerName = "",
SasTtlAsIso8601 = "PT1H",
} },
},
},
ResourceGroupName = "myResourceGroup",
ResourceName = "testHub",
Sku = new AzureNative.Devices.Inputs.IotHubSkuInfoArgs
{
Capacity = 1,
Name = AzureNative.Devices.IotHubSku.S1,
},
Tags = null,
});
});
package main
import (
devices "github.com/pulumi/pulumi-azure-native-sdk/devices/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := devices.NewIotHubResource(ctx, "iotHubResource", &devices.IotHubResourceArgs{
Location: pulumi.String("centraluseuap"),
Properties: &devices.IotHubPropertiesArgs{
CloudToDevice: &devices.CloudToDevicePropertiesArgs{
DefaultTtlAsIso8601: pulumi.String("PT1H"),
Feedback: &devices.FeedbackPropertiesArgs{
LockDurationAsIso8601: pulumi.String("PT1M"),
MaxDeliveryCount: pulumi.Int(10),
TtlAsIso8601: pulumi.String("PT1H"),
},
MaxDeliveryCount: pulumi.Int(10),
},
EnableDataResidency: pulumi.Bool(true),
EnableFileUploadNotifications: pulumi.Bool(false),
EventHubEndpoints: devices.EventHubPropertiesMap{
"events": &devices.EventHubPropertiesArgs{
PartitionCount: pulumi.Int(2),
RetentionTimeInDays: pulumi.Float64(1),
},
},
Features: pulumi.String(devices.CapabilitiesNone),
IpFilterRules: devices.IpFilterRuleArray{},
MessagingEndpoints: devices.MessagingEndpointPropertiesMap{
"fileNotifications": &devices.MessagingEndpointPropertiesArgs{
LockDurationAsIso8601: pulumi.String("PT1M"),
MaxDeliveryCount: pulumi.Int(10),
TtlAsIso8601: pulumi.String("PT1H"),
},
},
MinTlsVersion: pulumi.String("1.2"),
NetworkRuleSets: &devices.NetworkRuleSetPropertiesArgs{
ApplyToBuiltInEventHubEndpoint: pulumi.Bool(true),
DefaultAction: pulumi.String(devices.DefaultActionDeny),
IpRules: devices.NetworkRuleSetIpRuleArray{
&devices.NetworkRuleSetIpRuleArgs{
Action: pulumi.String(devices.NetworkRuleIPActionAllow),
FilterName: pulumi.String("rule1"),
IpMask: pulumi.String("131.117.159.53"),
},
&devices.NetworkRuleSetIpRuleArgs{
Action: pulumi.String(devices.NetworkRuleIPActionAllow),
FilterName: pulumi.String("rule2"),
IpMask: pulumi.String("157.55.59.128/25"),
},
},
},
RootCertificate: &devices.RootCertificatePropertiesArgs{
EnableRootCertificateV2: pulumi.Bool(true),
},
Routing: &devices.RoutingPropertiesArgs{
Endpoints: &devices.RoutingEndpointsArgs{
EventHubs: devices.RoutingEventHubPropertiesArray{},
ServiceBusQueues: devices.RoutingServiceBusQueueEndpointPropertiesArray{},
ServiceBusTopics: devices.RoutingServiceBusTopicEndpointPropertiesArray{},
StorageContainers: devices.RoutingStorageContainerPropertiesArray{},
},
FallbackRoute: &devices.FallbackRoutePropertiesArgs{
Condition: pulumi.String("true"),
EndpointNames: pulumi.StringArray{
pulumi.String("events"),
},
IsEnabled: pulumi.Bool(true),
Name: pulumi.String("$fallback"),
Source: pulumi.String(devices.RoutingSourceDeviceMessages),
},
Routes: devices.RoutePropertiesArray{},
},
StorageEndpoints: devices.StorageEndpointPropertiesMap{
"$default": &devices.StorageEndpointPropertiesArgs{
ConnectionString: pulumi.String(""),
ContainerName: pulumi.String(""),
SasTtlAsIso8601: pulumi.String("PT1H"),
},
},
},
ResourceGroupName: pulumi.String("myResourceGroup"),
ResourceName: pulumi.String("testHub"),
Sku: &devices.IotHubSkuInfoArgs{
Capacity: pulumi.Float64(1),
Name: pulumi.String(devices.IotHubSkuS1),
},
Tags: pulumi.StringMap{},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.devices.IotHubResource;
import com.pulumi.azurenative.devices.IotHubResourceArgs;
import com.pulumi.azurenative.devices.inputs.IotHubPropertiesArgs;
import com.pulumi.azurenative.devices.inputs.CloudToDevicePropertiesArgs;
import com.pulumi.azurenative.devices.inputs.FeedbackPropertiesArgs;
import com.pulumi.azurenative.devices.inputs.NetworkRuleSetPropertiesArgs;
import com.pulumi.azurenative.devices.inputs.RootCertificatePropertiesArgs;
import com.pulumi.azurenative.devices.inputs.RoutingPropertiesArgs;
import com.pulumi.azurenative.devices.inputs.RoutingEndpointsArgs;
import com.pulumi.azurenative.devices.inputs.FallbackRoutePropertiesArgs;
import com.pulumi.azurenative.devices.inputs.IotHubSkuInfoArgs;
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 iotHubResource = new IotHubResource("iotHubResource", IotHubResourceArgs.builder()
.location("centraluseuap")
.properties(IotHubPropertiesArgs.builder()
.cloudToDevice(CloudToDevicePropertiesArgs.builder()
.defaultTtlAsIso8601("PT1H")
.feedback(FeedbackPropertiesArgs.builder()
.lockDurationAsIso8601("PT1M")
.maxDeliveryCount(10)
.ttlAsIso8601("PT1H")
.build())
.maxDeliveryCount(10)
.build())
.enableDataResidency(true)
.enableFileUploadNotifications(false)
.eventHubEndpoints(Map.of("events", Map.ofEntries(
Map.entry("partitionCount", 2),
Map.entry("retentionTimeInDays", 1)
)))
.features("None")
.ipFilterRules()
.messagingEndpoints(Map.of("fileNotifications", Map.ofEntries(
Map.entry("lockDurationAsIso8601", "PT1M"),
Map.entry("maxDeliveryCount", 10),
Map.entry("ttlAsIso8601", "PT1H")
)))
.minTlsVersion("1.2")
.networkRuleSets(NetworkRuleSetPropertiesArgs.builder()
.applyToBuiltInEventHubEndpoint(true)
.defaultAction("Deny")
.ipRules(
NetworkRuleSetIpRuleArgs.builder()
.action("Allow")
.filterName("rule1")
.ipMask("131.117.159.53")
.build(),
NetworkRuleSetIpRuleArgs.builder()
.action("Allow")
.filterName("rule2")
.ipMask("157.55.59.128/25")
.build())
.build())
.rootCertificate(RootCertificatePropertiesArgs.builder()
.enableRootCertificateV2(true)
.build())
.routing(RoutingPropertiesArgs.builder()
.endpoints(RoutingEndpointsArgs.builder()
.eventHubs()
.serviceBusQueues()
.serviceBusTopics()
.storageContainers()
.build())
.fallbackRoute(FallbackRoutePropertiesArgs.builder()
.condition("true")
.endpointNames("events")
.isEnabled(true)
.name("$fallback")
.source("DeviceMessages")
.build())
.routes()
.build())
.storageEndpoints(Map.of("$default", Map.ofEntries(
Map.entry("connectionString", ""),
Map.entry("containerName", ""),
Map.entry("sasTtlAsIso8601", "PT1H")
)))
.build())
.resourceGroupName("myResourceGroup")
.resourceName("testHub")
.sku(IotHubSkuInfoArgs.builder()
.capacity(1)
.name("S1")
.build())
.tags()
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:devices:IotHubResource testHub /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}

Constructors

Link copied to clipboard
constructor(identity: Output<ArmIdentityArgs>? = null, location: Output<String>? = null, properties: Output<IotHubPropertiesArgs>? = null, resourceGroupName: Output<String>? = null, resourceName: Output<String>? = null, sku: Output<IotHubSkuInfoArgs>? = null, tags: Output<Map<String, String>>? = null)

Properties

Link copied to clipboard
val identity: Output<ArmIdentityArgs>? = null

The managed identities for the IotHub.

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

The resource location.

Link copied to clipboard
val properties: Output<IotHubPropertiesArgs>? = null

IotHub properties

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

The name of the resource group that contains the IoT hub.

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

The name of the IoT hub.

Link copied to clipboard
val sku: Output<IotHubSkuInfoArgs>? = null

IotHub SKU info

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

The resource tags.

Functions

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