/
getTopic.go
202 lines (173 loc) · 8.93 KB
/
getTopic.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
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package servicebus
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about an existing Service Bus Topic.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-azure/sdk/v4/go/azure/servicebus"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := servicebus.LookupTopic(ctx, &servicebus.LookupTopicArgs{
// Name: "existing",
// ResourceGroupName: pulumi.StringRef("existing"),
// NamespaceName: pulumi.StringRef("existing"),
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("id", example.Id)
// return nil
// })
// }
// ```
func LookupTopic(ctx *pulumi.Context, args *LookupTopicArgs, opts ...pulumi.InvokeOption) (*LookupTopicResult, error) {
var rv LookupTopicResult
err := ctx.Invoke("azure:servicebus/getTopic:getTopic", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getTopic.
type LookupTopicArgs struct {
// The name of this Service Bus Topic.
Name string `pulumi:"name"`
NamespaceId *string `pulumi:"namespaceId"`
// The name of the Service Bus Namespace.
NamespaceName *string `pulumi:"namespaceName"`
// The name of the Resource Group where the Service Bus Topic exists.
ResourceGroupName *string `pulumi:"resourceGroupName"`
}
// A collection of values returned by getTopic.
type LookupTopicResult struct {
// The ISO 8601 timespan duration of the idle interval after which the Topic is automatically deleted, minimum of 5 minutes.
AutoDeleteOnIdle string `pulumi:"autoDeleteOnIdle"`
// The ISO 8601 timespan duration of TTL of messages sent to this topic if no TTL value is set on the message itself.
DefaultMessageTtl string `pulumi:"defaultMessageTtl"`
// The ISO 8601 timespan duration during which duplicates can be detected.
DuplicateDetectionHistoryTimeWindow string `pulumi:"duplicateDetectionHistoryTimeWindow"`
// Boolean flag which controls if server-side batched operations are enabled.
EnableBatchedOperations bool `pulumi:"enableBatchedOperations"`
// Boolean flag which controls whether Express Entities are enabled. An express topic holds a message in memory temporarily before writing it to persistent storage.
EnableExpress bool `pulumi:"enableExpress"`
// Boolean flag which controls whether to enable the topic to be partitioned across multiple message brokers.
EnablePartitioning bool `pulumi:"enablePartitioning"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// Integer value which controls the size of memory allocated for the topic. For supported values see the "Queue/topic size" section of [this document](https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-quotas).
MaxSizeInMegabytes int `pulumi:"maxSizeInMegabytes"`
Name string `pulumi:"name"`
NamespaceId *string `pulumi:"namespaceId"`
NamespaceName *string `pulumi:"namespaceName"`
// Boolean flag which controls whether the Topic requires duplicate detection.
RequiresDuplicateDetection bool `pulumi:"requiresDuplicateDetection"`
ResourceGroupName *string `pulumi:"resourceGroupName"`
// The Status of the Service Bus Topic. Acceptable values are Active or Disabled.
Status string `pulumi:"status"`
// Boolean flag which controls whether the Topic supports ordering.
SupportOrdering bool `pulumi:"supportOrdering"`
}
func LookupTopicOutput(ctx *pulumi.Context, args LookupTopicOutputArgs, opts ...pulumi.InvokeOption) LookupTopicResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupTopicResult, error) {
args := v.(LookupTopicArgs)
r, err := LookupTopic(ctx, &args, opts...)
return *r, err
}).(LookupTopicResultOutput)
}
// A collection of arguments for invoking getTopic.
type LookupTopicOutputArgs struct {
// The name of this Service Bus Topic.
Name pulumi.StringInput `pulumi:"name"`
NamespaceId pulumi.StringPtrInput `pulumi:"namespaceId"`
// The name of the Service Bus Namespace.
NamespaceName pulumi.StringPtrInput `pulumi:"namespaceName"`
// The name of the Resource Group where the Service Bus Topic exists.
ResourceGroupName pulumi.StringPtrInput `pulumi:"resourceGroupName"`
}
func (LookupTopicOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupTopicArgs)(nil)).Elem()
}
// A collection of values returned by getTopic.
type LookupTopicResultOutput struct{ *pulumi.OutputState }
func (LookupTopicResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupTopicResult)(nil)).Elem()
}
func (o LookupTopicResultOutput) ToLookupTopicResultOutput() LookupTopicResultOutput {
return o
}
func (o LookupTopicResultOutput) ToLookupTopicResultOutputWithContext(ctx context.Context) LookupTopicResultOutput {
return o
}
// The ISO 8601 timespan duration of the idle interval after which the Topic is automatically deleted, minimum of 5 minutes.
func (o LookupTopicResultOutput) AutoDeleteOnIdle() pulumi.StringOutput {
return o.ApplyT(func(v LookupTopicResult) string { return v.AutoDeleteOnIdle }).(pulumi.StringOutput)
}
// The ISO 8601 timespan duration of TTL of messages sent to this topic if no TTL value is set on the message itself.
func (o LookupTopicResultOutput) DefaultMessageTtl() pulumi.StringOutput {
return o.ApplyT(func(v LookupTopicResult) string { return v.DefaultMessageTtl }).(pulumi.StringOutput)
}
// The ISO 8601 timespan duration during which duplicates can be detected.
func (o LookupTopicResultOutput) DuplicateDetectionHistoryTimeWindow() pulumi.StringOutput {
return o.ApplyT(func(v LookupTopicResult) string { return v.DuplicateDetectionHistoryTimeWindow }).(pulumi.StringOutput)
}
// Boolean flag which controls if server-side batched operations are enabled.
func (o LookupTopicResultOutput) EnableBatchedOperations() pulumi.BoolOutput {
return o.ApplyT(func(v LookupTopicResult) bool { return v.EnableBatchedOperations }).(pulumi.BoolOutput)
}
// Boolean flag which controls whether Express Entities are enabled. An express topic holds a message in memory temporarily before writing it to persistent storage.
func (o LookupTopicResultOutput) EnableExpress() pulumi.BoolOutput {
return o.ApplyT(func(v LookupTopicResult) bool { return v.EnableExpress }).(pulumi.BoolOutput)
}
// Boolean flag which controls whether to enable the topic to be partitioned across multiple message brokers.
func (o LookupTopicResultOutput) EnablePartitioning() pulumi.BoolOutput {
return o.ApplyT(func(v LookupTopicResult) bool { return v.EnablePartitioning }).(pulumi.BoolOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupTopicResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupTopicResult) string { return v.Id }).(pulumi.StringOutput)
}
// Integer value which controls the size of memory allocated for the topic. For supported values see the "Queue/topic size" section of [this document](https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-quotas).
func (o LookupTopicResultOutput) MaxSizeInMegabytes() pulumi.IntOutput {
return o.ApplyT(func(v LookupTopicResult) int { return v.MaxSizeInMegabytes }).(pulumi.IntOutput)
}
func (o LookupTopicResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupTopicResult) string { return v.Name }).(pulumi.StringOutput)
}
func (o LookupTopicResultOutput) NamespaceId() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupTopicResult) *string { return v.NamespaceId }).(pulumi.StringPtrOutput)
}
func (o LookupTopicResultOutput) NamespaceName() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupTopicResult) *string { return v.NamespaceName }).(pulumi.StringPtrOutput)
}
// Boolean flag which controls whether the Topic requires duplicate detection.
func (o LookupTopicResultOutput) RequiresDuplicateDetection() pulumi.BoolOutput {
return o.ApplyT(func(v LookupTopicResult) bool { return v.RequiresDuplicateDetection }).(pulumi.BoolOutput)
}
func (o LookupTopicResultOutput) ResourceGroupName() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupTopicResult) *string { return v.ResourceGroupName }).(pulumi.StringPtrOutput)
}
// The Status of the Service Bus Topic. Acceptable values are Active or Disabled.
func (o LookupTopicResultOutput) Status() pulumi.StringOutput {
return o.ApplyT(func(v LookupTopicResult) string { return v.Status }).(pulumi.StringOutput)
}
// Boolean flag which controls whether the Topic supports ordering.
func (o LookupTopicResultOutput) SupportOrdering() pulumi.BoolOutput {
return o.ApplyT(func(v LookupTopicResult) bool { return v.SupportOrdering }).(pulumi.BoolOutput)
}
func init() {
pulumi.RegisterOutputType(LookupTopicResultOutput{})
}