FallbackRoute

Manages an IotHub Fallback Route

Disclaimers

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: Since this resource is provisioned by default, the Azure Provider will not check for the presence of an existing resource prior to attempting to create it.

Example Usage

using Pulumi;
using Azure = Pulumi.Azure;

class MyStack : Stack
{
    public MyStack()
    {
        var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new Azure.Core.ResourceGroupArgs
        {
            Location = "West US",
        });
        var exampleAccount = new Azure.Storage.Account("exampleAccount", new Azure.Storage.AccountArgs
        {
            ResourceGroupName = exampleResourceGroup.Name,
            Location = exampleResourceGroup.Location,
            AccountTier = "Standard",
            AccountReplicationType = "LRS",
        });
        var exampleContainer = new Azure.Storage.Container("exampleContainer", new Azure.Storage.ContainerArgs
        {
            StorageAccountName = exampleAccount.Name,
            ContainerAccessType = "private",
        });
        var exampleIoTHub = new Azure.Iot.IoTHub("exampleIoTHub", new Azure.Iot.IoTHubArgs
        {
            ResourceGroupName = exampleResourceGroup.Name,
            Location = exampleResourceGroup.Location,
            Sku = new Azure.Iot.Inputs.IoTHubSkuArgs
            {
                Name = "S1",
                Capacity = 1,
            },
            Tags = 
            {
                { "purpose", "testing" },
            },
        });
        var exampleEndpointStorageContainer = new Azure.Iot.EndpointStorageContainer("exampleEndpointStorageContainer", new Azure.Iot.EndpointStorageContainerArgs
        {
            ResourceGroupName = exampleResourceGroup.Name,
            IothubName = exampleIoTHub.Name,
            ConnectionString = exampleAccount.PrimaryBlobConnectionString,
            BatchFrequencyInSeconds = 60,
            MaxChunkSizeInBytes = 10485760,
            ContainerName = exampleContainer.Name,
            Encoding = "Avro",
            FileNameFormat = "{iothub}/{partition}_{YYYY}_{MM}_{DD}_{HH}_{mm}",
        });
        var exampleFallbackRoute = new Azure.Iot.FallbackRoute("exampleFallbackRoute", new Azure.Iot.FallbackRouteArgs
        {
            ResourceGroupName = exampleResourceGroup.Name,
            IothubName = exampleIoTHub.Name,
            Condition = "true",
            EndpointNames = 
            {
                exampleEndpointStorageContainer.Name,
            },
            Enabled = true,
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/core"
    "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/iot"
    "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/storage"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
            Location: pulumi.String("West US"),
        })
        if err != nil {
            return err
        }
        exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{
            ResourceGroupName:      exampleResourceGroup.Name,
            Location:               exampleResourceGroup.Location,
            AccountTier:            pulumi.String("Standard"),
            AccountReplicationType: pulumi.String("LRS"),
        })
        if err != nil {
            return err
        }
        exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{
            StorageAccountName:  exampleAccount.Name,
            ContainerAccessType: pulumi.String("private"),
        })
        if err != nil {
            return err
        }
        exampleIoTHub, err := iot.NewIoTHub(ctx, "exampleIoTHub", &iot.IoTHubArgs{
            ResourceGroupName: exampleResourceGroup.Name,
            Location:          exampleResourceGroup.Location,
            Sku: &iot.IoTHubSkuArgs{
                Name:     pulumi.String("S1"),
                Capacity: pulumi.Int(1),
            },
            Tags: pulumi.Map{
                "purpose": pulumi.String("testing"),
            },
        })
        if err != nil {
            return err
        }
        exampleEndpointStorageContainer, err := iot.NewEndpointStorageContainer(ctx, "exampleEndpointStorageContainer", &iot.EndpointStorageContainerArgs{
            ResourceGroupName:       exampleResourceGroup.Name,
            IothubName:              exampleIoTHub.Name,
            ConnectionString:        exampleAccount.PrimaryBlobConnectionString,
            BatchFrequencyInSeconds: pulumi.Int(60),
            MaxChunkSizeInBytes:     pulumi.Int(10485760),
            ContainerName:           exampleContainer.Name,
            Encoding:                pulumi.String("Avro"),
            FileNameFormat:          pulumi.String("{iothub}/{partition}_{YYYY}_{MM}_{DD}_{HH}_{mm}"),
        })
        if err != nil {
            return err
        }
        _, err = iot.NewFallbackRoute(ctx, "exampleFallbackRoute", &iot.FallbackRouteArgs{
            ResourceGroupName: exampleResourceGroup.Name,
            IothubName:        exampleIoTHub.Name,
            Condition:         pulumi.String("true"),
            EndpointNames: pulumi.String(pulumi.String{
                exampleEndpointStorageContainer.Name,
            }),
            Enabled: pulumi.Bool(true),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_azure as azure

example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West US")
example_account = azure.storage.Account("exampleAccount",
    resource_group_name=example_resource_group.name,
    location=example_resource_group.location,
    account_tier="Standard",
    account_replication_type="LRS")
example_container = azure.storage.Container("exampleContainer",
    storage_account_name=example_account.name,
    container_access_type="private")
example_io_t_hub = azure.iot.IoTHub("exampleIoTHub",
    resource_group_name=example_resource_group.name,
    location=example_resource_group.location,
    sku={
        "name": "S1",
        "capacity": "1",
    },
    tags={
        "purpose": "testing",
    })
example_endpoint_storage_container = azure.iot.EndpointStorageContainer("exampleEndpointStorageContainer",
    resource_group_name=example_resource_group.name,
    iothub_name=example_io_t_hub.name,
    connection_string=example_account.primary_blob_connection_string,
    batch_frequency_in_seconds=60,
    max_chunk_size_in_bytes=10485760,
    container_name=example_container.name,
    encoding="Avro",
    file_name_format="{iothub}/{partition}_{YYYY}_{MM}_{DD}_{HH}_{mm}")
example_fallback_route = azure.iot.FallbackRoute("exampleFallbackRoute",
    resource_group_name=example_resource_group.name,
    iothub_name=example_io_t_hub.name,
    condition="true",
    endpoint_names=[example_endpoint_storage_container.name],
    enabled=True)
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West US"});
const exampleAccount = new azure.storage.Account("exampleAccount", {
    resourceGroupName: exampleResourceGroup.name,
    location: exampleResourceGroup.location,
    accountTier: "Standard",
    accountReplicationType: "LRS",
});
const exampleContainer = new azure.storage.Container("exampleContainer", {
    storageAccountName: exampleAccount.name,
    containerAccessType: "private",
});
const exampleIoTHub = new azure.iot.IoTHub("exampleIoTHub", {
    resourceGroupName: exampleResourceGroup.name,
    location: exampleResourceGroup.location,
    sku: {
        name: "S1",
        capacity: "1",
    },
    tags: {
        purpose: "testing",
    },
});
const exampleEndpointStorageContainer = new azure.iot.EndpointStorageContainer("exampleEndpointStorageContainer", {
    resourceGroupName: exampleResourceGroup.name,
    iothubName: exampleIoTHub.name,
    connectionString: exampleAccount.primaryBlobConnectionString,
    batchFrequencyInSeconds: 60,
    maxChunkSizeInBytes: 10485760,
    containerName: exampleContainer.name,
    encoding: "Avro",
    fileNameFormat: "{iothub}/{partition}_{YYYY}_{MM}_{DD}_{HH}_{mm}",
});
const exampleFallbackRoute = new azure.iot.FallbackRoute("exampleFallbackRoute", {
    resourceGroupName: exampleResourceGroup.name,
    iothubName: exampleIoTHub.name,
    condition: "true",
    endpointNames: [exampleEndpointStorageContainer.name],
    enabled: true,
});

Create a FallbackRoute Resource

def FallbackRoute(resource_name, opts=None, condition=None, enabled=None, endpoint_names=None, iothub_name=None, resource_group_name=None, __props__=None);
name string
The unique name of the resource.
args FallbackRouteArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args FallbackRouteArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args FallbackRouteArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

FallbackRoute Resource Properties

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

Inputs

The FallbackRoute resource accepts the following input properties:

Enabled bool

Used to specify whether the fallback route is enabled.

EndpointNames string

The endpoints to which messages that satisfy the condition are routed. Currently only 1 endpoint is allowed.

IothubName string

The name of the IoTHub to which this Fallback Route belongs. Changing this forces a new resource to be created.

ResourceGroupName string

The name of the resource group under which the IotHub Storage Container Endpoint resource has to be created. Changing this forces a new resource to be created.

Condition string

The condition that is evaluated to apply the routing rule. If no condition is provided, it evaluates to true by default. For grammar, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language.

Enabled bool

Used to specify whether the fallback route is enabled.

EndpointNames string

The endpoints to which messages that satisfy the condition are routed. Currently only 1 endpoint is allowed.

IothubName string

The name of the IoTHub to which this Fallback Route belongs. Changing this forces a new resource to be created.

ResourceGroupName string

The name of the resource group under which the IotHub Storage Container Endpoint resource has to be created. Changing this forces a new resource to be created.

Condition string

The condition that is evaluated to apply the routing rule. If no condition is provided, it evaluates to true by default. For grammar, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language.

enabled boolean

Used to specify whether the fallback route is enabled.

endpointNames string

The endpoints to which messages that satisfy the condition are routed. Currently only 1 endpoint is allowed.

iothubName string

The name of the IoTHub to which this Fallback Route belongs. Changing this forces a new resource to be created.

resourceGroupName string

The name of the resource group under which the IotHub Storage Container Endpoint resource has to be created. Changing this forces a new resource to be created.

condition string

The condition that is evaluated to apply the routing rule. If no condition is provided, it evaluates to true by default. For grammar, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language.

enabled bool

Used to specify whether the fallback route is enabled.

endpoint_names str

The endpoints to which messages that satisfy the condition are routed. Currently only 1 endpoint is allowed.

iothub_name str

The name of the IoTHub to which this Fallback Route belongs. Changing this forces a new resource to be created.

resource_group_name str

The name of the resource group under which the IotHub Storage Container Endpoint resource has to be created. Changing this forces a new resource to be created.

condition str

The condition that is evaluated to apply the routing rule. If no condition is provided, it evaluates to true by default. For grammar, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language.

Outputs

All input properties are implicitly available as output properties. Additionally, the FallbackRoute 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 str
The provider-assigned unique ID for this managed resource.

Look up an Existing FallbackRoute Resource

Get an existing FallbackRoute 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?: FallbackRouteState, opts?: CustomResourceOptions): FallbackRoute
static get(resource_name, id, opts=None, condition=None, enabled=None, endpoint_names=None, iothub_name=None, resource_group_name=None, __props__=None);
func GetFallbackRoute(ctx *Context, name string, id IDInput, state *FallbackRouteState, opts ...ResourceOption) (*FallbackRoute, error)
public static FallbackRoute Get(string name, Input<string> id, FallbackRouteState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

Condition string

The condition that is evaluated to apply the routing rule. If no condition is provided, it evaluates to true by default. For grammar, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language.

Enabled bool

Used to specify whether the fallback route is enabled.

EndpointNames string

The endpoints to which messages that satisfy the condition are routed. Currently only 1 endpoint is allowed.

IothubName string

The name of the IoTHub to which this Fallback Route belongs. Changing this forces a new resource to be created.

ResourceGroupName string

The name of the resource group under which the IotHub Storage Container Endpoint resource has to be created. Changing this forces a new resource to be created.

Condition string

The condition that is evaluated to apply the routing rule. If no condition is provided, it evaluates to true by default. For grammar, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language.

Enabled bool

Used to specify whether the fallback route is enabled.

EndpointNames string

The endpoints to which messages that satisfy the condition are routed. Currently only 1 endpoint is allowed.

IothubName string

The name of the IoTHub to which this Fallback Route belongs. Changing this forces a new resource to be created.

ResourceGroupName string

The name of the resource group under which the IotHub Storage Container Endpoint resource has to be created. Changing this forces a new resource to be created.

condition string

The condition that is evaluated to apply the routing rule. If no condition is provided, it evaluates to true by default. For grammar, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language.

enabled boolean

Used to specify whether the fallback route is enabled.

endpointNames string

The endpoints to which messages that satisfy the condition are routed. Currently only 1 endpoint is allowed.

iothubName string

The name of the IoTHub to which this Fallback Route belongs. Changing this forces a new resource to be created.

resourceGroupName string

The name of the resource group under which the IotHub Storage Container Endpoint resource has to be created. Changing this forces a new resource to be created.

condition str

The condition that is evaluated to apply the routing rule. If no condition is provided, it evaluates to true by default. For grammar, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language.

enabled bool

Used to specify whether the fallback route is enabled.

endpoint_names str

The endpoints to which messages that satisfy the condition are routed. Currently only 1 endpoint is allowed.

iothub_name str

The name of the IoTHub to which this Fallback Route belongs. Changing this forces a new resource to be created.

resource_group_name str

The name of the resource group under which the IotHub Storage Container Endpoint resource has to be created. Changing this forces a new resource to be created.

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.