import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Manages a ServiceBus Subscription Rule. * * ## Example Usage * * ### SQL Filter) * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azure from "@pulumi/azure"; * * const example = new azure.core.ResourceGroup("example", { * name: "tfex-servicebus-subscription-rule-sql", * location: "West Europe", * }); * const exampleNamespace = new azure.servicebus.Namespace("example", { * name: "tfex-servicebus-namespace", * location: example.location, * resourceGroupName: example.name, * sku: "Standard", * tags: { * source: "example", * }, * }); * const exampleTopic = new azure.servicebus.Topic("example", { * name: "tfex_servicebus_topic", * namespaceId: exampleNamespace.id, * enablePartitioning: true, * }); * const exampleSubscription = new azure.servicebus.Subscription("example", { * name: "tfex_servicebus_subscription", * topicId: exampleTopic.id, * maxDeliveryCount: 1, * }); * const exampleSubscriptionRule = new azure.servicebus.SubscriptionRule("example", { * name: "tfex_servicebus_rule", * subscriptionId: exampleSubscription.id, * filterType: "SqlFilter", * sqlFilter: "colour = 'red'", * }); * ``` * * ### Correlation Filter) * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azure from "@pulumi/azure"; * * const example = new azure.core.ResourceGroup("example", { * name: "tfex-servicebus-subscription-rule-cor", * location: "West Europe", * }); * const exampleNamespace = new azure.servicebus.Namespace("example", { * name: "tfex-servicebus-namespace", * location: example.location, * resourceGroupName: example.name, * sku: "Standard", * tags: { * source: "example", * }, * }); * const exampleTopic = new azure.servicebus.Topic("example", { * name: "tfex_servicebus_topic", * namespaceId: exampleNamespace.id, * enablePartitioning: true, * }); * const exampleSubscription = new azure.servicebus.Subscription("example", { * name: "tfex_servicebus_subscription", * topicId: exampleTopic.id, * maxDeliveryCount: 1, * }); * const exampleSubscriptionRule = new azure.servicebus.SubscriptionRule("example", { * name: "tfex_servicebus_rule", * subscriptionId: exampleSubscription.id, * filterType: "CorrelationFilter", * correlationFilter: { * correlationId: "high", * label: "red", * properties: { * customProperty: "value", * }, * }, * }); * ``` * * ## API Providers * * * This resource uses the following Azure API Providers: * * * `Microsoft.ServiceBus` - 2024-01-01 * * ## Import * * Service Bus Subscription Rule can be imported using the `resource id`, e.g. * * ```sh * $ pulumi import azure:eventhub/subscriptionRule:SubscriptionRule example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.ServiceBus/namespaces/sbns1/topics/sntopic1/subscriptions/sbsub1/rules/sbrule1 * ``` * * @deprecated azure.eventhub.SubscriptionRule has been deprecated in favor of azure.servicebus.SubscriptionRule */ export declare class SubscriptionRule extends pulumi.CustomResource { /** * Get an existing SubscriptionRule 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?: SubscriptionRuleState, opts?: pulumi.CustomResourceOptions): SubscriptionRule; /** * Returns true if the given object is an instance of SubscriptionRule. 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 SubscriptionRule; /** * Represents set of actions written in SQL language-based syntax that is performed against a BrokeredMessage. */ readonly action: pulumi.Output; /** * A `correlationFilter` block as documented below to be evaluated against a BrokeredMessage. Required when `filterType` is set to `CorrelationFilter`. */ readonly correlationFilter: pulumi.Output; /** * Type of filter to be applied to a BrokeredMessage. Possible values are `SqlFilter` and `CorrelationFilter`. */ readonly filterType: pulumi.Output; /** * Specifies the name of the ServiceBus Subscription Rule. Changing this forces a new resource to be created. */ readonly name: pulumi.Output; /** * Represents a filter written in SQL language-based syntax that to be evaluated against a BrokeredMessage. Required when `filterType` is set to `SqlFilter`. */ readonly sqlFilter: pulumi.Output; readonly sqlFilterCompatibilityLevel: pulumi.Output; /** * The ID of the ServiceBus Subscription in which this Rule should be created. Changing this forces a new resource to be created. */ readonly subscriptionId: pulumi.Output; /** * Create a SubscriptionRule 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. */ /** @deprecated azure.eventhub.SubscriptionRule has been deprecated in favor of azure.servicebus.SubscriptionRule */ constructor(name: string, args: SubscriptionRuleArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering SubscriptionRule resources. */ export interface SubscriptionRuleState { /** * Represents set of actions written in SQL language-based syntax that is performed against a BrokeredMessage. */ action?: pulumi.Input; /** * A `correlationFilter` block as documented below to be evaluated against a BrokeredMessage. Required when `filterType` is set to `CorrelationFilter`. */ correlationFilter?: pulumi.Input; /** * Type of filter to be applied to a BrokeredMessage. Possible values are `SqlFilter` and `CorrelationFilter`. */ filterType?: pulumi.Input; /** * Specifies the name of the ServiceBus Subscription Rule. Changing this forces a new resource to be created. */ name?: pulumi.Input; /** * Represents a filter written in SQL language-based syntax that to be evaluated against a BrokeredMessage. Required when `filterType` is set to `SqlFilter`. */ sqlFilter?: pulumi.Input; sqlFilterCompatibilityLevel?: pulumi.Input; /** * The ID of the ServiceBus Subscription in which this Rule should be created. Changing this forces a new resource to be created. */ subscriptionId?: pulumi.Input; } /** * The set of arguments for constructing a SubscriptionRule resource. */ export interface SubscriptionRuleArgs { /** * Represents set of actions written in SQL language-based syntax that is performed against a BrokeredMessage. */ action?: pulumi.Input; /** * A `correlationFilter` block as documented below to be evaluated against a BrokeredMessage. Required when `filterType` is set to `CorrelationFilter`. */ correlationFilter?: pulumi.Input; /** * Type of filter to be applied to a BrokeredMessage. Possible values are `SqlFilter` and `CorrelationFilter`. */ filterType: pulumi.Input; /** * Specifies the name of the ServiceBus Subscription Rule. Changing this forces a new resource to be created. */ name?: pulumi.Input; /** * Represents a filter written in SQL language-based syntax that to be evaluated against a BrokeredMessage. Required when `filterType` is set to `SqlFilter`. */ sqlFilter?: pulumi.Input; /** * The ID of the ServiceBus Subscription in which this Rule should be created. Changing this forces a new resource to be created. */ subscriptionId: pulumi.Input; }