generated from pulumi/pulumi-tf-provider-boilerplate
/
bgpAdvertisedPrefix.go
392 lines (334 loc) · 14.8 KB
/
bgpAdvertisedPrefix.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
// 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 nxos
import (
"context"
"reflect"
"errors"
"github.com/lbrlabs/pulumi-nxos/sdk/go/nxos/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumix"
)
// This resource can manage the BGP (VRF) advertised prefix configuration.
//
// - API Documentation: [bgpAdvPrefix](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/bgp:AdvPrefix/)
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/lbrlabs/pulumi-nxos/sdk/go/nxos"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := nxos.NewBgpAdvertisedPrefix(ctx, "example", &nxos.BgpAdvertisedPrefixArgs{
// AddressFamily: pulumi.String("ipv4-ucast"),
// Asn: pulumi.String("65001"),
// Prefix: pulumi.String("192.168.1.0/24"),
// RouteMap: pulumi.String("rt-map"),
// Vrf: pulumi.String("default"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// ```sh
//
// $ pulumi import nxos:index/bgpAdvertisedPrefix:BgpAdvertisedPrefix example "sys/bgp/inst/dom-[default]/af-[ipv4-ucast]/prefix-[192.168.1.0/24]"
//
// ```
type BgpAdvertisedPrefix struct {
pulumi.CustomResourceState
// Address Family. - Choices: `ipv4-ucast`, `ipv4-mcast`, `vpnv4-ucast`, `ipv6-ucast`, `ipv6-mcast`, `vpnv6-ucast`,
// `vpnv6-mcast`, `l2vpn-evpn`, `ipv4-lucast`, `ipv6-lucast`, `lnkstate`, `ipv4-mvpn`, `ipv6-mvpn`, `l2vpn-vpls`,
// `ipv4-mdt` - Default value: `ipv4-ucast`
AddressFamily pulumi.StringOutput `pulumi:"addressFamily"`
// Autonomous system number.
Asn pulumi.StringOutput `pulumi:"asn"`
// A device name from the provider configuration.
Device pulumi.StringPtrOutput `pulumi:"device"`
// IP address of the network or prefix to advertise.
Prefix pulumi.StringOutput `pulumi:"prefix"`
// Route map to modify attributes.
RouteMap pulumi.StringPtrOutput `pulumi:"routeMap"`
// VRF name.
Vrf pulumi.StringOutput `pulumi:"vrf"`
}
// NewBgpAdvertisedPrefix registers a new resource with the given unique name, arguments, and options.
func NewBgpAdvertisedPrefix(ctx *pulumi.Context,
name string, args *BgpAdvertisedPrefixArgs, opts ...pulumi.ResourceOption) (*BgpAdvertisedPrefix, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AddressFamily == nil {
return nil, errors.New("invalid value for required argument 'AddressFamily'")
}
if args.Asn == nil {
return nil, errors.New("invalid value for required argument 'Asn'")
}
if args.Prefix == nil {
return nil, errors.New("invalid value for required argument 'Prefix'")
}
if args.Vrf == nil {
return nil, errors.New("invalid value for required argument 'Vrf'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource BgpAdvertisedPrefix
err := ctx.RegisterResource("nxos:index/bgpAdvertisedPrefix:BgpAdvertisedPrefix", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetBgpAdvertisedPrefix gets an existing BgpAdvertisedPrefix 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 GetBgpAdvertisedPrefix(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *BgpAdvertisedPrefixState, opts ...pulumi.ResourceOption) (*BgpAdvertisedPrefix, error) {
var resource BgpAdvertisedPrefix
err := ctx.ReadResource("nxos:index/bgpAdvertisedPrefix:BgpAdvertisedPrefix", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering BgpAdvertisedPrefix resources.
type bgpAdvertisedPrefixState struct {
// Address Family. - Choices: `ipv4-ucast`, `ipv4-mcast`, `vpnv4-ucast`, `ipv6-ucast`, `ipv6-mcast`, `vpnv6-ucast`,
// `vpnv6-mcast`, `l2vpn-evpn`, `ipv4-lucast`, `ipv6-lucast`, `lnkstate`, `ipv4-mvpn`, `ipv6-mvpn`, `l2vpn-vpls`,
// `ipv4-mdt` - Default value: `ipv4-ucast`
AddressFamily *string `pulumi:"addressFamily"`
// Autonomous system number.
Asn *string `pulumi:"asn"`
// A device name from the provider configuration.
Device *string `pulumi:"device"`
// IP address of the network or prefix to advertise.
Prefix *string `pulumi:"prefix"`
// Route map to modify attributes.
RouteMap *string `pulumi:"routeMap"`
// VRF name.
Vrf *string `pulumi:"vrf"`
}
type BgpAdvertisedPrefixState struct {
// Address Family. - Choices: `ipv4-ucast`, `ipv4-mcast`, `vpnv4-ucast`, `ipv6-ucast`, `ipv6-mcast`, `vpnv6-ucast`,
// `vpnv6-mcast`, `l2vpn-evpn`, `ipv4-lucast`, `ipv6-lucast`, `lnkstate`, `ipv4-mvpn`, `ipv6-mvpn`, `l2vpn-vpls`,
// `ipv4-mdt` - Default value: `ipv4-ucast`
AddressFamily pulumi.StringPtrInput
// Autonomous system number.
Asn pulumi.StringPtrInput
// A device name from the provider configuration.
Device pulumi.StringPtrInput
// IP address of the network or prefix to advertise.
Prefix pulumi.StringPtrInput
// Route map to modify attributes.
RouteMap pulumi.StringPtrInput
// VRF name.
Vrf pulumi.StringPtrInput
}
func (BgpAdvertisedPrefixState) ElementType() reflect.Type {
return reflect.TypeOf((*bgpAdvertisedPrefixState)(nil)).Elem()
}
type bgpAdvertisedPrefixArgs struct {
// Address Family. - Choices: `ipv4-ucast`, `ipv4-mcast`, `vpnv4-ucast`, `ipv6-ucast`, `ipv6-mcast`, `vpnv6-ucast`,
// `vpnv6-mcast`, `l2vpn-evpn`, `ipv4-lucast`, `ipv6-lucast`, `lnkstate`, `ipv4-mvpn`, `ipv6-mvpn`, `l2vpn-vpls`,
// `ipv4-mdt` - Default value: `ipv4-ucast`
AddressFamily string `pulumi:"addressFamily"`
// Autonomous system number.
Asn string `pulumi:"asn"`
// A device name from the provider configuration.
Device *string `pulumi:"device"`
// IP address of the network or prefix to advertise.
Prefix string `pulumi:"prefix"`
// Route map to modify attributes.
RouteMap *string `pulumi:"routeMap"`
// VRF name.
Vrf string `pulumi:"vrf"`
}
// The set of arguments for constructing a BgpAdvertisedPrefix resource.
type BgpAdvertisedPrefixArgs struct {
// Address Family. - Choices: `ipv4-ucast`, `ipv4-mcast`, `vpnv4-ucast`, `ipv6-ucast`, `ipv6-mcast`, `vpnv6-ucast`,
// `vpnv6-mcast`, `l2vpn-evpn`, `ipv4-lucast`, `ipv6-lucast`, `lnkstate`, `ipv4-mvpn`, `ipv6-mvpn`, `l2vpn-vpls`,
// `ipv4-mdt` - Default value: `ipv4-ucast`
AddressFamily pulumi.StringInput
// Autonomous system number.
Asn pulumi.StringInput
// A device name from the provider configuration.
Device pulumi.StringPtrInput
// IP address of the network or prefix to advertise.
Prefix pulumi.StringInput
// Route map to modify attributes.
RouteMap pulumi.StringPtrInput
// VRF name.
Vrf pulumi.StringInput
}
func (BgpAdvertisedPrefixArgs) ElementType() reflect.Type {
return reflect.TypeOf((*bgpAdvertisedPrefixArgs)(nil)).Elem()
}
type BgpAdvertisedPrefixInput interface {
pulumi.Input
ToBgpAdvertisedPrefixOutput() BgpAdvertisedPrefixOutput
ToBgpAdvertisedPrefixOutputWithContext(ctx context.Context) BgpAdvertisedPrefixOutput
}
func (*BgpAdvertisedPrefix) ElementType() reflect.Type {
return reflect.TypeOf((**BgpAdvertisedPrefix)(nil)).Elem()
}
func (i *BgpAdvertisedPrefix) ToBgpAdvertisedPrefixOutput() BgpAdvertisedPrefixOutput {
return i.ToBgpAdvertisedPrefixOutputWithContext(context.Background())
}
func (i *BgpAdvertisedPrefix) ToBgpAdvertisedPrefixOutputWithContext(ctx context.Context) BgpAdvertisedPrefixOutput {
return pulumi.ToOutputWithContext(ctx, i).(BgpAdvertisedPrefixOutput)
}
func (i *BgpAdvertisedPrefix) ToOutput(ctx context.Context) pulumix.Output[*BgpAdvertisedPrefix] {
return pulumix.Output[*BgpAdvertisedPrefix]{
OutputState: i.ToBgpAdvertisedPrefixOutputWithContext(ctx).OutputState,
}
}
// BgpAdvertisedPrefixArrayInput is an input type that accepts BgpAdvertisedPrefixArray and BgpAdvertisedPrefixArrayOutput values.
// You can construct a concrete instance of `BgpAdvertisedPrefixArrayInput` via:
//
// BgpAdvertisedPrefixArray{ BgpAdvertisedPrefixArgs{...} }
type BgpAdvertisedPrefixArrayInput interface {
pulumi.Input
ToBgpAdvertisedPrefixArrayOutput() BgpAdvertisedPrefixArrayOutput
ToBgpAdvertisedPrefixArrayOutputWithContext(context.Context) BgpAdvertisedPrefixArrayOutput
}
type BgpAdvertisedPrefixArray []BgpAdvertisedPrefixInput
func (BgpAdvertisedPrefixArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*BgpAdvertisedPrefix)(nil)).Elem()
}
func (i BgpAdvertisedPrefixArray) ToBgpAdvertisedPrefixArrayOutput() BgpAdvertisedPrefixArrayOutput {
return i.ToBgpAdvertisedPrefixArrayOutputWithContext(context.Background())
}
func (i BgpAdvertisedPrefixArray) ToBgpAdvertisedPrefixArrayOutputWithContext(ctx context.Context) BgpAdvertisedPrefixArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(BgpAdvertisedPrefixArrayOutput)
}
func (i BgpAdvertisedPrefixArray) ToOutput(ctx context.Context) pulumix.Output[[]*BgpAdvertisedPrefix] {
return pulumix.Output[[]*BgpAdvertisedPrefix]{
OutputState: i.ToBgpAdvertisedPrefixArrayOutputWithContext(ctx).OutputState,
}
}
// BgpAdvertisedPrefixMapInput is an input type that accepts BgpAdvertisedPrefixMap and BgpAdvertisedPrefixMapOutput values.
// You can construct a concrete instance of `BgpAdvertisedPrefixMapInput` via:
//
// BgpAdvertisedPrefixMap{ "key": BgpAdvertisedPrefixArgs{...} }
type BgpAdvertisedPrefixMapInput interface {
pulumi.Input
ToBgpAdvertisedPrefixMapOutput() BgpAdvertisedPrefixMapOutput
ToBgpAdvertisedPrefixMapOutputWithContext(context.Context) BgpAdvertisedPrefixMapOutput
}
type BgpAdvertisedPrefixMap map[string]BgpAdvertisedPrefixInput
func (BgpAdvertisedPrefixMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*BgpAdvertisedPrefix)(nil)).Elem()
}
func (i BgpAdvertisedPrefixMap) ToBgpAdvertisedPrefixMapOutput() BgpAdvertisedPrefixMapOutput {
return i.ToBgpAdvertisedPrefixMapOutputWithContext(context.Background())
}
func (i BgpAdvertisedPrefixMap) ToBgpAdvertisedPrefixMapOutputWithContext(ctx context.Context) BgpAdvertisedPrefixMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(BgpAdvertisedPrefixMapOutput)
}
func (i BgpAdvertisedPrefixMap) ToOutput(ctx context.Context) pulumix.Output[map[string]*BgpAdvertisedPrefix] {
return pulumix.Output[map[string]*BgpAdvertisedPrefix]{
OutputState: i.ToBgpAdvertisedPrefixMapOutputWithContext(ctx).OutputState,
}
}
type BgpAdvertisedPrefixOutput struct{ *pulumi.OutputState }
func (BgpAdvertisedPrefixOutput) ElementType() reflect.Type {
return reflect.TypeOf((**BgpAdvertisedPrefix)(nil)).Elem()
}
func (o BgpAdvertisedPrefixOutput) ToBgpAdvertisedPrefixOutput() BgpAdvertisedPrefixOutput {
return o
}
func (o BgpAdvertisedPrefixOutput) ToBgpAdvertisedPrefixOutputWithContext(ctx context.Context) BgpAdvertisedPrefixOutput {
return o
}
func (o BgpAdvertisedPrefixOutput) ToOutput(ctx context.Context) pulumix.Output[*BgpAdvertisedPrefix] {
return pulumix.Output[*BgpAdvertisedPrefix]{
OutputState: o.OutputState,
}
}
// Address Family. - Choices: `ipv4-ucast`, `ipv4-mcast`, `vpnv4-ucast`, `ipv6-ucast`, `ipv6-mcast`, `vpnv6-ucast`,
// `vpnv6-mcast`, `l2vpn-evpn`, `ipv4-lucast`, `ipv6-lucast`, `lnkstate`, `ipv4-mvpn`, `ipv6-mvpn`, `l2vpn-vpls`,
// `ipv4-mdt` - Default value: `ipv4-ucast`
func (o BgpAdvertisedPrefixOutput) AddressFamily() pulumi.StringOutput {
return o.ApplyT(func(v *BgpAdvertisedPrefix) pulumi.StringOutput { return v.AddressFamily }).(pulumi.StringOutput)
}
// Autonomous system number.
func (o BgpAdvertisedPrefixOutput) Asn() pulumi.StringOutput {
return o.ApplyT(func(v *BgpAdvertisedPrefix) pulumi.StringOutput { return v.Asn }).(pulumi.StringOutput)
}
// A device name from the provider configuration.
func (o BgpAdvertisedPrefixOutput) Device() pulumi.StringPtrOutput {
return o.ApplyT(func(v *BgpAdvertisedPrefix) pulumi.StringPtrOutput { return v.Device }).(pulumi.StringPtrOutput)
}
// IP address of the network or prefix to advertise.
func (o BgpAdvertisedPrefixOutput) Prefix() pulumi.StringOutput {
return o.ApplyT(func(v *BgpAdvertisedPrefix) pulumi.StringOutput { return v.Prefix }).(pulumi.StringOutput)
}
// Route map to modify attributes.
func (o BgpAdvertisedPrefixOutput) RouteMap() pulumi.StringPtrOutput {
return o.ApplyT(func(v *BgpAdvertisedPrefix) pulumi.StringPtrOutput { return v.RouteMap }).(pulumi.StringPtrOutput)
}
// VRF name.
func (o BgpAdvertisedPrefixOutput) Vrf() pulumi.StringOutput {
return o.ApplyT(func(v *BgpAdvertisedPrefix) pulumi.StringOutput { return v.Vrf }).(pulumi.StringOutput)
}
type BgpAdvertisedPrefixArrayOutput struct{ *pulumi.OutputState }
func (BgpAdvertisedPrefixArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*BgpAdvertisedPrefix)(nil)).Elem()
}
func (o BgpAdvertisedPrefixArrayOutput) ToBgpAdvertisedPrefixArrayOutput() BgpAdvertisedPrefixArrayOutput {
return o
}
func (o BgpAdvertisedPrefixArrayOutput) ToBgpAdvertisedPrefixArrayOutputWithContext(ctx context.Context) BgpAdvertisedPrefixArrayOutput {
return o
}
func (o BgpAdvertisedPrefixArrayOutput) ToOutput(ctx context.Context) pulumix.Output[[]*BgpAdvertisedPrefix] {
return pulumix.Output[[]*BgpAdvertisedPrefix]{
OutputState: o.OutputState,
}
}
func (o BgpAdvertisedPrefixArrayOutput) Index(i pulumi.IntInput) BgpAdvertisedPrefixOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *BgpAdvertisedPrefix {
return vs[0].([]*BgpAdvertisedPrefix)[vs[1].(int)]
}).(BgpAdvertisedPrefixOutput)
}
type BgpAdvertisedPrefixMapOutput struct{ *pulumi.OutputState }
func (BgpAdvertisedPrefixMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*BgpAdvertisedPrefix)(nil)).Elem()
}
func (o BgpAdvertisedPrefixMapOutput) ToBgpAdvertisedPrefixMapOutput() BgpAdvertisedPrefixMapOutput {
return o
}
func (o BgpAdvertisedPrefixMapOutput) ToBgpAdvertisedPrefixMapOutputWithContext(ctx context.Context) BgpAdvertisedPrefixMapOutput {
return o
}
func (o BgpAdvertisedPrefixMapOutput) ToOutput(ctx context.Context) pulumix.Output[map[string]*BgpAdvertisedPrefix] {
return pulumix.Output[map[string]*BgpAdvertisedPrefix]{
OutputState: o.OutputState,
}
}
func (o BgpAdvertisedPrefixMapOutput) MapIndex(k pulumi.StringInput) BgpAdvertisedPrefixOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *BgpAdvertisedPrefix {
return vs[0].(map[string]*BgpAdvertisedPrefix)[vs[1].(string)]
}).(BgpAdvertisedPrefixOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*BgpAdvertisedPrefixInput)(nil)).Elem(), &BgpAdvertisedPrefix{})
pulumi.RegisterInputType(reflect.TypeOf((*BgpAdvertisedPrefixArrayInput)(nil)).Elem(), BgpAdvertisedPrefixArray{})
pulumi.RegisterInputType(reflect.TypeOf((*BgpAdvertisedPrefixMapInput)(nil)).Elem(), BgpAdvertisedPrefixMap{})
pulumi.RegisterOutputType(BgpAdvertisedPrefixOutput{})
pulumi.RegisterOutputType(BgpAdvertisedPrefixArrayOutput{})
pulumi.RegisterOutputType(BgpAdvertisedPrefixMapOutput{})
}