/
projectVpc.go
272 lines (222 loc) · 11 KB
/
projectVpc.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
// 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 Project VPC resource allows the creation and management of Aiven Project VPCs.
//
// ## Import
//
// ```sh
//
// $ pulumi import aiven:index/projectVpc:ProjectVpc myvpc project/id
//
// ```
type ProjectVpc struct {
pulumi.CustomResourceState
// Defines where the cloud provider and region where the service is hosted in. See the Service resource for additional information. This property cannot be changed, doing so forces recreation of the resource.
CloudName pulumi.StringOutput `pulumi:"cloudName"`
// Network address range used by the VPC like 192.168.0.0/24
NetworkCidr pulumi.StringOutput `pulumi:"networkCidr"`
// Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
Project pulumi.StringOutput `pulumi:"project"`
// State of the VPC. The possible values are `APPROVED`, `ACTIVE`, `DELETING` and `DELETED`.
State pulumi.StringOutput `pulumi:"state"`
}
// NewProjectVpc registers a new resource with the given unique name, arguments, and options.
func NewProjectVpc(ctx *pulumi.Context,
name string, args *ProjectVpcArgs, opts ...pulumi.ResourceOption) (*ProjectVpc, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.CloudName == nil {
return nil, errors.New("invalid value for required argument 'CloudName'")
}
if args.NetworkCidr == nil {
return nil, errors.New("invalid value for required argument 'NetworkCidr'")
}
if args.Project == nil {
return nil, errors.New("invalid value for required argument 'Project'")
}
var resource ProjectVpc
err := ctx.RegisterResource("aiven:index/projectVpc:ProjectVpc", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetProjectVpc gets an existing ProjectVpc 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 GetProjectVpc(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ProjectVpcState, opts ...pulumi.ResourceOption) (*ProjectVpc, error) {
var resource ProjectVpc
err := ctx.ReadResource("aiven:index/projectVpc:ProjectVpc", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ProjectVpc resources.
type projectVpcState struct {
// Defines where the cloud provider and region where the service is hosted in. See the Service resource for additional information. This property cannot be changed, doing so forces recreation of the resource.
CloudName *string `pulumi:"cloudName"`
// Network address range used by the VPC like 192.168.0.0/24
NetworkCidr *string `pulumi:"networkCidr"`
// Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
Project *string `pulumi:"project"`
// State of the VPC. The possible values are `APPROVED`, `ACTIVE`, `DELETING` and `DELETED`.
State *string `pulumi:"state"`
}
type ProjectVpcState struct {
// Defines where the cloud provider and region where the service is hosted in. See the Service resource for additional information. This property cannot be changed, doing so forces recreation of the resource.
CloudName pulumi.StringPtrInput
// Network address range used by the VPC like 192.168.0.0/24
NetworkCidr pulumi.StringPtrInput
// Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
Project pulumi.StringPtrInput
// State of the VPC. The possible values are `APPROVED`, `ACTIVE`, `DELETING` and `DELETED`.
State pulumi.StringPtrInput
}
func (ProjectVpcState) ElementType() reflect.Type {
return reflect.TypeOf((*projectVpcState)(nil)).Elem()
}
type projectVpcArgs struct {
// Defines where the cloud provider and region where the service is hosted in. See the Service resource for additional information. This property cannot be changed, doing so forces recreation of the resource.
CloudName string `pulumi:"cloudName"`
// Network address range used by the VPC like 192.168.0.0/24
NetworkCidr string `pulumi:"networkCidr"`
// Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
Project string `pulumi:"project"`
}
// The set of arguments for constructing a ProjectVpc resource.
type ProjectVpcArgs struct {
// Defines where the cloud provider and region where the service is hosted in. See the Service resource for additional information. This property cannot be changed, doing so forces recreation of the resource.
CloudName pulumi.StringInput
// Network address range used by the VPC like 192.168.0.0/24
NetworkCidr pulumi.StringInput
// Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
Project pulumi.StringInput
}
func (ProjectVpcArgs) ElementType() reflect.Type {
return reflect.TypeOf((*projectVpcArgs)(nil)).Elem()
}
type ProjectVpcInput interface {
pulumi.Input
ToProjectVpcOutput() ProjectVpcOutput
ToProjectVpcOutputWithContext(ctx context.Context) ProjectVpcOutput
}
func (*ProjectVpc) ElementType() reflect.Type {
return reflect.TypeOf((**ProjectVpc)(nil)).Elem()
}
func (i *ProjectVpc) ToProjectVpcOutput() ProjectVpcOutput {
return i.ToProjectVpcOutputWithContext(context.Background())
}
func (i *ProjectVpc) ToProjectVpcOutputWithContext(ctx context.Context) ProjectVpcOutput {
return pulumi.ToOutputWithContext(ctx, i).(ProjectVpcOutput)
}
// ProjectVpcArrayInput is an input type that accepts ProjectVpcArray and ProjectVpcArrayOutput values.
// You can construct a concrete instance of `ProjectVpcArrayInput` via:
//
// ProjectVpcArray{ ProjectVpcArgs{...} }
type ProjectVpcArrayInput interface {
pulumi.Input
ToProjectVpcArrayOutput() ProjectVpcArrayOutput
ToProjectVpcArrayOutputWithContext(context.Context) ProjectVpcArrayOutput
}
type ProjectVpcArray []ProjectVpcInput
func (ProjectVpcArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ProjectVpc)(nil)).Elem()
}
func (i ProjectVpcArray) ToProjectVpcArrayOutput() ProjectVpcArrayOutput {
return i.ToProjectVpcArrayOutputWithContext(context.Background())
}
func (i ProjectVpcArray) ToProjectVpcArrayOutputWithContext(ctx context.Context) ProjectVpcArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ProjectVpcArrayOutput)
}
// ProjectVpcMapInput is an input type that accepts ProjectVpcMap and ProjectVpcMapOutput values.
// You can construct a concrete instance of `ProjectVpcMapInput` via:
//
// ProjectVpcMap{ "key": ProjectVpcArgs{...} }
type ProjectVpcMapInput interface {
pulumi.Input
ToProjectVpcMapOutput() ProjectVpcMapOutput
ToProjectVpcMapOutputWithContext(context.Context) ProjectVpcMapOutput
}
type ProjectVpcMap map[string]ProjectVpcInput
func (ProjectVpcMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ProjectVpc)(nil)).Elem()
}
func (i ProjectVpcMap) ToProjectVpcMapOutput() ProjectVpcMapOutput {
return i.ToProjectVpcMapOutputWithContext(context.Background())
}
func (i ProjectVpcMap) ToProjectVpcMapOutputWithContext(ctx context.Context) ProjectVpcMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ProjectVpcMapOutput)
}
type ProjectVpcOutput struct{ *pulumi.OutputState }
func (ProjectVpcOutput) ElementType() reflect.Type {
return reflect.TypeOf((**ProjectVpc)(nil)).Elem()
}
func (o ProjectVpcOutput) ToProjectVpcOutput() ProjectVpcOutput {
return o
}
func (o ProjectVpcOutput) ToProjectVpcOutputWithContext(ctx context.Context) ProjectVpcOutput {
return o
}
// Defines where the cloud provider and region where the service is hosted in. See the Service resource for additional information. This property cannot be changed, doing so forces recreation of the resource.
func (o ProjectVpcOutput) CloudName() pulumi.StringOutput {
return o.ApplyT(func(v *ProjectVpc) pulumi.StringOutput { return v.CloudName }).(pulumi.StringOutput)
}
// Network address range used by the VPC like 192.168.0.0/24
func (o ProjectVpcOutput) NetworkCidr() pulumi.StringOutput {
return o.ApplyT(func(v *ProjectVpc) pulumi.StringOutput { return v.NetworkCidr }).(pulumi.StringOutput)
}
// Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
func (o ProjectVpcOutput) Project() pulumi.StringOutput {
return o.ApplyT(func(v *ProjectVpc) pulumi.StringOutput { return v.Project }).(pulumi.StringOutput)
}
// State of the VPC. The possible values are `APPROVED`, `ACTIVE`, `DELETING` and `DELETED`.
func (o ProjectVpcOutput) State() pulumi.StringOutput {
return o.ApplyT(func(v *ProjectVpc) pulumi.StringOutput { return v.State }).(pulumi.StringOutput)
}
type ProjectVpcArrayOutput struct{ *pulumi.OutputState }
func (ProjectVpcArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ProjectVpc)(nil)).Elem()
}
func (o ProjectVpcArrayOutput) ToProjectVpcArrayOutput() ProjectVpcArrayOutput {
return o
}
func (o ProjectVpcArrayOutput) ToProjectVpcArrayOutputWithContext(ctx context.Context) ProjectVpcArrayOutput {
return o
}
func (o ProjectVpcArrayOutput) Index(i pulumi.IntInput) ProjectVpcOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ProjectVpc {
return vs[0].([]*ProjectVpc)[vs[1].(int)]
}).(ProjectVpcOutput)
}
type ProjectVpcMapOutput struct{ *pulumi.OutputState }
func (ProjectVpcMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ProjectVpc)(nil)).Elem()
}
func (o ProjectVpcMapOutput) ToProjectVpcMapOutput() ProjectVpcMapOutput {
return o
}
func (o ProjectVpcMapOutput) ToProjectVpcMapOutputWithContext(ctx context.Context) ProjectVpcMapOutput {
return o
}
func (o ProjectVpcMapOutput) MapIndex(k pulumi.StringInput) ProjectVpcOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ProjectVpc {
return vs[0].(map[string]*ProjectVpc)[vs[1].(string)]
}).(ProjectVpcOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ProjectVpcInput)(nil)).Elem(), &ProjectVpc{})
pulumi.RegisterInputType(reflect.TypeOf((*ProjectVpcArrayInput)(nil)).Elem(), ProjectVpcArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ProjectVpcMapInput)(nil)).Elem(), ProjectVpcMap{})
pulumi.RegisterOutputType(ProjectVpcOutput{})
pulumi.RegisterOutputType(ProjectVpcArrayOutput{})
pulumi.RegisterOutputType(ProjectVpcMapOutput{})
}