/
namespaceAuthorizationRule.go
407 lines (351 loc) · 20.3 KB
/
namespaceAuthorizationRule.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
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
// 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 relay
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages an Azure Relay Namespace Authorization Rule.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/relay"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleNamespace, err := relay.NewNamespace(ctx, "example", &relay.NamespaceArgs{
// Name: pulumi.String("example-relay"),
// Location: example.Location,
// ResourceGroupName: example.Name,
// SkuName: pulumi.String("Standard"),
// Tags: pulumi.StringMap{
// "source": pulumi.String("terraform"),
// },
// })
// if err != nil {
// return err
// }
// _, err = relay.NewNamespaceAuthorizationRule(ctx, "example", &relay.NamespaceAuthorizationRuleArgs{
// Name: pulumi.String("example"),
// ResourceGroupName: example.Name,
// NamespaceName: exampleNamespace.Name,
// Listen: pulumi.Bool(true),
// Send: pulumi.Bool(true),
// Manage: pulumi.Bool(false),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// Azure Relay Namespace Authorization Rules can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:relay/namespaceAuthorizationRule:NamespaceAuthorizationRule example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Relay/namespaces/namespace1/authorizationRules/rule1
// ```
type NamespaceAuthorizationRule struct {
pulumi.CustomResourceState
// Grants listen access to this Authorization Rule. Defaults to `false`.
Listen pulumi.BoolPtrOutput `pulumi:"listen"`
// Grants manage access to this Authorization Rule. When this property is `true` - both `listen` and `send` must be set to `true` too. Defaults to `false`.
Manage pulumi.BoolPtrOutput `pulumi:"manage"`
// The name which should be used for this Azure Relay Namespace Authorization Rule. Changing this forces a new Azure Relay Namespace Authorization Rule to be created.
Name pulumi.StringOutput `pulumi:"name"`
// Name of the Azure Relay Namespace for which this Azure Relay Namespace Authorization Rule will be created. Changing this forces a new Azure Relay Namespace Authorization Rule to be created.
NamespaceName pulumi.StringOutput `pulumi:"namespaceName"`
// The Primary Connection String for the Azure Relay Namespace Authorization Rule.
PrimaryConnectionString pulumi.StringOutput `pulumi:"primaryConnectionString"`
// The Primary Key for the Azure Relay Namespace Authorization Rule.
PrimaryKey pulumi.StringOutput `pulumi:"primaryKey"`
// The name of the Resource Group where the Azure Relay Namespace Authorization Rule should exist. Changing this forces a new Azure Relay Namespace Authorization Rule to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// The Secondary Connection String for the Azure Relay Namespace Authorization Rule.
SecondaryConnectionString pulumi.StringOutput `pulumi:"secondaryConnectionString"`
// The Secondary Key for the Azure Relay Namespace Authorization Rule.
SecondaryKey pulumi.StringOutput `pulumi:"secondaryKey"`
// Grants send access to this Authorization Rule. Defaults to `false`.
Send pulumi.BoolPtrOutput `pulumi:"send"`
}
// NewNamespaceAuthorizationRule registers a new resource with the given unique name, arguments, and options.
func NewNamespaceAuthorizationRule(ctx *pulumi.Context,
name string, args *NamespaceAuthorizationRuleArgs, opts ...pulumi.ResourceOption) (*NamespaceAuthorizationRule, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.NamespaceName == nil {
return nil, errors.New("invalid value for required argument 'NamespaceName'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
secrets := pulumi.AdditionalSecretOutputs([]string{
"primaryConnectionString",
"primaryKey",
"secondaryConnectionString",
"secondaryKey",
})
opts = append(opts, secrets)
opts = internal.PkgResourceDefaultOpts(opts)
var resource NamespaceAuthorizationRule
err := ctx.RegisterResource("azure:relay/namespaceAuthorizationRule:NamespaceAuthorizationRule", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetNamespaceAuthorizationRule gets an existing NamespaceAuthorizationRule resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetNamespaceAuthorizationRule(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *NamespaceAuthorizationRuleState, opts ...pulumi.ResourceOption) (*NamespaceAuthorizationRule, error) {
var resource NamespaceAuthorizationRule
err := ctx.ReadResource("azure:relay/namespaceAuthorizationRule:NamespaceAuthorizationRule", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering NamespaceAuthorizationRule resources.
type namespaceAuthorizationRuleState struct {
// Grants listen access to this Authorization Rule. Defaults to `false`.
Listen *bool `pulumi:"listen"`
// Grants manage access to this Authorization Rule. When this property is `true` - both `listen` and `send` must be set to `true` too. Defaults to `false`.
Manage *bool `pulumi:"manage"`
// The name which should be used for this Azure Relay Namespace Authorization Rule. Changing this forces a new Azure Relay Namespace Authorization Rule to be created.
Name *string `pulumi:"name"`
// Name of the Azure Relay Namespace for which this Azure Relay Namespace Authorization Rule will be created. Changing this forces a new Azure Relay Namespace Authorization Rule to be created.
NamespaceName *string `pulumi:"namespaceName"`
// The Primary Connection String for the Azure Relay Namespace Authorization Rule.
PrimaryConnectionString *string `pulumi:"primaryConnectionString"`
// The Primary Key for the Azure Relay Namespace Authorization Rule.
PrimaryKey *string `pulumi:"primaryKey"`
// The name of the Resource Group where the Azure Relay Namespace Authorization Rule should exist. Changing this forces a new Azure Relay Namespace Authorization Rule to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// The Secondary Connection String for the Azure Relay Namespace Authorization Rule.
SecondaryConnectionString *string `pulumi:"secondaryConnectionString"`
// The Secondary Key for the Azure Relay Namespace Authorization Rule.
SecondaryKey *string `pulumi:"secondaryKey"`
// Grants send access to this Authorization Rule. Defaults to `false`.
Send *bool `pulumi:"send"`
}
type NamespaceAuthorizationRuleState struct {
// Grants listen access to this Authorization Rule. Defaults to `false`.
Listen pulumi.BoolPtrInput
// Grants manage access to this Authorization Rule. When this property is `true` - both `listen` and `send` must be set to `true` too. Defaults to `false`.
Manage pulumi.BoolPtrInput
// The name which should be used for this Azure Relay Namespace Authorization Rule. Changing this forces a new Azure Relay Namespace Authorization Rule to be created.
Name pulumi.StringPtrInput
// Name of the Azure Relay Namespace for which this Azure Relay Namespace Authorization Rule will be created. Changing this forces a new Azure Relay Namespace Authorization Rule to be created.
NamespaceName pulumi.StringPtrInput
// The Primary Connection String for the Azure Relay Namespace Authorization Rule.
PrimaryConnectionString pulumi.StringPtrInput
// The Primary Key for the Azure Relay Namespace Authorization Rule.
PrimaryKey pulumi.StringPtrInput
// The name of the Resource Group where the Azure Relay Namespace Authorization Rule should exist. Changing this forces a new Azure Relay Namespace Authorization Rule to be created.
ResourceGroupName pulumi.StringPtrInput
// The Secondary Connection String for the Azure Relay Namespace Authorization Rule.
SecondaryConnectionString pulumi.StringPtrInput
// The Secondary Key for the Azure Relay Namespace Authorization Rule.
SecondaryKey pulumi.StringPtrInput
// Grants send access to this Authorization Rule. Defaults to `false`.
Send pulumi.BoolPtrInput
}
func (NamespaceAuthorizationRuleState) ElementType() reflect.Type {
return reflect.TypeOf((*namespaceAuthorizationRuleState)(nil)).Elem()
}
type namespaceAuthorizationRuleArgs struct {
// Grants listen access to this Authorization Rule. Defaults to `false`.
Listen *bool `pulumi:"listen"`
// Grants manage access to this Authorization Rule. When this property is `true` - both `listen` and `send` must be set to `true` too. Defaults to `false`.
Manage *bool `pulumi:"manage"`
// The name which should be used for this Azure Relay Namespace Authorization Rule. Changing this forces a new Azure Relay Namespace Authorization Rule to be created.
Name *string `pulumi:"name"`
// Name of the Azure Relay Namespace for which this Azure Relay Namespace Authorization Rule will be created. Changing this forces a new Azure Relay Namespace Authorization Rule to be created.
NamespaceName string `pulumi:"namespaceName"`
// The name of the Resource Group where the Azure Relay Namespace Authorization Rule should exist. Changing this forces a new Azure Relay Namespace Authorization Rule to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// Grants send access to this Authorization Rule. Defaults to `false`.
Send *bool `pulumi:"send"`
}
// The set of arguments for constructing a NamespaceAuthorizationRule resource.
type NamespaceAuthorizationRuleArgs struct {
// Grants listen access to this Authorization Rule. Defaults to `false`.
Listen pulumi.BoolPtrInput
// Grants manage access to this Authorization Rule. When this property is `true` - both `listen` and `send` must be set to `true` too. Defaults to `false`.
Manage pulumi.BoolPtrInput
// The name which should be used for this Azure Relay Namespace Authorization Rule. Changing this forces a new Azure Relay Namespace Authorization Rule to be created.
Name pulumi.StringPtrInput
// Name of the Azure Relay Namespace for which this Azure Relay Namespace Authorization Rule will be created. Changing this forces a new Azure Relay Namespace Authorization Rule to be created.
NamespaceName pulumi.StringInput
// The name of the Resource Group where the Azure Relay Namespace Authorization Rule should exist. Changing this forces a new Azure Relay Namespace Authorization Rule to be created.
ResourceGroupName pulumi.StringInput
// Grants send access to this Authorization Rule. Defaults to `false`.
Send pulumi.BoolPtrInput
}
func (NamespaceAuthorizationRuleArgs) ElementType() reflect.Type {
return reflect.TypeOf((*namespaceAuthorizationRuleArgs)(nil)).Elem()
}
type NamespaceAuthorizationRuleInput interface {
pulumi.Input
ToNamespaceAuthorizationRuleOutput() NamespaceAuthorizationRuleOutput
ToNamespaceAuthorizationRuleOutputWithContext(ctx context.Context) NamespaceAuthorizationRuleOutput
}
func (*NamespaceAuthorizationRule) ElementType() reflect.Type {
return reflect.TypeOf((**NamespaceAuthorizationRule)(nil)).Elem()
}
func (i *NamespaceAuthorizationRule) ToNamespaceAuthorizationRuleOutput() NamespaceAuthorizationRuleOutput {
return i.ToNamespaceAuthorizationRuleOutputWithContext(context.Background())
}
func (i *NamespaceAuthorizationRule) ToNamespaceAuthorizationRuleOutputWithContext(ctx context.Context) NamespaceAuthorizationRuleOutput {
return pulumi.ToOutputWithContext(ctx, i).(NamespaceAuthorizationRuleOutput)
}
// NamespaceAuthorizationRuleArrayInput is an input type that accepts NamespaceAuthorizationRuleArray and NamespaceAuthorizationRuleArrayOutput values.
// You can construct a concrete instance of `NamespaceAuthorizationRuleArrayInput` via:
//
// NamespaceAuthorizationRuleArray{ NamespaceAuthorizationRuleArgs{...} }
type NamespaceAuthorizationRuleArrayInput interface {
pulumi.Input
ToNamespaceAuthorizationRuleArrayOutput() NamespaceAuthorizationRuleArrayOutput
ToNamespaceAuthorizationRuleArrayOutputWithContext(context.Context) NamespaceAuthorizationRuleArrayOutput
}
type NamespaceAuthorizationRuleArray []NamespaceAuthorizationRuleInput
func (NamespaceAuthorizationRuleArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*NamespaceAuthorizationRule)(nil)).Elem()
}
func (i NamespaceAuthorizationRuleArray) ToNamespaceAuthorizationRuleArrayOutput() NamespaceAuthorizationRuleArrayOutput {
return i.ToNamespaceAuthorizationRuleArrayOutputWithContext(context.Background())
}
func (i NamespaceAuthorizationRuleArray) ToNamespaceAuthorizationRuleArrayOutputWithContext(ctx context.Context) NamespaceAuthorizationRuleArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(NamespaceAuthorizationRuleArrayOutput)
}
// NamespaceAuthorizationRuleMapInput is an input type that accepts NamespaceAuthorizationRuleMap and NamespaceAuthorizationRuleMapOutput values.
// You can construct a concrete instance of `NamespaceAuthorizationRuleMapInput` via:
//
// NamespaceAuthorizationRuleMap{ "key": NamespaceAuthorizationRuleArgs{...} }
type NamespaceAuthorizationRuleMapInput interface {
pulumi.Input
ToNamespaceAuthorizationRuleMapOutput() NamespaceAuthorizationRuleMapOutput
ToNamespaceAuthorizationRuleMapOutputWithContext(context.Context) NamespaceAuthorizationRuleMapOutput
}
type NamespaceAuthorizationRuleMap map[string]NamespaceAuthorizationRuleInput
func (NamespaceAuthorizationRuleMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*NamespaceAuthorizationRule)(nil)).Elem()
}
func (i NamespaceAuthorizationRuleMap) ToNamespaceAuthorizationRuleMapOutput() NamespaceAuthorizationRuleMapOutput {
return i.ToNamespaceAuthorizationRuleMapOutputWithContext(context.Background())
}
func (i NamespaceAuthorizationRuleMap) ToNamespaceAuthorizationRuleMapOutputWithContext(ctx context.Context) NamespaceAuthorizationRuleMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(NamespaceAuthorizationRuleMapOutput)
}
type NamespaceAuthorizationRuleOutput struct{ *pulumi.OutputState }
func (NamespaceAuthorizationRuleOutput) ElementType() reflect.Type {
return reflect.TypeOf((**NamespaceAuthorizationRule)(nil)).Elem()
}
func (o NamespaceAuthorizationRuleOutput) ToNamespaceAuthorizationRuleOutput() NamespaceAuthorizationRuleOutput {
return o
}
func (o NamespaceAuthorizationRuleOutput) ToNamespaceAuthorizationRuleOutputWithContext(ctx context.Context) NamespaceAuthorizationRuleOutput {
return o
}
// Grants listen access to this Authorization Rule. Defaults to `false`.
func (o NamespaceAuthorizationRuleOutput) Listen() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *NamespaceAuthorizationRule) pulumi.BoolPtrOutput { return v.Listen }).(pulumi.BoolPtrOutput)
}
// Grants manage access to this Authorization Rule. When this property is `true` - both `listen` and `send` must be set to `true` too. Defaults to `false`.
func (o NamespaceAuthorizationRuleOutput) Manage() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *NamespaceAuthorizationRule) pulumi.BoolPtrOutput { return v.Manage }).(pulumi.BoolPtrOutput)
}
// The name which should be used for this Azure Relay Namespace Authorization Rule. Changing this forces a new Azure Relay Namespace Authorization Rule to be created.
func (o NamespaceAuthorizationRuleOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *NamespaceAuthorizationRule) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Name of the Azure Relay Namespace for which this Azure Relay Namespace Authorization Rule will be created. Changing this forces a new Azure Relay Namespace Authorization Rule to be created.
func (o NamespaceAuthorizationRuleOutput) NamespaceName() pulumi.StringOutput {
return o.ApplyT(func(v *NamespaceAuthorizationRule) pulumi.StringOutput { return v.NamespaceName }).(pulumi.StringOutput)
}
// The Primary Connection String for the Azure Relay Namespace Authorization Rule.
func (o NamespaceAuthorizationRuleOutput) PrimaryConnectionString() pulumi.StringOutput {
return o.ApplyT(func(v *NamespaceAuthorizationRule) pulumi.StringOutput { return v.PrimaryConnectionString }).(pulumi.StringOutput)
}
// The Primary Key for the Azure Relay Namespace Authorization Rule.
func (o NamespaceAuthorizationRuleOutput) PrimaryKey() pulumi.StringOutput {
return o.ApplyT(func(v *NamespaceAuthorizationRule) pulumi.StringOutput { return v.PrimaryKey }).(pulumi.StringOutput)
}
// The name of the Resource Group where the Azure Relay Namespace Authorization Rule should exist. Changing this forces a new Azure Relay Namespace Authorization Rule to be created.
func (o NamespaceAuthorizationRuleOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *NamespaceAuthorizationRule) pulumi.StringOutput { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// The Secondary Connection String for the Azure Relay Namespace Authorization Rule.
func (o NamespaceAuthorizationRuleOutput) SecondaryConnectionString() pulumi.StringOutput {
return o.ApplyT(func(v *NamespaceAuthorizationRule) pulumi.StringOutput { return v.SecondaryConnectionString }).(pulumi.StringOutput)
}
// The Secondary Key for the Azure Relay Namespace Authorization Rule.
func (o NamespaceAuthorizationRuleOutput) SecondaryKey() pulumi.StringOutput {
return o.ApplyT(func(v *NamespaceAuthorizationRule) pulumi.StringOutput { return v.SecondaryKey }).(pulumi.StringOutput)
}
// Grants send access to this Authorization Rule. Defaults to `false`.
func (o NamespaceAuthorizationRuleOutput) Send() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *NamespaceAuthorizationRule) pulumi.BoolPtrOutput { return v.Send }).(pulumi.BoolPtrOutput)
}
type NamespaceAuthorizationRuleArrayOutput struct{ *pulumi.OutputState }
func (NamespaceAuthorizationRuleArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*NamespaceAuthorizationRule)(nil)).Elem()
}
func (o NamespaceAuthorizationRuleArrayOutput) ToNamespaceAuthorizationRuleArrayOutput() NamespaceAuthorizationRuleArrayOutput {
return o
}
func (o NamespaceAuthorizationRuleArrayOutput) ToNamespaceAuthorizationRuleArrayOutputWithContext(ctx context.Context) NamespaceAuthorizationRuleArrayOutput {
return o
}
func (o NamespaceAuthorizationRuleArrayOutput) Index(i pulumi.IntInput) NamespaceAuthorizationRuleOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *NamespaceAuthorizationRule {
return vs[0].([]*NamespaceAuthorizationRule)[vs[1].(int)]
}).(NamespaceAuthorizationRuleOutput)
}
type NamespaceAuthorizationRuleMapOutput struct{ *pulumi.OutputState }
func (NamespaceAuthorizationRuleMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*NamespaceAuthorizationRule)(nil)).Elem()
}
func (o NamespaceAuthorizationRuleMapOutput) ToNamespaceAuthorizationRuleMapOutput() NamespaceAuthorizationRuleMapOutput {
return o
}
func (o NamespaceAuthorizationRuleMapOutput) ToNamespaceAuthorizationRuleMapOutputWithContext(ctx context.Context) NamespaceAuthorizationRuleMapOutput {
return o
}
func (o NamespaceAuthorizationRuleMapOutput) MapIndex(k pulumi.StringInput) NamespaceAuthorizationRuleOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *NamespaceAuthorizationRule {
return vs[0].(map[string]*NamespaceAuthorizationRule)[vs[1].(string)]
}).(NamespaceAuthorizationRuleOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*NamespaceAuthorizationRuleInput)(nil)).Elem(), &NamespaceAuthorizationRule{})
pulumi.RegisterInputType(reflect.TypeOf((*NamespaceAuthorizationRuleArrayInput)(nil)).Elem(), NamespaceAuthorizationRuleArray{})
pulumi.RegisterInputType(reflect.TypeOf((*NamespaceAuthorizationRuleMapInput)(nil)).Elem(), NamespaceAuthorizationRuleMap{})
pulumi.RegisterOutputType(NamespaceAuthorizationRuleOutput{})
pulumi.RegisterOutputType(NamespaceAuthorizationRuleArrayOutput{})
pulumi.RegisterOutputType(NamespaceAuthorizationRuleMapOutput{})
}