github.com/vtorhonen/terraform@v0.9.0-beta2.0.20170307220345-5d894e4ffda7/website/source/docs/providers/azurerm/r/servicebus_subscription.html.markdown (about) 1 --- 2 layout: "azurerm" 3 page_title: "Azure Resource Manager: azurerm_servicebus_subscription" 4 sidebar_current: "docs-azurerm-resource-servicebus-subscription" 5 description: |- 6 Create a ServiceBus Subscription. 7 --- 8 9 # azurerm\_servicebus\_subscription 10 11 Create a ServiceBus Subscription. 12 13 ## Example Usage 14 15 ``` 16 resource "azurerm_resource_group" "test" { 17 name = "resourceGroup1" 18 location = "West US" 19 } 20 21 resource "azurerm_servicebus_namespace" "test" { 22 name = "acceptanceTestServiceBusNamespace" 23 location = "West US" 24 resource_group_name = "${azurerm_resource_group.test.name}" 25 sku = "standard" 26 27 tags { 28 environment = "Production" 29 } 30 } 31 32 resource "azurerm_servicebus_topic" "test" { 33 name = "testTopic" 34 location = "West US" 35 resource_group_name = "${azurerm_resource_group.test.name}" 36 namespace_name = "${azurerm_servicebus_namespace.test.name}" 37 38 enable_partitioning = true 39 } 40 41 resource "azurerm_servicebus_subscription" "test" { 42 name = "testSubscription" 43 location = "West US" 44 resource_group_name = "${azurerm_resource_group.test.name}" 45 namespace_name = "${azurerm_servicebus_namespace.test.name}" 46 topic_name = "${azurerm_servicebus_topic.test.name}" 47 max_delivery_count = 1 48 } 49 ``` 50 51 ## Argument Reference 52 53 The following arguments are supported: 54 55 * `name` - (Required) Specifies the name of the ServiceBus Subscription resource. 56 Changing this forces a new resource to be created. 57 58 * `namespace_name` - (Required) The name of the ServiceBus Namespace to create 59 this Subscription in. Changing this forces a new resource to be created. 60 61 * `topic_name` - (Required) The name of the ServiceBus Topic to create 62 this Subscription in. Changing this forces a new resource to be created. 63 64 * `location` - (Required) Specifies the supported Azure location where the resource exists. 65 Changing this forces a new resource to be created. 66 67 * `resource_group_name` - (Required) The name of the resource group in which to 68 create the namespace. Changing this forces a new resource to be created. 69 70 * `max_delivery_count` - (Required) The maximum number of deliveries. 71 72 * `auto_delete_on_idle` - (Optional) The idle interval after which the 73 Subscription is automatically deleted, minimum of 5 minutes. Provided in the 74 [TimeSpan](#timespan-format) format. 75 76 * `default_message_ttl` - (Optional) The TTL of messages sent to this Subscription 77 if no TTL value is set on the message itself. Provided in the [TimeSpan](#timespan-format) 78 format. 79 80 * `lock_duration` - (Optional) The lock duration for the subscription, maximum 81 supported value is 5 minutes. Defaults to 1 minute. 82 83 * `dead_lettering_on_filter_evaluation_exceptions` - (Optional) Boolean flag which 84 controls whether the Subscription has dead letter support on Filter evaluation 85 exceptions. Defaults to false. 86 87 * `dead_lettering_on_message_expiration` - (Optional) Boolean flag which controls 88 whether the Subscription has dead letter support when a message expires. Defaults 89 to false. 90 91 * `enable_batched_operations` - (Optional) Boolean flag which controls whether the 92 Subscription supports batched operations. Defaults to false. 93 94 * `requires_session` - (Optional) Boolean flag which controls whether this Subscription 95 supports the concept of a session. Defaults to false. Changing this forces a 96 new resource to be created. 97 98 ### TimeSpan Format 99 100 Some arguments for this resource are required in the TimeSpan format which is 101 used to represent a lengh of time. The supported format is documented [here](https://msdn.microsoft.com/en-us/library/se73z7b9(v=vs.110).aspx#Anchor_2) 102 103 ## Attributes Reference 104 105 The following attributes are exported: 106 107 * `id` - The ServiceBus Subscription ID. 108 109 ## Import 110 111 Service Bus Subscriptions can be imported using the `resource id`, e.g. 112 113 ``` 114 terraform import azurerm_servicebus_subscription.test /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/microsoft.servicebus/namespaces/sbns1/topics/sntopic1/subscriptions/sbsub1 115 ```