We recommend using Azure Native.
azure.servicebus.SubscriptionRule
Explore with Pulumi AI
Manages a ServiceBus Subscription Rule.
Example Usage
SQL Filter)
Coming soon!
Coming soon!
Coming soon!
Coming soon!
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)
Coming soon!
Coming soon!
Coming soon!
Coming soon!
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
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,
filter_type: Optional[str] = None,
subscription_id: Optional[str] = None,
action: Optional[str] = None,
correlation_filter: Optional[SubscriptionRuleCorrelationFilterArgs] = None,
name: Optional[str] = None,
sql_filter: 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:servicebus: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.
Constructor example
The following reference example uses placeholder values for all input properties.
var subscriptionRuleResource = new Azure.ServiceBus.SubscriptionRule("subscriptionRuleResource", new()
{
FilterType = "string",
SubscriptionId = "string",
Action = "string",
CorrelationFilter = new Azure.ServiceBus.Inputs.SubscriptionRuleCorrelationFilterArgs
{
ContentType = "string",
CorrelationId = "string",
Label = "string",
MessageId = "string",
Properties =
{
{ "string", "string" },
},
ReplyTo = "string",
ReplyToSessionId = "string",
SessionId = "string",
To = "string",
},
Name = "string",
SqlFilter = "string",
});
example, err := servicebus.NewSubscriptionRule(ctx, "subscriptionRuleResource", &servicebus.SubscriptionRuleArgs{
FilterType: pulumi.String("string"),
SubscriptionId: pulumi.String("string"),
Action: pulumi.String("string"),
CorrelationFilter: &servicebus.SubscriptionRuleCorrelationFilterArgs{
ContentType: pulumi.String("string"),
CorrelationId: pulumi.String("string"),
Label: pulumi.String("string"),
MessageId: pulumi.String("string"),
Properties: pulumi.StringMap{
"string": pulumi.String("string"),
},
ReplyTo: pulumi.String("string"),
ReplyToSessionId: pulumi.String("string"),
SessionId: pulumi.String("string"),
To: pulumi.String("string"),
},
Name: pulumi.String("string"),
SqlFilter: pulumi.String("string"),
})
var subscriptionRuleResource = new SubscriptionRule("subscriptionRuleResource", SubscriptionRuleArgs.builder()
.filterType("string")
.subscriptionId("string")
.action("string")
.correlationFilter(SubscriptionRuleCorrelationFilterArgs.builder()
.contentType("string")
.correlationId("string")
.label("string")
.messageId("string")
.properties(Map.of("string", "string"))
.replyTo("string")
.replyToSessionId("string")
.sessionId("string")
.to("string")
.build())
.name("string")
.sqlFilter("string")
.build());
subscription_rule_resource = azure.servicebus.SubscriptionRule("subscriptionRuleResource",
filter_type="string",
subscription_id="string",
action="string",
correlation_filter={
"content_type": "string",
"correlation_id": "string",
"label": "string",
"message_id": "string",
"properties": {
"string": "string",
},
"reply_to": "string",
"reply_to_session_id": "string",
"session_id": "string",
"to": "string",
},
name="string",
sql_filter="string")
const subscriptionRuleResource = new azure.servicebus.SubscriptionRule("subscriptionRuleResource", {
filterType: "string",
subscriptionId: "string",
action: "string",
correlationFilter: {
contentType: "string",
correlationId: "string",
label: "string",
messageId: "string",
properties: {
string: "string",
},
replyTo: "string",
replyToSessionId: "string",
sessionId: "string",
to: "string",
},
name: "string",
sqlFilter: "string",
});
type: azure:servicebus:SubscriptionRule
properties:
action: string
correlationFilter:
contentType: string
correlationId: string
label: string
messageId: string
properties:
string: string
replyTo: string
replyToSessionId: string
sessionId: string
to: string
filterType: string
name: string
sqlFilter: string
subscriptionId: string
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:
- Filter
Type string - Type of filter to be applied to a BrokeredMessage. Possible values are
SqlFilter
andCorrelationFilter
. - Subscription
Id 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.
- Correlation
Filter SubscriptionRule Correlation Filter - A
correlation_filter
block as documented below to be evaluated against a BrokeredMessage. Required whenfilter_type
is 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_type
is set toSqlFilter
.
- Filter
Type string - Type of filter to be applied to a BrokeredMessage. Possible values are
SqlFilter
andCorrelationFilter
. - Subscription
Id 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.
- Correlation
Filter SubscriptionRule Correlation Filter Args - A
correlation_filter
block as documented below to be evaluated against a BrokeredMessage. Required whenfilter_type
is 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_type
is set toSqlFilter
.
- filter
Type String - Type of filter to be applied to a BrokeredMessage. Possible values are
SqlFilter
andCorrelationFilter
. - subscription
Id 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.
- correlation
Filter SubscriptionRule Correlation Filter - A
correlation_filter
block as documented below to be evaluated against a BrokeredMessage. Required whenfilter_type
is 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_type
is set toSqlFilter
.
- filter
Type string - Type of filter to be applied to a BrokeredMessage. Possible values are
SqlFilter
andCorrelationFilter
. - subscription
Id 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.
- correlation
Filter SubscriptionRule Correlation Filter - A
correlation_filter
block as documented below to be evaluated against a BrokeredMessage. Required whenfilter_type
is 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_type
is set toSqlFilter
.
- filter_
type str - Type of filter to be applied to a BrokeredMessage. Possible values are
SqlFilter
andCorrelationFilter
. - 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_filter
block as documented below to be evaluated against a BrokeredMessage. Required whenfilter_type
is 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_type
is set toSqlFilter
.
- filter
Type String - Type of filter to be applied to a BrokeredMessage. Possible values are
SqlFilter
andCorrelationFilter
. - subscription
Id 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.
- correlation
Filter Property Map - A
correlation_filter
block as documented below to be evaluated against a BrokeredMessage. Required whenfilter_type
is 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_type
is 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.
- Sql
Filter intCompatibility Level
- Id string
- The provider-assigned unique ID for this managed resource.
- Sql
Filter intCompatibility Level
- id String
- The provider-assigned unique ID for this managed resource.
- sql
Filter IntegerCompatibility Level
- id string
- The provider-assigned unique ID for this managed resource.
- sql
Filter 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.
- sql
Filter 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) -> SubscriptionRule
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)
public static SubscriptionRule get(String name, Output<String> id, SubscriptionRuleState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- Correlation
Filter SubscriptionRule Correlation Filter - A
correlation_filter
block as documented below to be evaluated against a BrokeredMessage. Required whenfilter_type
is set toCorrelationFilter
. - Filter
Type string - Type of filter to be applied to a BrokeredMessage. Possible values are
SqlFilter
andCorrelationFilter
. - 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_type
is set toSqlFilter
. - Sql
Filter intCompatibility Level - Subscription
Id 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.
- Correlation
Filter SubscriptionRule Correlation Filter Args - A
correlation_filter
block as documented below to be evaluated against a BrokeredMessage. Required whenfilter_type
is set toCorrelationFilter
. - Filter
Type string - Type of filter to be applied to a BrokeredMessage. Possible values are
SqlFilter
andCorrelationFilter
. - 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_type
is set toSqlFilter
. - Sql
Filter intCompatibility Level - Subscription
Id 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.
- correlation
Filter SubscriptionRule Correlation Filter - A
correlation_filter
block as documented below to be evaluated against a BrokeredMessage. Required whenfilter_type
is set toCorrelationFilter
. - filter
Type String - Type of filter to be applied to a BrokeredMessage. Possible values are
SqlFilter
andCorrelationFilter
. - 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_type
is set toSqlFilter
. - sql
Filter IntegerCompatibility Level - subscription
Id 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.
- correlation
Filter SubscriptionRule Correlation Filter - A
correlation_filter
block as documented below to be evaluated against a BrokeredMessage. Required whenfilter_type
is set toCorrelationFilter
. - filter
Type string - Type of filter to be applied to a BrokeredMessage. Possible values are
SqlFilter
andCorrelationFilter
. - 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_type
is set toSqlFilter
. - sql
Filter numberCompatibility Level - subscription
Id 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_filter
block as documented below to be evaluated against a BrokeredMessage. Required whenfilter_type
is set toCorrelationFilter
. - filter_
type str - Type of filter to be applied to a BrokeredMessage. Possible values are
SqlFilter
andCorrelationFilter
. - 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_type
is 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.
- correlation
Filter Property Map - A
correlation_filter
block as documented below to be evaluated against a BrokeredMessage. Required whenfilter_type
is set toCorrelationFilter
. - filter
Type String - Type of filter to be applied to a BrokeredMessage. Possible values are
SqlFilter
andCorrelationFilter
. - 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_type
is set toSqlFilter
. - sql
Filter NumberCompatibility Level - subscription
Id 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
- 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.
- 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
CorrelationFilter
at least one property must be set in thecorrelation_filter
block.- 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.
- 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
CorrelationFilter
at least one property must be set in thecorrelation_filter
block.- 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.
- 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
CorrelationFilter
at least one property must be set in thecorrelation_filter
block.- 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.
- 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
CorrelationFilter
at least one property must be set in thecorrelation_filter
block.- 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.
- 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
CorrelationFilter
at least one property must be set in thecorrelation_filter
block.- 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.
- 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.
- 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
CorrelationFilter
at least one property must be set in thecorrelation_filter
block.- 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.
Import
Service Bus Subscription Rule can be imported using the resource id
, e.g.
$ pulumi import azure:servicebus/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
azurerm
Terraform Provider.