SubscriptionRule
Manages a ServiceBus Subscription Rule.
Example Usage
SQL Filter)
using Pulumi;
using Azure = Pulumi.Azure;
class MyStack : Stack
{
public MyStack()
{
var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new Azure.Core.ResourceGroupArgs
{
Location = "West Europe",
});
var exampleNamespace = new Azure.ServiceBus.Namespace("exampleNamespace", new Azure.ServiceBus.NamespaceArgs
{
Location = exampleResourceGroup.Location,
ResourceGroupName = exampleResourceGroup.Name,
Sku = "Standard",
Tags =
{
{ "source", "example" },
},
});
var exampleTopic = new Azure.ServiceBus.Topic("exampleTopic", new Azure.ServiceBus.TopicArgs
{
ResourceGroupName = exampleResourceGroup.Name,
NamespaceName = exampleNamespace.Name,
EnablePartitioning = true,
});
var exampleSubscription = new Azure.ServiceBus.Subscription("exampleSubscription", new Azure.ServiceBus.SubscriptionArgs
{
ResourceGroupName = exampleResourceGroup.Name,
NamespaceName = exampleNamespace.Name,
TopicName = exampleTopic.Name,
MaxDeliveryCount = 1,
});
var exampleSubscriptionRule = new Azure.ServiceBus.SubscriptionRule("exampleSubscriptionRule", new Azure.ServiceBus.SubscriptionRuleArgs
{
ResourceGroupName = exampleResourceGroup.Name,
NamespaceName = exampleNamespace.Name,
TopicName = exampleTopic.Name,
SubscriptionName = exampleSubscription.Name,
FilterType = "SqlFilter",
SqlFilter = "colour = 'red'",
});
}
}
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v3/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v3/go/azure/servicebus"
"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 Europe"),
})
if err != nil {
return err
}
exampleNamespace, err := servicebus.NewNamespace(ctx, "exampleNamespace", &servicebus.NamespaceArgs{
Location: exampleResourceGroup.Location,
ResourceGroupName: exampleResourceGroup.Name,
Sku: pulumi.String("Standard"),
Tags: pulumi.Map{
"source": pulumi.String("example"),
},
})
if err != nil {
return err
}
exampleTopic, err := servicebus.NewTopic(ctx, "exampleTopic", &servicebus.TopicArgs{
ResourceGroupName: exampleResourceGroup.Name,
NamespaceName: exampleNamespace.Name,
EnablePartitioning: pulumi.Bool(true),
})
if err != nil {
return err
}
exampleSubscription, err := servicebus.NewSubscription(ctx, "exampleSubscription", &servicebus.SubscriptionArgs{
ResourceGroupName: exampleResourceGroup.Name,
NamespaceName: exampleNamespace.Name,
TopicName: exampleTopic.Name,
MaxDeliveryCount: pulumi.Int(1),
})
if err != nil {
return err
}
_, err = servicebus.NewSubscriptionRule(ctx, "exampleSubscriptionRule", &servicebus.SubscriptionRuleArgs{
ResourceGroupName: exampleResourceGroup.Name,
NamespaceName: exampleNamespace.Name,
TopicName: exampleTopic.Name,
SubscriptionName: exampleSubscription.Name,
FilterType: pulumi.String("SqlFilter"),
SqlFilter: pulumi.String("colour = 'red'"),
})
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_azure as azure
example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_namespace = azure.servicebus.Namespace("exampleNamespace",
location=example_resource_group.location,
resource_group_name=example_resource_group.name,
sku="Standard",
tags={
"source": "example",
})
example_topic = azure.servicebus.Topic("exampleTopic",
resource_group_name=example_resource_group.name,
namespace_name=example_namespace.name,
enable_partitioning=True)
example_subscription = azure.servicebus.Subscription("exampleSubscription",
resource_group_name=example_resource_group.name,
namespace_name=example_namespace.name,
topic_name=example_topic.name,
max_delivery_count=1)
example_subscription_rule = azure.servicebus.SubscriptionRule("exampleSubscriptionRule",
resource_group_name=example_resource_group.name,
namespace_name=example_namespace.name,
topic_name=example_topic.name,
subscription_name=example_subscription.name,
filter_type="SqlFilter",
sql_filter="colour = 'red'")import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
const exampleNamespace = new azure.servicebus.Namespace("exampleNamespace", {
location: exampleResourceGroup.location,
resourceGroupName: exampleResourceGroup.name,
sku: "Standard",
tags: {
source: "example",
},
});
const exampleTopic = new azure.servicebus.Topic("exampleTopic", {
resourceGroupName: exampleResourceGroup.name,
namespaceName: exampleNamespace.name,
enablePartitioning: true,
});
const exampleSubscription = new azure.servicebus.Subscription("exampleSubscription", {
resourceGroupName: exampleResourceGroup.name,
namespaceName: exampleNamespace.name,
topicName: exampleTopic.name,
maxDeliveryCount: 1,
});
const exampleSubscriptionRule = new azure.servicebus.SubscriptionRule("exampleSubscriptionRule", {
resourceGroupName: exampleResourceGroup.name,
namespaceName: exampleNamespace.name,
topicName: exampleTopic.name,
subscriptionName: exampleSubscription.name,
filterType: "SqlFilter",
sqlFilter: "colour = 'red'",
});Deprecated: azure.eventhub.SubscriptionRule has been deprecated in favor of azure.servicebus.SubscriptionRule
Create a SubscriptionRule Resource
new SubscriptionRule(name: string, args: SubscriptionRuleArgs, opts?: CustomResourceOptions);def SubscriptionRule(resource_name, opts=None, action=None, correlation_filter=None, filter_type=None, name=None, namespace_name=None, resource_group_name=None, sql_filter=None, subscription_name=None, topic_name=None, __props__=None);func NewSubscriptionRule(ctx *Context, name string, args SubscriptionRuleArgs, opts ...ResourceOption) (*SubscriptionRule, error)public SubscriptionRule(string name, SubscriptionRuleArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args SubscriptionRuleArgs
- 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 SubscriptionRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SubscriptionRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
SubscriptionRule Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The SubscriptionRule resource accepts the following input properties:
- Filter
Type string Type of filter to be applied to a BrokeredMessage. Possible values are
SqlFilterandCorrelationFilter.- Namespace
Name string The name of the ServiceBus Namespace in which the ServiceBus Topic exists. Changing this forces a new resource to be created.
- Resource
Group stringName The name of the resource group in the ServiceBus Namespace exists. Changing this forces a new resource to be created.
- Subscription
Name string The name of the ServiceBus Subscription in which this Rule should be created. Changing this forces a new resource to be created.
- Topic
Name string The name of the ServiceBus Topic in which the ServiceBus Subscription exists. Changing this forces a new resource to be created.
- Action string
Represents set of actions written in SQL language-based syntax that is performed against a BrokeredMessage.
- Correlation
Filter SubscriptionRule Correlation Filter Args A
correlation_filterblock as documented below to be evaluated against a BrokeredMessage. Required whenfilter_typeis set toCorrelationFilter.- Name string
Specifies the name of the ServiceBus Subscription Rule. Changing this forces a new resource to be created.
- Sql
Filter string Represents a filter written in SQL language-based syntax that to be evaluated against a BrokeredMessage. Required when
filter_typeis set toSqlFilter.
- Filter
Type string Type of filter to be applied to a BrokeredMessage. Possible values are
SqlFilterandCorrelationFilter.- Namespace
Name string The name of the ServiceBus Namespace in which the ServiceBus Topic exists. Changing this forces a new resource to be created.
- Resource
Group stringName The name of the resource group in the ServiceBus Namespace exists. Changing this forces a new resource to be created.
- Subscription
Name string The name of the ServiceBus Subscription in which this Rule should be created. Changing this forces a new resource to be created.
- Topic
Name string The name of the ServiceBus Topic in which the ServiceBus Subscription exists. Changing this forces a new resource to be created.
- Action string
Represents set of actions written in SQL language-based syntax that is performed against a BrokeredMessage.
- Correlation
Filter SubscriptionRule Correlation Filter A
correlation_filterblock as documented below to be evaluated against a BrokeredMessage. Required whenfilter_typeis set toCorrelationFilter.- Name string
Specifies the name of the ServiceBus Subscription Rule. Changing this forces a new resource to be created.
- Sql
Filter string Represents a filter written in SQL language-based syntax that to be evaluated against a BrokeredMessage. Required when
filter_typeis set toSqlFilter.
- filter
Type string Type of filter to be applied to a BrokeredMessage. Possible values are
SqlFilterandCorrelationFilter.- namespace
Name string The name of the ServiceBus Namespace in which the ServiceBus Topic exists. Changing this forces a new resource to be created.
- resource
Group stringName The name of the resource group in the ServiceBus Namespace exists. Changing this forces a new resource to be created.
- subscription
Name string The name of the ServiceBus Subscription in which this Rule should be created. Changing this forces a new resource to be created.
- topic
Name string The name of the ServiceBus Topic in which the ServiceBus Subscription exists. Changing this forces a new resource to be created.
- action string
Represents set of actions written in SQL language-based syntax that is performed against a BrokeredMessage.
- correlation
Filter SubscriptionRule Correlation Filter A
correlation_filterblock as documented below to be evaluated against a BrokeredMessage. Required whenfilter_typeis set toCorrelationFilter.- name string
Specifies the name of the ServiceBus Subscription Rule. Changing this forces a new resource to be created.
- sql
Filter string Represents a filter written in SQL language-based syntax that to be evaluated against a BrokeredMessage. Required when
filter_typeis set toSqlFilter.
- filter_
type str Type of filter to be applied to a BrokeredMessage. Possible values are
SqlFilterandCorrelationFilter.- namespace_
name str The name of the ServiceBus Namespace in which the ServiceBus Topic exists. Changing this forces a new resource to be created.
- resource_
group_ strname The name of the resource group in the ServiceBus Namespace exists. Changing this forces a new resource to be created.
- subscription_
name str The name of the ServiceBus Subscription in which this Rule should be created. Changing this forces a new resource to be created.
- topic_
name str The name of the ServiceBus Topic in which the ServiceBus Subscription exists. Changing this forces a new resource to be created.
- action str
Represents set of actions written in SQL language-based syntax that is performed against a BrokeredMessage.
- correlation_
filter Dict[SubscriptionRule Correlation Filter] A
correlation_filterblock as documented below to be evaluated against a BrokeredMessage. Required whenfilter_typeis set toCorrelationFilter.- name str
Specifies the name of the ServiceBus Subscription Rule. Changing this forces a new resource to be created.
- sql_
filter str Represents a filter written in SQL language-based syntax that to be evaluated against a BrokeredMessage. Required when
filter_typeis set toSqlFilter.
Outputs
All input properties are implicitly available as output properties. Additionally, the SubscriptionRule resource produces the following output properties:
Look up an Existing SubscriptionRule Resource
Get an existing SubscriptionRule 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?: SubscriptionRuleState, opts?: CustomResourceOptions): SubscriptionRulestatic get(resource_name, id, opts=None, action=None, correlation_filter=None, filter_type=None, name=None, namespace_name=None, resource_group_name=None, sql_filter=None, subscription_name=None, topic_name=None, __props__=None);func GetSubscriptionRule(ctx *Context, name string, id IDInput, state *SubscriptionRuleState, opts ...ResourceOption) (*SubscriptionRule, error)public static SubscriptionRule Get(string name, Input<string> id, SubscriptionRuleState? 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:
- Action string
Represents set of actions written in SQL language-based syntax that is performed against a BrokeredMessage.
- Correlation
Filter SubscriptionRule Correlation Filter Args A
correlation_filterblock as documented below to be evaluated against a BrokeredMessage. Required whenfilter_typeis set toCorrelationFilter.- Filter
Type string Type of filter to be applied to a BrokeredMessage. Possible values are
SqlFilterandCorrelationFilter.- Name string
Specifies the name of the ServiceBus Subscription Rule. Changing this forces a new resource to be created.
- Namespace
Name string The name of the ServiceBus Namespace in which the ServiceBus Topic exists. Changing this forces a new resource to be created.
- Resource
Group stringName The name of the resource group in the ServiceBus Namespace exists. Changing this forces a new resource to be created.
- Sql
Filter string Represents a filter written in SQL language-based syntax that to be evaluated against a BrokeredMessage. Required when
filter_typeis set toSqlFilter.- Subscription
Name string The name of the ServiceBus Subscription in which this Rule should be created. Changing this forces a new resource to be created.
- Topic
Name string The name of the ServiceBus Topic in which the ServiceBus Subscription exists. Changing this forces a new resource to be created.
- Action string
Represents set of actions written in SQL language-based syntax that is performed against a BrokeredMessage.
- Correlation
Filter SubscriptionRule Correlation Filter A
correlation_filterblock as documented below to be evaluated against a BrokeredMessage. Required whenfilter_typeis set toCorrelationFilter.- Filter
Type string Type of filter to be applied to a BrokeredMessage. Possible values are
SqlFilterandCorrelationFilter.- Name string
Specifies the name of the ServiceBus Subscription Rule. Changing this forces a new resource to be created.
- Namespace
Name string The name of the ServiceBus Namespace in which the ServiceBus Topic exists. Changing this forces a new resource to be created.
- Resource
Group stringName The name of the resource group in the ServiceBus Namespace exists. Changing this forces a new resource to be created.
- Sql
Filter string Represents a filter written in SQL language-based syntax that to be evaluated against a BrokeredMessage. Required when
filter_typeis set toSqlFilter.- Subscription
Name string The name of the ServiceBus Subscription in which this Rule should be created. Changing this forces a new resource to be created.
- Topic
Name string The name of the ServiceBus Topic in which the ServiceBus Subscription exists. Changing this forces a new resource to be created.
- action string
Represents set of actions written in SQL language-based syntax that is performed against a BrokeredMessage.
- correlation
Filter SubscriptionRule Correlation Filter A
correlation_filterblock as documented below to be evaluated against a BrokeredMessage. Required whenfilter_typeis set toCorrelationFilter.- filter
Type string Type of filter to be applied to a BrokeredMessage. Possible values are
SqlFilterandCorrelationFilter.- name string
Specifies the name of the ServiceBus Subscription Rule. Changing this forces a new resource to be created.
- namespace
Name string The name of the ServiceBus Namespace in which the ServiceBus Topic exists. Changing this forces a new resource to be created.
- resource
Group stringName The name of the resource group in the ServiceBus Namespace exists. Changing this forces a new resource to be created.
- sql
Filter string Represents a filter written in SQL language-based syntax that to be evaluated against a BrokeredMessage. Required when
filter_typeis set toSqlFilter.- subscription
Name string The name of the ServiceBus Subscription in which this Rule should be created. Changing this forces a new resource to be created.
- topic
Name string The name of the ServiceBus Topic in which the ServiceBus Subscription exists. Changing this forces a new resource to be created.
- action str
Represents set of actions written in SQL language-based syntax that is performed against a BrokeredMessage.
- correlation_
filter Dict[SubscriptionRule Correlation Filter] A
correlation_filterblock as documented below to be evaluated against a BrokeredMessage. Required whenfilter_typeis set toCorrelationFilter.- filter_
type str Type of filter to be applied to a BrokeredMessage. Possible values are
SqlFilterandCorrelationFilter.- name str
Specifies the name of the ServiceBus Subscription Rule. Changing this forces a new resource to be created.
- namespace_
name str The name of the ServiceBus Namespace in which the ServiceBus Topic exists. Changing this forces a new resource to be created.
- resource_
group_ strname The name of the resource group in the ServiceBus Namespace exists. Changing this forces a new resource to be created.
- sql_
filter str Represents a filter written in SQL language-based syntax that to be evaluated against a BrokeredMessage. Required when
filter_typeis set toSqlFilter.- subscription_
name str The name of the ServiceBus Subscription in which this Rule should be created. Changing this forces a new resource to be created.
- topic_
name str The name of the ServiceBus Topic in which the ServiceBus Subscription exists. Changing this forces a new resource to be created.
Supporting Types
SubscriptionRuleCorrelationFilter
- Content
Type string Content type of the message.
- Correlation
Id string Identifier of the correlation.
- Label string
Application specific label.
- Message
Id string Identifier of the message.
- Reply
To string Address of the queue to reply to.
- Reply
To stringSession Id Session identifier to reply to.
- Session
Id string Session identifier.
- To string
Address to send to.
- Content
Type string Content type of the message.
- Correlation
Id string Identifier of the correlation.
- Label string
Application specific label.
- Message
Id string Identifier of the message.
- Reply
To string Address of the queue to reply to.
- Reply
To stringSession Id Session identifier to reply to.
- Session
Id string Session identifier.
- To string
Address to send to.
- content
Type string Content type of the message.
- correlation
Id string Identifier of the correlation.
- label string
Application specific label.
- message
Id string Identifier of the message.
- reply
To string Address of the queue to reply to.
- reply
To stringSession Id Session identifier to reply to.
- session
Id string Session identifier.
- to string
Address to send to.
- content_
type str Content type of the message.
- correlation
Id str Identifier of the correlation.
- label str
Application specific label.
- message
Id str Identifier of the message.
- reply
To str Address of the queue to reply to.
- reply
To strSession Id Session identifier to reply to.
- session
Id str Session identifier.
- to str
Address to send to.
Package Details
- Repository
- https://github.com/pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.