Subscription
Manages a ServiceBus Subscription.
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 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,
});
}
}
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
}
_, 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
}
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)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,
});Deprecated: azure.eventhub.Subscription has been deprecated in favor of azure.servicebus.Subscription
Create a Subscription Resource
new Subscription(name: string, args: SubscriptionArgs, opts?: CustomResourceOptions);def Subscription(resource_name, opts=None, auto_delete_on_idle=None, dead_lettering_on_message_expiration=None, default_message_ttl=None, enable_batched_operations=None, forward_dead_lettered_messages_to=None, forward_to=None, lock_duration=None, max_delivery_count=None, name=None, namespace_name=None, requires_session=None, resource_group_name=None, topic_name=None, __props__=None);func NewSubscription(ctx *Context, name string, args SubscriptionArgs, opts ...ResourceOption) (*Subscription, error)public Subscription(string name, SubscriptionArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args SubscriptionArgs
- 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 SubscriptionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SubscriptionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
Subscription Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The Subscription resource accepts the following input properties:
- Max
Delivery intCount The maximum number of deliveries.
- Namespace
Name string The name of the ServiceBus Namespace to create this Subscription in. Changing this forces a new resource to be created.
- Resource
Group stringName The name of the resource group in which to create the namespace. Changing this forces a new resource to be created.
- Topic
Name string The name of the ServiceBus Topic to create this Subscription in. Changing this forces a new resource to be created.
- Auto
Delete stringOn Idle The idle interval after which the topic is automatically deleted as an ISO 8601 duration. The minimum duration is
5minutes orP5M.- Dead
Lettering boolOn Message Expiration Boolean flag which controls whether the Subscription has dead letter support when a message expires. Defaults to
false.- Default
Message stringTtl The Default message timespan to live as an ISO 8601 duration. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself.
- Enable
Batched boolOperations Boolean flag which controls whether the Subscription supports batched operations. Defaults to
false.- Forward
Dead stringLettered Messages To The name of a Queue or Topic to automatically forward Dead Letter messages to.
- Forward
To string The name of a Queue or Topic to automatically forward messages to.
- Lock
Duration string The lock duration for the subscription as an ISO 8601 duration. The default value is
1minute orP1M.- Name string
Specifies the name of the ServiceBus Subscription resource. Changing this forces a new resource to be created.
- Requires
Session bool Boolean flag which controls whether this Subscription supports the concept of a session. Defaults to
false. Changing this forces a new resource to be created.
- Max
Delivery intCount The maximum number of deliveries.
- Namespace
Name string The name of the ServiceBus Namespace to create this Subscription in. Changing this forces a new resource to be created.
- Resource
Group stringName The name of the resource group in which to create the namespace. Changing this forces a new resource to be created.
- Topic
Name string The name of the ServiceBus Topic to create this Subscription in. Changing this forces a new resource to be created.
- Auto
Delete stringOn Idle The idle interval after which the topic is automatically deleted as an ISO 8601 duration. The minimum duration is
5minutes orP5M.- Dead
Lettering boolOn Message Expiration Boolean flag which controls whether the Subscription has dead letter support when a message expires. Defaults to
false.- Default
Message stringTtl The Default message timespan to live as an ISO 8601 duration. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself.
- Enable
Batched boolOperations Boolean flag which controls whether the Subscription supports batched operations. Defaults to
false.- Forward
Dead stringLettered Messages To The name of a Queue or Topic to automatically forward Dead Letter messages to.
- Forward
To string The name of a Queue or Topic to automatically forward messages to.
- Lock
Duration string The lock duration for the subscription as an ISO 8601 duration. The default value is
1minute orP1M.- Name string
Specifies the name of the ServiceBus Subscription resource. Changing this forces a new resource to be created.
- Requires
Session bool Boolean flag which controls whether this Subscription supports the concept of a session. Defaults to
false. Changing this forces a new resource to be created.
- max
Delivery numberCount The maximum number of deliveries.
- namespace
Name string The name of the ServiceBus Namespace to create this Subscription in. Changing this forces a new resource to be created.
- resource
Group stringName The name of the resource group in which to create the namespace. Changing this forces a new resource to be created.
- topic
Name string The name of the ServiceBus Topic to create this Subscription in. Changing this forces a new resource to be created.
- auto
Delete stringOn Idle The idle interval after which the topic is automatically deleted as an ISO 8601 duration. The minimum duration is
5minutes orP5M.- dead
Lettering booleanOn Message Expiration Boolean flag which controls whether the Subscription has dead letter support when a message expires. Defaults to
false.- default
Message stringTtl The Default message timespan to live as an ISO 8601 duration. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself.
- enable
Batched booleanOperations Boolean flag which controls whether the Subscription supports batched operations. Defaults to
false.- forward
Dead stringLettered Messages To The name of a Queue or Topic to automatically forward Dead Letter messages to.
- forward
To string The name of a Queue or Topic to automatically forward messages to.
- lock
Duration string The lock duration for the subscription as an ISO 8601 duration. The default value is
1minute orP1M.- name string
Specifies the name of the ServiceBus Subscription resource. Changing this forces a new resource to be created.
- requires
Session boolean Boolean flag which controls whether this Subscription supports the concept of a session. Defaults to
false. Changing this forces a new resource to be created.
- max_
delivery_ floatcount The maximum number of deliveries.
- namespace_
name str The name of the ServiceBus Namespace to create this Subscription in. Changing this forces a new resource to be created.
- resource_
group_ strname The name of the resource group in which to create the namespace. Changing this forces a new resource to be created.
- topic_
name str The name of the ServiceBus Topic to create this Subscription in. Changing this forces a new resource to be created.
- auto_
delete_ stron_ idle The idle interval after which the topic is automatically deleted as an ISO 8601 duration. The minimum duration is
5minutes orP5M.- dead_
lettering_ boolon_ message_ expiration Boolean flag which controls whether the Subscription has dead letter support when a message expires. Defaults to
false.- default_
message_ strttl The Default message timespan to live as an ISO 8601 duration. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself.
- enable_
batched_ booloperations Boolean flag which controls whether the Subscription supports batched operations. Defaults to
false.- forward_
dead_ strlettered_ messages_ to The name of a Queue or Topic to automatically forward Dead Letter messages to.
- forward_
to str The name of a Queue or Topic to automatically forward messages to.
- lock_
duration str The lock duration for the subscription as an ISO 8601 duration. The default value is
1minute orP1M.- name str
Specifies the name of the ServiceBus Subscription resource. Changing this forces a new resource to be created.
- requires_
session bool Boolean flag which controls whether this Subscription supports the concept of a session. Defaults to
false. Changing this forces a new resource to be created.
Outputs
All input properties are implicitly available as output properties. Additionally, the Subscription resource produces the following output properties:
Look up an Existing Subscription Resource
Get an existing Subscription 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?: SubscriptionState, opts?: CustomResourceOptions): Subscriptionstatic get(resource_name, id, opts=None, auto_delete_on_idle=None, dead_lettering_on_message_expiration=None, default_message_ttl=None, enable_batched_operations=None, forward_dead_lettered_messages_to=None, forward_to=None, lock_duration=None, max_delivery_count=None, name=None, namespace_name=None, requires_session=None, resource_group_name=None, topic_name=None, __props__=None);func GetSubscription(ctx *Context, name string, id IDInput, state *SubscriptionState, opts ...ResourceOption) (*Subscription, error)public static Subscription Get(string name, Input<string> id, SubscriptionState? 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:
- Auto
Delete stringOn Idle The idle interval after which the topic is automatically deleted as an ISO 8601 duration. The minimum duration is
5minutes orP5M.- Dead
Lettering boolOn Message Expiration Boolean flag which controls whether the Subscription has dead letter support when a message expires. Defaults to
false.- Default
Message stringTtl The Default message timespan to live as an ISO 8601 duration. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself.
- Enable
Batched boolOperations Boolean flag which controls whether the Subscription supports batched operations. Defaults to
false.- Forward
Dead stringLettered Messages To The name of a Queue or Topic to automatically forward Dead Letter messages to.
- Forward
To string The name of a Queue or Topic to automatically forward messages to.
- Lock
Duration string The lock duration for the subscription as an ISO 8601 duration. The default value is
1minute orP1M.- Max
Delivery intCount The maximum number of deliveries.
- Name string
Specifies the name of the ServiceBus Subscription resource. Changing this forces a new resource to be created.
- Namespace
Name string The name of the ServiceBus Namespace to create this Subscription in. Changing this forces a new resource to be created.
- Requires
Session bool Boolean flag which controls whether this Subscription supports the concept of a session. Defaults to
false. Changing this forces a new resource to be created.- Resource
Group stringName The name of the resource group in which to create the namespace. Changing this forces a new resource to be created.
- Topic
Name string The name of the ServiceBus Topic to create this Subscription in. Changing this forces a new resource to be created.
- Auto
Delete stringOn Idle The idle interval after which the topic is automatically deleted as an ISO 8601 duration. The minimum duration is
5minutes orP5M.- Dead
Lettering boolOn Message Expiration Boolean flag which controls whether the Subscription has dead letter support when a message expires. Defaults to
false.- Default
Message stringTtl The Default message timespan to live as an ISO 8601 duration. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself.
- Enable
Batched boolOperations Boolean flag which controls whether the Subscription supports batched operations. Defaults to
false.- Forward
Dead stringLettered Messages To The name of a Queue or Topic to automatically forward Dead Letter messages to.
- Forward
To string The name of a Queue or Topic to automatically forward messages to.
- Lock
Duration string The lock duration for the subscription as an ISO 8601 duration. The default value is
1minute orP1M.- Max
Delivery intCount The maximum number of deliveries.
- Name string
Specifies the name of the ServiceBus Subscription resource. Changing this forces a new resource to be created.
- Namespace
Name string The name of the ServiceBus Namespace to create this Subscription in. Changing this forces a new resource to be created.
- Requires
Session bool Boolean flag which controls whether this Subscription supports the concept of a session. Defaults to
false. Changing this forces a new resource to be created.- Resource
Group stringName The name of the resource group in which to create the namespace. Changing this forces a new resource to be created.
- Topic
Name string The name of the ServiceBus Topic to create this Subscription in. Changing this forces a new resource to be created.
- auto
Delete stringOn Idle The idle interval after which the topic is automatically deleted as an ISO 8601 duration. The minimum duration is
5minutes orP5M.- dead
Lettering booleanOn Message Expiration Boolean flag which controls whether the Subscription has dead letter support when a message expires. Defaults to
false.- default
Message stringTtl The Default message timespan to live as an ISO 8601 duration. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself.
- enable
Batched booleanOperations Boolean flag which controls whether the Subscription supports batched operations. Defaults to
false.- forward
Dead stringLettered Messages To The name of a Queue or Topic to automatically forward Dead Letter messages to.
- forward
To string The name of a Queue or Topic to automatically forward messages to.
- lock
Duration string The lock duration for the subscription as an ISO 8601 duration. The default value is
1minute orP1M.- max
Delivery numberCount The maximum number of deliveries.
- name string
Specifies the name of the ServiceBus Subscription resource. Changing this forces a new resource to be created.
- namespace
Name string The name of the ServiceBus Namespace to create this Subscription in. Changing this forces a new resource to be created.
- requires
Session boolean Boolean flag which controls whether this Subscription supports the concept of a session. Defaults to
false. Changing this forces a new resource to be created.- resource
Group stringName The name of the resource group in which to create the namespace. Changing this forces a new resource to be created.
- topic
Name string The name of the ServiceBus Topic to create this Subscription in. Changing this forces a new resource to be created.
- auto_
delete_ stron_ idle The idle interval after which the topic is automatically deleted as an ISO 8601 duration. The minimum duration is
5minutes orP5M.- dead_
lettering_ boolon_ message_ expiration Boolean flag which controls whether the Subscription has dead letter support when a message expires. Defaults to
false.- default_
message_ strttl The Default message timespan to live as an ISO 8601 duration. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself.
- enable_
batched_ booloperations Boolean flag which controls whether the Subscription supports batched operations. Defaults to
false.- forward_
dead_ strlettered_ messages_ to The name of a Queue or Topic to automatically forward Dead Letter messages to.
- forward_
to str The name of a Queue or Topic to automatically forward messages to.
- lock_
duration str The lock duration for the subscription as an ISO 8601 duration. The default value is
1minute orP1M.- max_
delivery_ floatcount The maximum number of deliveries.
- name str
Specifies the name of the ServiceBus Subscription resource. Changing this forces a new resource to be created.
- namespace_
name str The name of the ServiceBus Namespace to create this Subscription in. Changing this forces a new resource to be created.
- requires_
session bool Boolean flag which controls whether this Subscription supports the concept of a session. Defaults to
false. Changing this forces a new resource to be created.- resource_
group_ strname The name of the resource group in which to create the namespace. Changing this forces a new resource to be created.
- topic_
name str The name of the ServiceBus Topic to create this Subscription in. 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
azurermTerraform Provider.