/
getAuthorizationRule.go
206 lines (178 loc) · 8.72 KB
/
getAuthorizationRule.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
// 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 eventhub
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 Event Hubs Authorization Rule within an Event Hub.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventhub"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := eventhub.LookupAuthorizationRule(ctx, &eventhub.LookupAuthorizationRuleArgs{
// Name: "test",
// NamespaceName: testAzurermEventhubNamespace.Name,
// EventhubName: testAzurermEventhub.Name,
// ResourceGroupName: testAzurermResourceGroup.Name,
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
func LookupAuthorizationRule(ctx *pulumi.Context, args *LookupAuthorizationRuleArgs, opts ...pulumi.InvokeOption) (*LookupAuthorizationRuleResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupAuthorizationRuleResult
err := ctx.Invoke("azure:eventhub/getAuthorizationRule:getAuthorizationRule", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getAuthorizationRule.
type LookupAuthorizationRuleArgs struct {
// Specifies the name of the EventHub.
EventhubName string `pulumi:"eventhubName"`
Listen *bool `pulumi:"listen"`
Manage *bool `pulumi:"manage"`
// Specifies the name of the EventHub Authorization Rule resource. be created.
Name string `pulumi:"name"`
// Specifies the name of the grandparent EventHub Namespace.
NamespaceName string `pulumi:"namespaceName"`
// The name of the resource group in which the EventHub Authorization Rule's grandparent Namespace exists.
ResourceGroupName string `pulumi:"resourceGroupName"`
Send *bool `pulumi:"send"`
}
// A collection of values returned by getAuthorizationRule.
type LookupAuthorizationRuleResult struct {
EventhubName string `pulumi:"eventhubName"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
Listen *bool `pulumi:"listen"`
Manage *bool `pulumi:"manage"`
Name string `pulumi:"name"`
NamespaceName string `pulumi:"namespaceName"`
// The Primary Connection String for the Event Hubs Authorization Rule.
PrimaryConnectionString string `pulumi:"primaryConnectionString"`
// The alias of the Primary Connection String for the Event Hubs Authorization Rule.
PrimaryConnectionStringAlias string `pulumi:"primaryConnectionStringAlias"`
// The Primary Key for the Event Hubs Authorization Rule.
PrimaryKey string `pulumi:"primaryKey"`
ResourceGroupName string `pulumi:"resourceGroupName"`
// The Secondary Connection String for the Event Hubs Authorization Rule.
SecondaryConnectionString string `pulumi:"secondaryConnectionString"`
// The alias of the Secondary Connection String for the Event Hubs Authorization Rule.
SecondaryConnectionStringAlias string `pulumi:"secondaryConnectionStringAlias"`
// The Secondary Key for the Event Hubs Authorization Rule.
SecondaryKey string `pulumi:"secondaryKey"`
Send *bool `pulumi:"send"`
}
func LookupAuthorizationRuleOutput(ctx *pulumi.Context, args LookupAuthorizationRuleOutputArgs, opts ...pulumi.InvokeOption) LookupAuthorizationRuleResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupAuthorizationRuleResult, error) {
args := v.(LookupAuthorizationRuleArgs)
r, err := LookupAuthorizationRule(ctx, &args, opts...)
var s LookupAuthorizationRuleResult
if r != nil {
s = *r
}
return s, err
}).(LookupAuthorizationRuleResultOutput)
}
// A collection of arguments for invoking getAuthorizationRule.
type LookupAuthorizationRuleOutputArgs struct {
// Specifies the name of the EventHub.
EventhubName pulumi.StringInput `pulumi:"eventhubName"`
Listen pulumi.BoolPtrInput `pulumi:"listen"`
Manage pulumi.BoolPtrInput `pulumi:"manage"`
// Specifies the name of the EventHub Authorization Rule resource. be created.
Name pulumi.StringInput `pulumi:"name"`
// Specifies the name of the grandparent EventHub Namespace.
NamespaceName pulumi.StringInput `pulumi:"namespaceName"`
// The name of the resource group in which the EventHub Authorization Rule's grandparent Namespace exists.
ResourceGroupName pulumi.StringInput `pulumi:"resourceGroupName"`
Send pulumi.BoolPtrInput `pulumi:"send"`
}
func (LookupAuthorizationRuleOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupAuthorizationRuleArgs)(nil)).Elem()
}
// A collection of values returned by getAuthorizationRule.
type LookupAuthorizationRuleResultOutput struct{ *pulumi.OutputState }
func (LookupAuthorizationRuleResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupAuthorizationRuleResult)(nil)).Elem()
}
func (o LookupAuthorizationRuleResultOutput) ToLookupAuthorizationRuleResultOutput() LookupAuthorizationRuleResultOutput {
return o
}
func (o LookupAuthorizationRuleResultOutput) ToLookupAuthorizationRuleResultOutputWithContext(ctx context.Context) LookupAuthorizationRuleResultOutput {
return o
}
func (o LookupAuthorizationRuleResultOutput) EventhubName() pulumi.StringOutput {
return o.ApplyT(func(v LookupAuthorizationRuleResult) string { return v.EventhubName }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupAuthorizationRuleResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupAuthorizationRuleResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o LookupAuthorizationRuleResultOutput) Listen() pulumi.BoolPtrOutput {
return o.ApplyT(func(v LookupAuthorizationRuleResult) *bool { return v.Listen }).(pulumi.BoolPtrOutput)
}
func (o LookupAuthorizationRuleResultOutput) Manage() pulumi.BoolPtrOutput {
return o.ApplyT(func(v LookupAuthorizationRuleResult) *bool { return v.Manage }).(pulumi.BoolPtrOutput)
}
func (o LookupAuthorizationRuleResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupAuthorizationRuleResult) string { return v.Name }).(pulumi.StringOutput)
}
func (o LookupAuthorizationRuleResultOutput) NamespaceName() pulumi.StringOutput {
return o.ApplyT(func(v LookupAuthorizationRuleResult) string { return v.NamespaceName }).(pulumi.StringOutput)
}
// The Primary Connection String for the Event Hubs Authorization Rule.
func (o LookupAuthorizationRuleResultOutput) PrimaryConnectionString() pulumi.StringOutput {
return o.ApplyT(func(v LookupAuthorizationRuleResult) string { return v.PrimaryConnectionString }).(pulumi.StringOutput)
}
// The alias of the Primary Connection String for the Event Hubs Authorization Rule.
func (o LookupAuthorizationRuleResultOutput) PrimaryConnectionStringAlias() pulumi.StringOutput {
return o.ApplyT(func(v LookupAuthorizationRuleResult) string { return v.PrimaryConnectionStringAlias }).(pulumi.StringOutput)
}
// The Primary Key for the Event Hubs Authorization Rule.
func (o LookupAuthorizationRuleResultOutput) PrimaryKey() pulumi.StringOutput {
return o.ApplyT(func(v LookupAuthorizationRuleResult) string { return v.PrimaryKey }).(pulumi.StringOutput)
}
func (o LookupAuthorizationRuleResultOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v LookupAuthorizationRuleResult) string { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// The Secondary Connection String for the Event Hubs Authorization Rule.
func (o LookupAuthorizationRuleResultOutput) SecondaryConnectionString() pulumi.StringOutput {
return o.ApplyT(func(v LookupAuthorizationRuleResult) string { return v.SecondaryConnectionString }).(pulumi.StringOutput)
}
// The alias of the Secondary Connection String for the Event Hubs Authorization Rule.
func (o LookupAuthorizationRuleResultOutput) SecondaryConnectionStringAlias() pulumi.StringOutput {
return o.ApplyT(func(v LookupAuthorizationRuleResult) string { return v.SecondaryConnectionStringAlias }).(pulumi.StringOutput)
}
// The Secondary Key for the Event Hubs Authorization Rule.
func (o LookupAuthorizationRuleResultOutput) SecondaryKey() pulumi.StringOutput {
return o.ApplyT(func(v LookupAuthorizationRuleResult) string { return v.SecondaryKey }).(pulumi.StringOutput)
}
func (o LookupAuthorizationRuleResultOutput) Send() pulumi.BoolPtrOutput {
return o.ApplyT(func(v LookupAuthorizationRuleResult) *bool { return v.Send }).(pulumi.BoolPtrOutput)
}
func init() {
pulumi.RegisterOutputType(LookupAuthorizationRuleResultOutput{})
}