This repository has been archived by the owner on Mar 11, 2021. It is now read-only.
/
peering.go
232 lines (208 loc) · 7.36 KB
/
peering.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
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package v20201001
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Peering is a logical representation of a set of connections to the Microsoft Cloud Edge at a location.
type Peering struct {
pulumi.CustomResourceState
// The properties that define a direct peering.
Direct PeeringPropertiesDirectResponsePtrOutput `pulumi:"direct"`
// The properties that define an exchange peering.
Exchange PeeringPropertiesExchangeResponsePtrOutput `pulumi:"exchange"`
// The kind of the peering.
Kind pulumi.StringOutput `pulumi:"kind"`
// The location of the resource.
Location pulumi.StringOutput `pulumi:"location"`
// The name of the resource.
Name pulumi.StringOutput `pulumi:"name"`
// The location of the peering.
PeeringLocation pulumi.StringPtrOutput `pulumi:"peeringLocation"`
// The provisioning state of the resource.
ProvisioningState pulumi.StringOutput `pulumi:"provisioningState"`
// The SKU that defines the tier and kind of the peering.
Sku PeeringSkuResponseOutput `pulumi:"sku"`
// The resource tags.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// The type of the resource.
Type pulumi.StringOutput `pulumi:"type"`
}
// NewPeering registers a new resource with the given unique name, arguments, and options.
func NewPeering(ctx *pulumi.Context,
name string, args *PeeringArgs, opts ...pulumi.ResourceOption) (*Peering, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Kind == nil {
return nil, errors.New("invalid value for required argument 'Kind'")
}
if args.PeeringName == nil {
return nil, errors.New("invalid value for required argument 'PeeringName'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
if args.Sku == nil {
return nil, errors.New("invalid value for required argument 'Sku'")
}
aliases := pulumi.Aliases([]pulumi.Alias{
{
Type: pulumi.String("azure-nextgen:peering/latest:Peering"),
},
{
Type: pulumi.String("azure-nextgen:peering/v20190801preview:Peering"),
},
{
Type: pulumi.String("azure-nextgen:peering/v20190901preview:Peering"),
},
{
Type: pulumi.String("azure-nextgen:peering/v20200101preview:Peering"),
},
{
Type: pulumi.String("azure-nextgen:peering/v20200401:Peering"),
},
})
opts = append(opts, aliases)
var resource Peering
err := ctx.RegisterResource("azure-nextgen:peering/v20201001:Peering", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetPeering gets an existing Peering 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 GetPeering(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *PeeringState, opts ...pulumi.ResourceOption) (*Peering, error) {
var resource Peering
err := ctx.ReadResource("azure-nextgen:peering/v20201001:Peering", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Peering resources.
type peeringState struct {
// The properties that define a direct peering.
Direct *PeeringPropertiesDirectResponse `pulumi:"direct"`
// The properties that define an exchange peering.
Exchange *PeeringPropertiesExchangeResponse `pulumi:"exchange"`
// The kind of the peering.
Kind *string `pulumi:"kind"`
// The location of the resource.
Location *string `pulumi:"location"`
// The name of the resource.
Name *string `pulumi:"name"`
// The location of the peering.
PeeringLocation *string `pulumi:"peeringLocation"`
// The provisioning state of the resource.
ProvisioningState *string `pulumi:"provisioningState"`
// The SKU that defines the tier and kind of the peering.
Sku *PeeringSkuResponse `pulumi:"sku"`
// The resource tags.
Tags map[string]string `pulumi:"tags"`
// The type of the resource.
Type *string `pulumi:"type"`
}
type PeeringState struct {
// The properties that define a direct peering.
Direct PeeringPropertiesDirectResponsePtrInput
// The properties that define an exchange peering.
Exchange PeeringPropertiesExchangeResponsePtrInput
// The kind of the peering.
Kind pulumi.StringPtrInput
// The location of the resource.
Location pulumi.StringPtrInput
// The name of the resource.
Name pulumi.StringPtrInput
// The location of the peering.
PeeringLocation pulumi.StringPtrInput
// The provisioning state of the resource.
ProvisioningState pulumi.StringPtrInput
// The SKU that defines the tier and kind of the peering.
Sku PeeringSkuResponsePtrInput
// The resource tags.
Tags pulumi.StringMapInput
// The type of the resource.
Type pulumi.StringPtrInput
}
func (PeeringState) ElementType() reflect.Type {
return reflect.TypeOf((*peeringState)(nil)).Elem()
}
type peeringArgs struct {
// The properties that define a direct peering.
Direct *PeeringPropertiesDirect `pulumi:"direct"`
// The properties that define an exchange peering.
Exchange *PeeringPropertiesExchange `pulumi:"exchange"`
// The kind of the peering.
Kind string `pulumi:"kind"`
// The location of the resource.
Location *string `pulumi:"location"`
// The location of the peering.
PeeringLocation *string `pulumi:"peeringLocation"`
// The name of the peering.
PeeringName string `pulumi:"peeringName"`
// The name of the resource group.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The SKU that defines the tier and kind of the peering.
Sku PeeringSku `pulumi:"sku"`
// The resource tags.
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a Peering resource.
type PeeringArgs struct {
// The properties that define a direct peering.
Direct PeeringPropertiesDirectPtrInput
// The properties that define an exchange peering.
Exchange PeeringPropertiesExchangePtrInput
// The kind of the peering.
Kind pulumi.StringInput
// The location of the resource.
Location pulumi.StringPtrInput
// The location of the peering.
PeeringLocation pulumi.StringPtrInput
// The name of the peering.
PeeringName pulumi.StringInput
// The name of the resource group.
ResourceGroupName pulumi.StringInput
// The SKU that defines the tier and kind of the peering.
Sku PeeringSkuInput
// The resource tags.
Tags pulumi.StringMapInput
}
func (PeeringArgs) ElementType() reflect.Type {
return reflect.TypeOf((*peeringArgs)(nil)).Elem()
}
type PeeringInput interface {
pulumi.Input
ToPeeringOutput() PeeringOutput
ToPeeringOutputWithContext(ctx context.Context) PeeringOutput
}
func (*Peering) ElementType() reflect.Type {
return reflect.TypeOf((*Peering)(nil))
}
func (i *Peering) ToPeeringOutput() PeeringOutput {
return i.ToPeeringOutputWithContext(context.Background())
}
func (i *Peering) ToPeeringOutputWithContext(ctx context.Context) PeeringOutput {
return pulumi.ToOutputWithContext(ctx, i).(PeeringOutput)
}
type PeeringOutput struct {
*pulumi.OutputState
}
func (PeeringOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Peering)(nil))
}
func (o PeeringOutput) ToPeeringOutput() PeeringOutput {
return o
}
func (o PeeringOutput) ToPeeringOutputWithContext(ctx context.Context) PeeringOutput {
return o
}
func init() {
pulumi.RegisterOutputType(PeeringOutput{})
}