-
Notifications
You must be signed in to change notification settings - Fork 51
/
getSubscription.go
243 lines (213 loc) · 11.4 KB
/
getSubscription.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package servicebus
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about an existing ServiceBus Subscription.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := servicebus.LookupSubscription(ctx, &servicebus.LookupSubscriptionArgs{
// Name: "examplesubscription",
// TopicId: pulumi.StringRef("exampletopic"),
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("servicebusSubscription", data.Azurerm_servicebus_namespace.Example)
// return nil
// })
// }
//
// ```
func LookupSubscription(ctx *pulumi.Context, args *LookupSubscriptionArgs, opts ...pulumi.InvokeOption) (*LookupSubscriptionResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupSubscriptionResult
err := ctx.Invoke("azure:servicebus/getSubscription:getSubscription", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getSubscription.
type LookupSubscriptionArgs struct {
// Specifies the name of the ServiceBus Subscription.
Name string `pulumi:"name"`
// The name of the ServiceBus Namespace.
//
// Deprecated: `namespace_name` will be removed in favour of the property `topic_id` in version 4.0 of the AzureRM Provider.
NamespaceName *string `pulumi:"namespaceName"`
// Specifies the name of the Resource Group where the ServiceBus Namespace exists.
//
// Deprecated: `resource_group_name` will be removed in favour of the property `topic_id` in version 4.0 of the AzureRM Provider.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// The ID of the ServiceBus Topic where the Service Bus Subscription exists.
TopicId *string `pulumi:"topicId"`
// The name of the ServiceBus Topic.
//
// > **Note:** `namespaceName`,`resourceGroupName` and `topicName` has been deprecated and will be removed in version 4.0 of the provider in favour of `topicId`.
//
// Deprecated: `topic_name` will be removed in favour of the property `topic_id` in version 4.0 of the AzureRM Provider.
TopicName *string `pulumi:"topicName"`
}
// A collection of values returned by getSubscription.
type LookupSubscriptionResult struct {
// The idle interval after which the topic is automatically deleted.
AutoDeleteOnIdle string `pulumi:"autoDeleteOnIdle"`
// Does the ServiceBus Subscription have dead letter support on filter evaluation exceptions?
DeadLetteringOnFilterEvaluationError bool `pulumi:"deadLetteringOnFilterEvaluationError"`
// Does the Service Bus Subscription have dead letter support when a message expires?
DeadLetteringOnMessageExpiration bool `pulumi:"deadLetteringOnMessageExpiration"`
// The Default message timespan to live. 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.
DefaultMessageTtl string `pulumi:"defaultMessageTtl"`
// Are batched operations enabled on this ServiceBus Subscription?
EnableBatchedOperations bool `pulumi:"enableBatchedOperations"`
// The name of a Queue or Topic to automatically forward Dead Letter messages to.
ForwardDeadLetteredMessagesTo string `pulumi:"forwardDeadLetteredMessagesTo"`
// The name of a ServiceBus Queue or ServiceBus Topic where messages are automatically forwarded.
ForwardTo string `pulumi:"forwardTo"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// The lock duration for the subscription.
LockDuration string `pulumi:"lockDuration"`
// The maximum number of deliveries.
MaxDeliveryCount int `pulumi:"maxDeliveryCount"`
Name string `pulumi:"name"`
// Deprecated: `namespace_name` will be removed in favour of the property `topic_id` in version 4.0 of the AzureRM Provider.
NamespaceName *string `pulumi:"namespaceName"`
// Whether or not this ServiceBus Subscription supports session.
RequiresSession bool `pulumi:"requiresSession"`
// Deprecated: `resource_group_name` will be removed in favour of the property `topic_id` in version 4.0 of the AzureRM Provider.
ResourceGroupName *string `pulumi:"resourceGroupName"`
TopicId *string `pulumi:"topicId"`
// Deprecated: `topic_name` will be removed in favour of the property `topic_id` in version 4.0 of the AzureRM Provider.
TopicName *string `pulumi:"topicName"`
}
func LookupSubscriptionOutput(ctx *pulumi.Context, args LookupSubscriptionOutputArgs, opts ...pulumi.InvokeOption) LookupSubscriptionResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupSubscriptionResult, error) {
args := v.(LookupSubscriptionArgs)
r, err := LookupSubscription(ctx, &args, opts...)
var s LookupSubscriptionResult
if r != nil {
s = *r
}
return s, err
}).(LookupSubscriptionResultOutput)
}
// A collection of arguments for invoking getSubscription.
type LookupSubscriptionOutputArgs struct {
// Specifies the name of the ServiceBus Subscription.
Name pulumi.StringInput `pulumi:"name"`
// The name of the ServiceBus Namespace.
//
// Deprecated: `namespace_name` will be removed in favour of the property `topic_id` in version 4.0 of the AzureRM Provider.
NamespaceName pulumi.StringPtrInput `pulumi:"namespaceName"`
// Specifies the name of the Resource Group where the ServiceBus Namespace exists.
//
// Deprecated: `resource_group_name` will be removed in favour of the property `topic_id` in version 4.0 of the AzureRM Provider.
ResourceGroupName pulumi.StringPtrInput `pulumi:"resourceGroupName"`
// The ID of the ServiceBus Topic where the Service Bus Subscription exists.
TopicId pulumi.StringPtrInput `pulumi:"topicId"`
// The name of the ServiceBus Topic.
//
// > **Note:** `namespaceName`,`resourceGroupName` and `topicName` has been deprecated and will be removed in version 4.0 of the provider in favour of `topicId`.
//
// Deprecated: `topic_name` will be removed in favour of the property `topic_id` in version 4.0 of the AzureRM Provider.
TopicName pulumi.StringPtrInput `pulumi:"topicName"`
}
func (LookupSubscriptionOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupSubscriptionArgs)(nil)).Elem()
}
// A collection of values returned by getSubscription.
type LookupSubscriptionResultOutput struct{ *pulumi.OutputState }
func (LookupSubscriptionResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupSubscriptionResult)(nil)).Elem()
}
func (o LookupSubscriptionResultOutput) ToLookupSubscriptionResultOutput() LookupSubscriptionResultOutput {
return o
}
func (o LookupSubscriptionResultOutput) ToLookupSubscriptionResultOutputWithContext(ctx context.Context) LookupSubscriptionResultOutput {
return o
}
// The idle interval after which the topic is automatically deleted.
func (o LookupSubscriptionResultOutput) AutoDeleteOnIdle() pulumi.StringOutput {
return o.ApplyT(func(v LookupSubscriptionResult) string { return v.AutoDeleteOnIdle }).(pulumi.StringOutput)
}
// Does the ServiceBus Subscription have dead letter support on filter evaluation exceptions?
func (o LookupSubscriptionResultOutput) DeadLetteringOnFilterEvaluationError() pulumi.BoolOutput {
return o.ApplyT(func(v LookupSubscriptionResult) bool { return v.DeadLetteringOnFilterEvaluationError }).(pulumi.BoolOutput)
}
// Does the Service Bus Subscription have dead letter support when a message expires?
func (o LookupSubscriptionResultOutput) DeadLetteringOnMessageExpiration() pulumi.BoolOutput {
return o.ApplyT(func(v LookupSubscriptionResult) bool { return v.DeadLetteringOnMessageExpiration }).(pulumi.BoolOutput)
}
// The Default message timespan to live. 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.
func (o LookupSubscriptionResultOutput) DefaultMessageTtl() pulumi.StringOutput {
return o.ApplyT(func(v LookupSubscriptionResult) string { return v.DefaultMessageTtl }).(pulumi.StringOutput)
}
// Are batched operations enabled on this ServiceBus Subscription?
func (o LookupSubscriptionResultOutput) EnableBatchedOperations() pulumi.BoolOutput {
return o.ApplyT(func(v LookupSubscriptionResult) bool { return v.EnableBatchedOperations }).(pulumi.BoolOutput)
}
// The name of a Queue or Topic to automatically forward Dead Letter messages to.
func (o LookupSubscriptionResultOutput) ForwardDeadLetteredMessagesTo() pulumi.StringOutput {
return o.ApplyT(func(v LookupSubscriptionResult) string { return v.ForwardDeadLetteredMessagesTo }).(pulumi.StringOutput)
}
// The name of a ServiceBus Queue or ServiceBus Topic where messages are automatically forwarded.
func (o LookupSubscriptionResultOutput) ForwardTo() pulumi.StringOutput {
return o.ApplyT(func(v LookupSubscriptionResult) string { return v.ForwardTo }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupSubscriptionResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupSubscriptionResult) string { return v.Id }).(pulumi.StringOutput)
}
// The lock duration for the subscription.
func (o LookupSubscriptionResultOutput) LockDuration() pulumi.StringOutput {
return o.ApplyT(func(v LookupSubscriptionResult) string { return v.LockDuration }).(pulumi.StringOutput)
}
// The maximum number of deliveries.
func (o LookupSubscriptionResultOutput) MaxDeliveryCount() pulumi.IntOutput {
return o.ApplyT(func(v LookupSubscriptionResult) int { return v.MaxDeliveryCount }).(pulumi.IntOutput)
}
func (o LookupSubscriptionResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupSubscriptionResult) string { return v.Name }).(pulumi.StringOutput)
}
// Deprecated: `namespace_name` will be removed in favour of the property `topic_id` in version 4.0 of the AzureRM Provider.
func (o LookupSubscriptionResultOutput) NamespaceName() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupSubscriptionResult) *string { return v.NamespaceName }).(pulumi.StringPtrOutput)
}
// Whether or not this ServiceBus Subscription supports session.
func (o LookupSubscriptionResultOutput) RequiresSession() pulumi.BoolOutput {
return o.ApplyT(func(v LookupSubscriptionResult) bool { return v.RequiresSession }).(pulumi.BoolOutput)
}
// Deprecated: `resource_group_name` will be removed in favour of the property `topic_id` in version 4.0 of the AzureRM Provider.
func (o LookupSubscriptionResultOutput) ResourceGroupName() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupSubscriptionResult) *string { return v.ResourceGroupName }).(pulumi.StringPtrOutput)
}
func (o LookupSubscriptionResultOutput) TopicId() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupSubscriptionResult) *string { return v.TopicId }).(pulumi.StringPtrOutput)
}
// Deprecated: `topic_name` will be removed in favour of the property `topic_id` in version 4.0 of the AzureRM Provider.
func (o LookupSubscriptionResultOutput) TopicName() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupSubscriptionResult) *string { return v.TopicName }).(pulumi.StringPtrOutput)
}
func init() {
pulumi.RegisterOutputType(LookupSubscriptionResultOutput{})
}