/
gcpVpcPeeringConnection.go
311 lines (260 loc) · 12.7 KB
/
gcpVpcPeeringConnection.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
// 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 aiven
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// The GCP VPC Peering Connection resource allows the creation and management of Aiven GCP VPC Peering Connections.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aiven/sdk/v5/go/aiven"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := aiven.NewGcpVpcPeeringConnection(ctx, "foo", &aiven.GcpVpcPeeringConnectionArgs{
// VpcId: pulumi.Any(data.Aiven_project_vpc.Vpc.Id),
// GcpProjectId: pulumi.String("xxxx"),
// PeerVpc: pulumi.String("xxxx"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// ```sh
//
// $ pulumi import aiven:index/gcpVpcPeeringConnection:GcpVpcPeeringConnection foo project_name/vpc_id/gcp_project_id/peer_vpc
//
// ```
type GcpVpcPeeringConnection struct {
pulumi.CustomResourceState
// GCP project ID. This property cannot be changed, doing so forces recreation of the resource.
GcpProjectId pulumi.StringOutput `pulumi:"gcpProjectId"`
// GCP VPC network name. This property cannot be changed, doing so forces recreation of the resource.
PeerVpc pulumi.StringOutput `pulumi:"peerVpc"`
// State of the peering connection
State pulumi.StringOutput `pulumi:"state"`
// State-specific help or error information
StateInfo pulumi.MapOutput `pulumi:"stateInfo"`
// The VPC the peering connection belongs to. This property cannot be changed, doing so forces recreation of the resource.
VpcId pulumi.StringOutput `pulumi:"vpcId"`
}
// NewGcpVpcPeeringConnection registers a new resource with the given unique name, arguments, and options.
func NewGcpVpcPeeringConnection(ctx *pulumi.Context,
name string, args *GcpVpcPeeringConnectionArgs, opts ...pulumi.ResourceOption) (*GcpVpcPeeringConnection, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.GcpProjectId == nil {
return nil, errors.New("invalid value for required argument 'GcpProjectId'")
}
if args.PeerVpc == nil {
return nil, errors.New("invalid value for required argument 'PeerVpc'")
}
if args.VpcId == nil {
return nil, errors.New("invalid value for required argument 'VpcId'")
}
var resource GcpVpcPeeringConnection
err := ctx.RegisterResource("aiven:index/gcpVpcPeeringConnection:GcpVpcPeeringConnection", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetGcpVpcPeeringConnection gets an existing GcpVpcPeeringConnection 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 GetGcpVpcPeeringConnection(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *GcpVpcPeeringConnectionState, opts ...pulumi.ResourceOption) (*GcpVpcPeeringConnection, error) {
var resource GcpVpcPeeringConnection
err := ctx.ReadResource("aiven:index/gcpVpcPeeringConnection:GcpVpcPeeringConnection", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering GcpVpcPeeringConnection resources.
type gcpVpcPeeringConnectionState struct {
// GCP project ID. This property cannot be changed, doing so forces recreation of the resource.
GcpProjectId *string `pulumi:"gcpProjectId"`
// GCP VPC network name. This property cannot be changed, doing so forces recreation of the resource.
PeerVpc *string `pulumi:"peerVpc"`
// State of the peering connection
State *string `pulumi:"state"`
// State-specific help or error information
StateInfo map[string]interface{} `pulumi:"stateInfo"`
// The VPC the peering connection belongs to. This property cannot be changed, doing so forces recreation of the resource.
VpcId *string `pulumi:"vpcId"`
}
type GcpVpcPeeringConnectionState struct {
// GCP project ID. This property cannot be changed, doing so forces recreation of the resource.
GcpProjectId pulumi.StringPtrInput
// GCP VPC network name. This property cannot be changed, doing so forces recreation of the resource.
PeerVpc pulumi.StringPtrInput
// State of the peering connection
State pulumi.StringPtrInput
// State-specific help or error information
StateInfo pulumi.MapInput
// The VPC the peering connection belongs to. This property cannot be changed, doing so forces recreation of the resource.
VpcId pulumi.StringPtrInput
}
func (GcpVpcPeeringConnectionState) ElementType() reflect.Type {
return reflect.TypeOf((*gcpVpcPeeringConnectionState)(nil)).Elem()
}
type gcpVpcPeeringConnectionArgs struct {
// GCP project ID. This property cannot be changed, doing so forces recreation of the resource.
GcpProjectId string `pulumi:"gcpProjectId"`
// GCP VPC network name. This property cannot be changed, doing so forces recreation of the resource.
PeerVpc string `pulumi:"peerVpc"`
// The VPC the peering connection belongs to. This property cannot be changed, doing so forces recreation of the resource.
VpcId string `pulumi:"vpcId"`
}
// The set of arguments for constructing a GcpVpcPeeringConnection resource.
type GcpVpcPeeringConnectionArgs struct {
// GCP project ID. This property cannot be changed, doing so forces recreation of the resource.
GcpProjectId pulumi.StringInput
// GCP VPC network name. This property cannot be changed, doing so forces recreation of the resource.
PeerVpc pulumi.StringInput
// The VPC the peering connection belongs to. This property cannot be changed, doing so forces recreation of the resource.
VpcId pulumi.StringInput
}
func (GcpVpcPeeringConnectionArgs) ElementType() reflect.Type {
return reflect.TypeOf((*gcpVpcPeeringConnectionArgs)(nil)).Elem()
}
type GcpVpcPeeringConnectionInput interface {
pulumi.Input
ToGcpVpcPeeringConnectionOutput() GcpVpcPeeringConnectionOutput
ToGcpVpcPeeringConnectionOutputWithContext(ctx context.Context) GcpVpcPeeringConnectionOutput
}
func (*GcpVpcPeeringConnection) ElementType() reflect.Type {
return reflect.TypeOf((**GcpVpcPeeringConnection)(nil)).Elem()
}
func (i *GcpVpcPeeringConnection) ToGcpVpcPeeringConnectionOutput() GcpVpcPeeringConnectionOutput {
return i.ToGcpVpcPeeringConnectionOutputWithContext(context.Background())
}
func (i *GcpVpcPeeringConnection) ToGcpVpcPeeringConnectionOutputWithContext(ctx context.Context) GcpVpcPeeringConnectionOutput {
return pulumi.ToOutputWithContext(ctx, i).(GcpVpcPeeringConnectionOutput)
}
// GcpVpcPeeringConnectionArrayInput is an input type that accepts GcpVpcPeeringConnectionArray and GcpVpcPeeringConnectionArrayOutput values.
// You can construct a concrete instance of `GcpVpcPeeringConnectionArrayInput` via:
//
// GcpVpcPeeringConnectionArray{ GcpVpcPeeringConnectionArgs{...} }
type GcpVpcPeeringConnectionArrayInput interface {
pulumi.Input
ToGcpVpcPeeringConnectionArrayOutput() GcpVpcPeeringConnectionArrayOutput
ToGcpVpcPeeringConnectionArrayOutputWithContext(context.Context) GcpVpcPeeringConnectionArrayOutput
}
type GcpVpcPeeringConnectionArray []GcpVpcPeeringConnectionInput
func (GcpVpcPeeringConnectionArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*GcpVpcPeeringConnection)(nil)).Elem()
}
func (i GcpVpcPeeringConnectionArray) ToGcpVpcPeeringConnectionArrayOutput() GcpVpcPeeringConnectionArrayOutput {
return i.ToGcpVpcPeeringConnectionArrayOutputWithContext(context.Background())
}
func (i GcpVpcPeeringConnectionArray) ToGcpVpcPeeringConnectionArrayOutputWithContext(ctx context.Context) GcpVpcPeeringConnectionArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(GcpVpcPeeringConnectionArrayOutput)
}
// GcpVpcPeeringConnectionMapInput is an input type that accepts GcpVpcPeeringConnectionMap and GcpVpcPeeringConnectionMapOutput values.
// You can construct a concrete instance of `GcpVpcPeeringConnectionMapInput` via:
//
// GcpVpcPeeringConnectionMap{ "key": GcpVpcPeeringConnectionArgs{...} }
type GcpVpcPeeringConnectionMapInput interface {
pulumi.Input
ToGcpVpcPeeringConnectionMapOutput() GcpVpcPeeringConnectionMapOutput
ToGcpVpcPeeringConnectionMapOutputWithContext(context.Context) GcpVpcPeeringConnectionMapOutput
}
type GcpVpcPeeringConnectionMap map[string]GcpVpcPeeringConnectionInput
func (GcpVpcPeeringConnectionMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*GcpVpcPeeringConnection)(nil)).Elem()
}
func (i GcpVpcPeeringConnectionMap) ToGcpVpcPeeringConnectionMapOutput() GcpVpcPeeringConnectionMapOutput {
return i.ToGcpVpcPeeringConnectionMapOutputWithContext(context.Background())
}
func (i GcpVpcPeeringConnectionMap) ToGcpVpcPeeringConnectionMapOutputWithContext(ctx context.Context) GcpVpcPeeringConnectionMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(GcpVpcPeeringConnectionMapOutput)
}
type GcpVpcPeeringConnectionOutput struct{ *pulumi.OutputState }
func (GcpVpcPeeringConnectionOutput) ElementType() reflect.Type {
return reflect.TypeOf((**GcpVpcPeeringConnection)(nil)).Elem()
}
func (o GcpVpcPeeringConnectionOutput) ToGcpVpcPeeringConnectionOutput() GcpVpcPeeringConnectionOutput {
return o
}
func (o GcpVpcPeeringConnectionOutput) ToGcpVpcPeeringConnectionOutputWithContext(ctx context.Context) GcpVpcPeeringConnectionOutput {
return o
}
// GCP project ID. This property cannot be changed, doing so forces recreation of the resource.
func (o GcpVpcPeeringConnectionOutput) GcpProjectId() pulumi.StringOutput {
return o.ApplyT(func(v *GcpVpcPeeringConnection) pulumi.StringOutput { return v.GcpProjectId }).(pulumi.StringOutput)
}
// GCP VPC network name. This property cannot be changed, doing so forces recreation of the resource.
func (o GcpVpcPeeringConnectionOutput) PeerVpc() pulumi.StringOutput {
return o.ApplyT(func(v *GcpVpcPeeringConnection) pulumi.StringOutput { return v.PeerVpc }).(pulumi.StringOutput)
}
// State of the peering connection
func (o GcpVpcPeeringConnectionOutput) State() pulumi.StringOutput {
return o.ApplyT(func(v *GcpVpcPeeringConnection) pulumi.StringOutput { return v.State }).(pulumi.StringOutput)
}
// State-specific help or error information
func (o GcpVpcPeeringConnectionOutput) StateInfo() pulumi.MapOutput {
return o.ApplyT(func(v *GcpVpcPeeringConnection) pulumi.MapOutput { return v.StateInfo }).(pulumi.MapOutput)
}
// The VPC the peering connection belongs to. This property cannot be changed, doing so forces recreation of the resource.
func (o GcpVpcPeeringConnectionOutput) VpcId() pulumi.StringOutput {
return o.ApplyT(func(v *GcpVpcPeeringConnection) pulumi.StringOutput { return v.VpcId }).(pulumi.StringOutput)
}
type GcpVpcPeeringConnectionArrayOutput struct{ *pulumi.OutputState }
func (GcpVpcPeeringConnectionArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*GcpVpcPeeringConnection)(nil)).Elem()
}
func (o GcpVpcPeeringConnectionArrayOutput) ToGcpVpcPeeringConnectionArrayOutput() GcpVpcPeeringConnectionArrayOutput {
return o
}
func (o GcpVpcPeeringConnectionArrayOutput) ToGcpVpcPeeringConnectionArrayOutputWithContext(ctx context.Context) GcpVpcPeeringConnectionArrayOutput {
return o
}
func (o GcpVpcPeeringConnectionArrayOutput) Index(i pulumi.IntInput) GcpVpcPeeringConnectionOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *GcpVpcPeeringConnection {
return vs[0].([]*GcpVpcPeeringConnection)[vs[1].(int)]
}).(GcpVpcPeeringConnectionOutput)
}
type GcpVpcPeeringConnectionMapOutput struct{ *pulumi.OutputState }
func (GcpVpcPeeringConnectionMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*GcpVpcPeeringConnection)(nil)).Elem()
}
func (o GcpVpcPeeringConnectionMapOutput) ToGcpVpcPeeringConnectionMapOutput() GcpVpcPeeringConnectionMapOutput {
return o
}
func (o GcpVpcPeeringConnectionMapOutput) ToGcpVpcPeeringConnectionMapOutputWithContext(ctx context.Context) GcpVpcPeeringConnectionMapOutput {
return o
}
func (o GcpVpcPeeringConnectionMapOutput) MapIndex(k pulumi.StringInput) GcpVpcPeeringConnectionOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *GcpVpcPeeringConnection {
return vs[0].(map[string]*GcpVpcPeeringConnection)[vs[1].(string)]
}).(GcpVpcPeeringConnectionOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*GcpVpcPeeringConnectionInput)(nil)).Elem(), &GcpVpcPeeringConnection{})
pulumi.RegisterInputType(reflect.TypeOf((*GcpVpcPeeringConnectionArrayInput)(nil)).Elem(), GcpVpcPeeringConnectionArray{})
pulumi.RegisterInputType(reflect.TypeOf((*GcpVpcPeeringConnectionMapInput)(nil)).Elem(), GcpVpcPeeringConnectionMap{})
pulumi.RegisterOutputType(GcpVpcPeeringConnectionOutput{})
pulumi.RegisterOutputType(GcpVpcPeeringConnectionArrayOutput{})
pulumi.RegisterOutputType(GcpVpcPeeringConnectionMapOutput{})
}