We recommend using Azure Native.
azure.eventhub.SubscriptionRule
Manages a ServiceBus Subscription Rule.
Example Usage
SQL Filter)
Example coming soon!
Example coming soon!
Example coming soon!
Example coming soon!
Example coming soon!
resources:
  example:
    type: azure:core:ResourceGroup
    properties:
      name: tfex-servicebus-subscription-rule-sql
      location: West Europe
  exampleNamespace:
    type: azure:servicebus:Namespace
    name: example
    properties:
      name: tfex-servicebus-namespace
      location: ${example.location}
      resourceGroupName: ${example.name}
      sku: Standard
      tags:
        source: example
  exampleTopic:
    type: azure:servicebus:Topic
    name: example
    properties:
      name: tfex_servicebus_topic
      namespaceId: ${exampleNamespace.id}
      enablePartitioning: true
  exampleSubscription:
    type: azure:servicebus:Subscription
    name: example
    properties:
      name: tfex_servicebus_subscription
      topicId: ${exampleTopic.id}
      maxDeliveryCount: 1
  exampleSubscriptionRule:
    type: azure:servicebus:SubscriptionRule
    name: example
    properties:
      name: tfex_servicebus_rule
      subscriptionId: ${exampleSubscription.id}
      filterType: SqlFilter
      sqlFilter: colour = 'red'
Correlation Filter)
Example coming soon!
Example coming soon!
Example coming soon!
Example coming soon!
Example coming soon!
resources:
  example:
    type: azure:core:ResourceGroup
    properties:
      name: tfex-servicebus-subscription-rule-cor
      location: West Europe
  exampleNamespace:
    type: azure:servicebus:Namespace
    name: example
    properties:
      name: tfex-servicebus-namespace
      location: ${example.location}
      resourceGroupName: ${example.name}
      sku: Standard
      tags:
        source: example
  exampleTopic:
    type: azure:servicebus:Topic
    name: example
    properties:
      name: tfex_servicebus_topic
      namespaceId: ${exampleNamespace.id}
      enablePartitioning: true
  exampleSubscription:
    type: azure:servicebus:Subscription
    name: example
    properties:
      name: tfex_servicebus_subscription
      topicId: ${exampleTopic.id}
      maxDeliveryCount: 1
  exampleSubscriptionRule:
    type: azure:servicebus:SubscriptionRule
    name: example
    properties:
      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
Create SubscriptionRule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new SubscriptionRule(name: string, args: SubscriptionRuleArgs, opts?: CustomResourceOptions);@overload
def SubscriptionRule(resource_name: str,
                     args: SubscriptionRuleArgs,
                     opts: Optional[ResourceOptions] = None)
@overload
def SubscriptionRule(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     action: Optional[str] = None,
                     correlation_filter: Optional[SubscriptionRuleCorrelationFilterArgs] = None,
                     filter_type: Optional[str] = None,
                     name: Optional[str] = None,
                     sql_filter: Optional[str] = None,
                     subscription_id: Optional[str] = None)func NewSubscriptionRule(ctx *Context, name string, args SubscriptionRuleArgs, opts ...ResourceOption) (*SubscriptionRule, error)public SubscriptionRule(string name, SubscriptionRuleArgs args, CustomResourceOptions? opts = null)
public SubscriptionRule(String name, SubscriptionRuleArgs args)
public SubscriptionRule(String name, SubscriptionRuleArgs args, CustomResourceOptions options)
type: azure:eventhub:SubscriptionRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- 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.
- args SubscriptionRuleArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control 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.
- name String
- The unique name of the resource.
- args SubscriptionRuleArgs
- The arguments to resource properties.
- options 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 Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The SubscriptionRule resource accepts the following input properties:
- FilterType string
- Type of filter to be applied to a BrokeredMessage. Possible values are SqlFilterandCorrelationFilter.
- SubscriptionId string
- The ID of the ServiceBus Subscription in which this Rule should be created. 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.
- CorrelationFilter 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.
- SqlFilter string
- Represents a filter written in SQL language-based syntax that to be evaluated against a BrokeredMessage. Required when filter_typeis set toSqlFilter.
- FilterType string
- Type of filter to be applied to a BrokeredMessage. Possible values are SqlFilterandCorrelationFilter.
- SubscriptionId string
- The ID of the ServiceBus Subscription in which this Rule should be created. 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.
- CorrelationFilter 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.
- SqlFilter string
- Represents a filter written in SQL language-based syntax that to be evaluated against a BrokeredMessage. Required when filter_typeis set toSqlFilter.
- filterType String
- Type of filter to be applied to a BrokeredMessage. Possible values are SqlFilterandCorrelationFilter.
- subscriptionId String
- The ID of the ServiceBus Subscription in which this Rule should be created. 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.
- correlationFilter 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.
- sqlFilter String
- Represents a filter written in SQL language-based syntax that to be evaluated against a BrokeredMessage. Required when filter_typeis set toSqlFilter.
- filterType string
- Type of filter to be applied to a BrokeredMessage. Possible values are SqlFilterandCorrelationFilter.
- subscriptionId string
- The ID of the ServiceBus Subscription in which this Rule should be created. 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.
- correlationFilter 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.
- sqlFilter 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.
- subscription_id str
- The ID of the ServiceBus Subscription in which this Rule should be created. 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 SubscriptionRule Correlation Filter Args 
- 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.
- filterType String
- Type of filter to be applied to a BrokeredMessage. Possible values are SqlFilterandCorrelationFilter.
- subscriptionId String
- The ID of the ServiceBus Subscription in which this Rule should be created. 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.
- correlationFilter Property Map
- 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.
- sqlFilter String
- 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:
- Id string
- The provider-assigned unique ID for this managed resource.
- SqlFilter intCompatibility Level 
- Id string
- The provider-assigned unique ID for this managed resource.
- SqlFilter intCompatibility Level 
- id String
- The provider-assigned unique ID for this managed resource.
- sqlFilter IntegerCompatibility Level 
- id string
- The provider-assigned unique ID for this managed resource.
- sqlFilter numberCompatibility Level 
- id str
- The provider-assigned unique ID for this managed resource.
- sql_filter_ intcompatibility_ level 
- id String
- The provider-assigned unique ID for this managed resource.
- sqlFilter NumberCompatibility Level 
Look up 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): SubscriptionRule@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        action: Optional[str] = None,
        correlation_filter: Optional[SubscriptionRuleCorrelationFilterArgs] = None,
        filter_type: Optional[str] = None,
        name: Optional[str] = None,
        sql_filter: Optional[str] = None,
        sql_filter_compatibility_level: Optional[int] = None,
        subscription_id: Optional[str] = None) -> SubscriptionRulefunc 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)public static SubscriptionRule get(String name, Output<String> id, SubscriptionRuleState state, CustomResourceOptions options)resources:  _:    type: azure:eventhub:SubscriptionRule    get:      id: ${id}- 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.
- 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.
- Action string
- Represents set of actions written in SQL language-based syntax that is performed against a BrokeredMessage.
- CorrelationFilter SubscriptionRule Correlation Filter 
- A correlation_filterblock as documented below to be evaluated against a BrokeredMessage. Required whenfilter_typeis set toCorrelationFilter.
- FilterType 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.
- SqlFilter string
- Represents a filter written in SQL language-based syntax that to be evaluated against a BrokeredMessage. Required when filter_typeis set toSqlFilter.
- SqlFilter intCompatibility Level 
- SubscriptionId string
- The ID of the ServiceBus Subscription in which this Rule should be created. 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.
- CorrelationFilter SubscriptionRule Correlation Filter Args 
- A correlation_filterblock as documented below to be evaluated against a BrokeredMessage. Required whenfilter_typeis set toCorrelationFilter.
- FilterType 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.
- SqlFilter string
- Represents a filter written in SQL language-based syntax that to be evaluated against a BrokeredMessage. Required when filter_typeis set toSqlFilter.
- SqlFilter intCompatibility Level 
- SubscriptionId string
- The ID of the ServiceBus Subscription in which this Rule should be created. 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.
- correlationFilter SubscriptionRule Correlation Filter 
- A correlation_filterblock as documented below to be evaluated against a BrokeredMessage. Required whenfilter_typeis set toCorrelationFilter.
- filterType 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.
- sqlFilter String
- Represents a filter written in SQL language-based syntax that to be evaluated against a BrokeredMessage. Required when filter_typeis set toSqlFilter.
- sqlFilter IntegerCompatibility Level 
- subscriptionId String
- The ID of the ServiceBus Subscription in which this Rule should be created. 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.
- correlationFilter SubscriptionRule Correlation Filter 
- A correlation_filterblock as documented below to be evaluated against a BrokeredMessage. Required whenfilter_typeis set toCorrelationFilter.
- filterType 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.
- sqlFilter string
- Represents a filter written in SQL language-based syntax that to be evaluated against a BrokeredMessage. Required when filter_typeis set toSqlFilter.
- sqlFilter numberCompatibility Level 
- subscriptionId string
- The ID of the ServiceBus Subscription in which this Rule should be created. 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 SubscriptionRule Correlation Filter Args 
- 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.
- 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.
- sql_filter_ intcompatibility_ level 
- subscription_id str
- The ID of the ServiceBus Subscription in which this Rule should be created. 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.
- correlationFilter Property Map
- A correlation_filterblock as documented below to be evaluated against a BrokeredMessage. Required whenfilter_typeis set toCorrelationFilter.
- filterType 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.
- sqlFilter String
- Represents a filter written in SQL language-based syntax that to be evaluated against a BrokeredMessage. Required when filter_typeis set toSqlFilter.
- sqlFilter NumberCompatibility Level 
- subscriptionId String
- The ID of the ServiceBus Subscription in which this Rule should be created. Changing this forces a new resource to be created.
Supporting Types
SubscriptionRuleCorrelationFilter, SubscriptionRuleCorrelationFilterArgs        
- ContentType string
- Content type of the message.
- CorrelationId string
- Identifier of the correlation.
- Label string
- Application specific label.
- MessageId string
- Identifier of the message.
- Properties Dictionary<string, string>
- A list of user defined properties to be included in the filter. Specified as a map of name/value pairs. - Note: When creating a subscription rule of type - CorrelationFilterat least one property must be set in the- correlation_filterblock.
- ReplyTo string
- Address of the queue to reply to.
- ReplyTo stringSession Id 
- Session identifier to reply to.
- SessionId string
- Session identifier.
- To string
- Address to send to.
- ContentType string
- Content type of the message.
- CorrelationId string
- Identifier of the correlation.
- Label string
- Application specific label.
- MessageId string
- Identifier of the message.
- Properties map[string]string
- A list of user defined properties to be included in the filter. Specified as a map of name/value pairs. - Note: When creating a subscription rule of type - CorrelationFilterat least one property must be set in the- correlation_filterblock.
- ReplyTo string
- Address of the queue to reply to.
- ReplyTo stringSession Id 
- Session identifier to reply to.
- SessionId string
- Session identifier.
- To string
- Address to send to.
- contentType String
- Content type of the message.
- correlationId String
- Identifier of the correlation.
- label String
- Application specific label.
- messageId String
- Identifier of the message.
- properties Map<String,String>
- A list of user defined properties to be included in the filter. Specified as a map of name/value pairs. - Note: When creating a subscription rule of type - CorrelationFilterat least one property must be set in the- correlation_filterblock.
- replyTo String
- Address of the queue to reply to.
- replyTo StringSession Id 
- Session identifier to reply to.
- sessionId String
- Session identifier.
- to String
- Address to send to.
- contentType string
- Content type of the message.
- correlationId string
- Identifier of the correlation.
- label string
- Application specific label.
- messageId string
- Identifier of the message.
- properties {[key: string]: string}
- A list of user defined properties to be included in the filter. Specified as a map of name/value pairs. - Note: When creating a subscription rule of type - CorrelationFilterat least one property must be set in the- correlation_filterblock.
- replyTo string
- Address of the queue to reply to.
- replyTo stringSession Id 
- Session identifier to reply to.
- sessionId 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.
- properties Mapping[str, str]
- A list of user defined properties to be included in the filter. Specified as a map of name/value pairs. - Note: When creating a subscription rule of type - CorrelationFilterat least one property must be set in the- correlation_filterblock.
- 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.
- contentType String
- Content type of the message.
- correlationId String
- Identifier of the correlation.
- label String
- Application specific label.
- messageId String
- Identifier of the message.
- properties Map<String>
- A list of user defined properties to be included in the filter. Specified as a map of name/value pairs. - Note: When creating a subscription rule of type - CorrelationFilterat least one property must be set in the- correlation_filterblock.
- replyTo String
- Address of the queue to reply to.
- replyTo StringSession Id 
- Session identifier to reply to.
- sessionId String
- Session identifier.
- to String
- Address to send to.
Import
Service Bus Subscription Rule can be imported using the resource id, e.g.
$ 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
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the azurermTerraform Provider.
