-
Notifications
You must be signed in to change notification settings - Fork 151
/
vpcEndpointService.go
392 lines (332 loc) · 18.3 KB
/
vpcEndpointService.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
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package ec2
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a VPC Endpoint Service resource.
// Service consumers can create an _Interface_ VPC Endpoint to connect to the service.
//
// > **NOTE on VPC Endpoint Services and VPC Endpoint Service Allowed Principals:** This provider provides
// both a standalone VPC Endpoint Service Allowed Principal resource
// and a VPC Endpoint Service resource with an `allowedPrincipals` attribute. Do not use the same principal ARN in both
// a VPC Endpoint Service resource and a VPC Endpoint Service Allowed Principal resource. Doing so will cause a conflict
// and will overwrite the association.
//
// ## Example Usage
//
// ## Import
//
// VPC Endpoint Services can be imported using the `VPC endpoint service id`, e.g.
//
// ```sh
// $ pulumi import aws:ec2/vpcEndpointService:VpcEndpointService foo vpce-svc-0f97a19d3fa8220bc
// ```
type VpcEndpointService struct {
pulumi.CustomResourceState
// Whether or not VPC endpoint connection requests to the service must be accepted by the service owner - `true` or `false`.
AcceptanceRequired pulumi.BoolOutput `pulumi:"acceptanceRequired"`
// The ARNs of one or more principals allowed to discover the endpoint service.
AllowedPrincipals pulumi.StringArrayOutput `pulumi:"allowedPrincipals"`
// The Amazon Resource Name (ARN) of the VPC endpoint service.
Arn pulumi.StringOutput `pulumi:"arn"`
// The Availability Zones in which the service is available.
AvailabilityZones pulumi.StringArrayOutput `pulumi:"availabilityZones"`
// The DNS names for the service.
BaseEndpointDnsNames pulumi.StringArrayOutput `pulumi:"baseEndpointDnsNames"`
// Amazon Resource Names (ARNs) of one or more Gateway Load Balancers for the endpoint service.
GatewayLoadBalancerArns pulumi.StringArrayOutput `pulumi:"gatewayLoadBalancerArns"`
// Whether or not the service manages its VPC endpoints - `true` or `false`.
ManagesVpcEndpoints pulumi.BoolOutput `pulumi:"managesVpcEndpoints"`
// Amazon Resource Names (ARNs) of one or more Network Load Balancers for the endpoint service.
NetworkLoadBalancerArns pulumi.StringArrayOutput `pulumi:"networkLoadBalancerArns"`
// The private DNS name for the service.
PrivateDnsName pulumi.StringOutput `pulumi:"privateDnsName"`
// List of objects containing information about the endpoint service private DNS name configuration.
PrivateDnsNameConfigurations VpcEndpointServicePrivateDnsNameConfigurationArrayOutput `pulumi:"privateDnsNameConfigurations"`
// The service name.
ServiceName pulumi.StringOutput `pulumi:"serviceName"`
// The service type, `Gateway` or `Interface`.
ServiceType pulumi.StringOutput `pulumi:"serviceType"`
// Verification state of the VPC endpoint service. Consumers of the endpoint service can use the private name only when the state is `verified`.
State pulumi.StringOutput `pulumi:"state"`
// A map of tags to assign to the resource. If configured with a provider [`defaultTags` configuration block](https://www.terraform.io/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// A map of tags assigned to the resource, including those inherited from the provider .
TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
}
// NewVpcEndpointService registers a new resource with the given unique name, arguments, and options.
func NewVpcEndpointService(ctx *pulumi.Context,
name string, args *VpcEndpointServiceArgs, opts ...pulumi.ResourceOption) (*VpcEndpointService, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AcceptanceRequired == nil {
return nil, errors.New("invalid value for required argument 'AcceptanceRequired'")
}
var resource VpcEndpointService
err := ctx.RegisterResource("aws:ec2/vpcEndpointService:VpcEndpointService", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetVpcEndpointService gets an existing VpcEndpointService 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 GetVpcEndpointService(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *VpcEndpointServiceState, opts ...pulumi.ResourceOption) (*VpcEndpointService, error) {
var resource VpcEndpointService
err := ctx.ReadResource("aws:ec2/vpcEndpointService:VpcEndpointService", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering VpcEndpointService resources.
type vpcEndpointServiceState struct {
// Whether or not VPC endpoint connection requests to the service must be accepted by the service owner - `true` or `false`.
AcceptanceRequired *bool `pulumi:"acceptanceRequired"`
// The ARNs of one or more principals allowed to discover the endpoint service.
AllowedPrincipals []string `pulumi:"allowedPrincipals"`
// The Amazon Resource Name (ARN) of the VPC endpoint service.
Arn *string `pulumi:"arn"`
// The Availability Zones in which the service is available.
AvailabilityZones []string `pulumi:"availabilityZones"`
// The DNS names for the service.
BaseEndpointDnsNames []string `pulumi:"baseEndpointDnsNames"`
// Amazon Resource Names (ARNs) of one or more Gateway Load Balancers for the endpoint service.
GatewayLoadBalancerArns []string `pulumi:"gatewayLoadBalancerArns"`
// Whether or not the service manages its VPC endpoints - `true` or `false`.
ManagesVpcEndpoints *bool `pulumi:"managesVpcEndpoints"`
// Amazon Resource Names (ARNs) of one or more Network Load Balancers for the endpoint service.
NetworkLoadBalancerArns []string `pulumi:"networkLoadBalancerArns"`
// The private DNS name for the service.
PrivateDnsName *string `pulumi:"privateDnsName"`
// List of objects containing information about the endpoint service private DNS name configuration.
PrivateDnsNameConfigurations []VpcEndpointServicePrivateDnsNameConfiguration `pulumi:"privateDnsNameConfigurations"`
// The service name.
ServiceName *string `pulumi:"serviceName"`
// The service type, `Gateway` or `Interface`.
ServiceType *string `pulumi:"serviceType"`
// Verification state of the VPC endpoint service. Consumers of the endpoint service can use the private name only when the state is `verified`.
State *string `pulumi:"state"`
// A map of tags to assign to the resource. If configured with a provider [`defaultTags` configuration block](https://www.terraform.io/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level.
Tags map[string]string `pulumi:"tags"`
// A map of tags assigned to the resource, including those inherited from the provider .
TagsAll map[string]string `pulumi:"tagsAll"`
}
type VpcEndpointServiceState struct {
// Whether or not VPC endpoint connection requests to the service must be accepted by the service owner - `true` or `false`.
AcceptanceRequired pulumi.BoolPtrInput
// The ARNs of one or more principals allowed to discover the endpoint service.
AllowedPrincipals pulumi.StringArrayInput
// The Amazon Resource Name (ARN) of the VPC endpoint service.
Arn pulumi.StringPtrInput
// The Availability Zones in which the service is available.
AvailabilityZones pulumi.StringArrayInput
// The DNS names for the service.
BaseEndpointDnsNames pulumi.StringArrayInput
// Amazon Resource Names (ARNs) of one or more Gateway Load Balancers for the endpoint service.
GatewayLoadBalancerArns pulumi.StringArrayInput
// Whether or not the service manages its VPC endpoints - `true` or `false`.
ManagesVpcEndpoints pulumi.BoolPtrInput
// Amazon Resource Names (ARNs) of one or more Network Load Balancers for the endpoint service.
NetworkLoadBalancerArns pulumi.StringArrayInput
// The private DNS name for the service.
PrivateDnsName pulumi.StringPtrInput
// List of objects containing information about the endpoint service private DNS name configuration.
PrivateDnsNameConfigurations VpcEndpointServicePrivateDnsNameConfigurationArrayInput
// The service name.
ServiceName pulumi.StringPtrInput
// The service type, `Gateway` or `Interface`.
ServiceType pulumi.StringPtrInput
// Verification state of the VPC endpoint service. Consumers of the endpoint service can use the private name only when the state is `verified`.
State pulumi.StringPtrInput
// A map of tags to assign to the resource. If configured with a provider [`defaultTags` configuration block](https://www.terraform.io/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapInput
// A map of tags assigned to the resource, including those inherited from the provider .
TagsAll pulumi.StringMapInput
}
func (VpcEndpointServiceState) ElementType() reflect.Type {
return reflect.TypeOf((*vpcEndpointServiceState)(nil)).Elem()
}
type vpcEndpointServiceArgs struct {
// Whether or not VPC endpoint connection requests to the service must be accepted by the service owner - `true` or `false`.
AcceptanceRequired bool `pulumi:"acceptanceRequired"`
// The ARNs of one or more principals allowed to discover the endpoint service.
AllowedPrincipals []string `pulumi:"allowedPrincipals"`
// Amazon Resource Names (ARNs) of one or more Gateway Load Balancers for the endpoint service.
GatewayLoadBalancerArns []string `pulumi:"gatewayLoadBalancerArns"`
// Amazon Resource Names (ARNs) of one or more Network Load Balancers for the endpoint service.
NetworkLoadBalancerArns []string `pulumi:"networkLoadBalancerArns"`
// The private DNS name for the service.
PrivateDnsName *string `pulumi:"privateDnsName"`
// A map of tags to assign to the resource. If configured with a provider [`defaultTags` configuration block](https://www.terraform.io/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level.
Tags map[string]string `pulumi:"tags"`
// A map of tags assigned to the resource, including those inherited from the provider .
TagsAll map[string]string `pulumi:"tagsAll"`
}
// The set of arguments for constructing a VpcEndpointService resource.
type VpcEndpointServiceArgs struct {
// Whether or not VPC endpoint connection requests to the service must be accepted by the service owner - `true` or `false`.
AcceptanceRequired pulumi.BoolInput
// The ARNs of one or more principals allowed to discover the endpoint service.
AllowedPrincipals pulumi.StringArrayInput
// Amazon Resource Names (ARNs) of one or more Gateway Load Balancers for the endpoint service.
GatewayLoadBalancerArns pulumi.StringArrayInput
// Amazon Resource Names (ARNs) of one or more Network Load Balancers for the endpoint service.
NetworkLoadBalancerArns pulumi.StringArrayInput
// The private DNS name for the service.
PrivateDnsName pulumi.StringPtrInput
// A map of tags to assign to the resource. If configured with a provider [`defaultTags` configuration block](https://www.terraform.io/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapInput
// A map of tags assigned to the resource, including those inherited from the provider .
TagsAll pulumi.StringMapInput
}
func (VpcEndpointServiceArgs) ElementType() reflect.Type {
return reflect.TypeOf((*vpcEndpointServiceArgs)(nil)).Elem()
}
type VpcEndpointServiceInput interface {
pulumi.Input
ToVpcEndpointServiceOutput() VpcEndpointServiceOutput
ToVpcEndpointServiceOutputWithContext(ctx context.Context) VpcEndpointServiceOutput
}
func (*VpcEndpointService) ElementType() reflect.Type {
return reflect.TypeOf((*VpcEndpointService)(nil))
}
func (i *VpcEndpointService) ToVpcEndpointServiceOutput() VpcEndpointServiceOutput {
return i.ToVpcEndpointServiceOutputWithContext(context.Background())
}
func (i *VpcEndpointService) ToVpcEndpointServiceOutputWithContext(ctx context.Context) VpcEndpointServiceOutput {
return pulumi.ToOutputWithContext(ctx, i).(VpcEndpointServiceOutput)
}
func (i *VpcEndpointService) ToVpcEndpointServicePtrOutput() VpcEndpointServicePtrOutput {
return i.ToVpcEndpointServicePtrOutputWithContext(context.Background())
}
func (i *VpcEndpointService) ToVpcEndpointServicePtrOutputWithContext(ctx context.Context) VpcEndpointServicePtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(VpcEndpointServicePtrOutput)
}
type VpcEndpointServicePtrInput interface {
pulumi.Input
ToVpcEndpointServicePtrOutput() VpcEndpointServicePtrOutput
ToVpcEndpointServicePtrOutputWithContext(ctx context.Context) VpcEndpointServicePtrOutput
}
type vpcEndpointServicePtrType VpcEndpointServiceArgs
func (*vpcEndpointServicePtrType) ElementType() reflect.Type {
return reflect.TypeOf((**VpcEndpointService)(nil))
}
func (i *vpcEndpointServicePtrType) ToVpcEndpointServicePtrOutput() VpcEndpointServicePtrOutput {
return i.ToVpcEndpointServicePtrOutputWithContext(context.Background())
}
func (i *vpcEndpointServicePtrType) ToVpcEndpointServicePtrOutputWithContext(ctx context.Context) VpcEndpointServicePtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(VpcEndpointServicePtrOutput)
}
// VpcEndpointServiceArrayInput is an input type that accepts VpcEndpointServiceArray and VpcEndpointServiceArrayOutput values.
// You can construct a concrete instance of `VpcEndpointServiceArrayInput` via:
//
// VpcEndpointServiceArray{ VpcEndpointServiceArgs{...} }
type VpcEndpointServiceArrayInput interface {
pulumi.Input
ToVpcEndpointServiceArrayOutput() VpcEndpointServiceArrayOutput
ToVpcEndpointServiceArrayOutputWithContext(context.Context) VpcEndpointServiceArrayOutput
}
type VpcEndpointServiceArray []VpcEndpointServiceInput
func (VpcEndpointServiceArray) ElementType() reflect.Type {
return reflect.TypeOf(([]*VpcEndpointService)(nil))
}
func (i VpcEndpointServiceArray) ToVpcEndpointServiceArrayOutput() VpcEndpointServiceArrayOutput {
return i.ToVpcEndpointServiceArrayOutputWithContext(context.Background())
}
func (i VpcEndpointServiceArray) ToVpcEndpointServiceArrayOutputWithContext(ctx context.Context) VpcEndpointServiceArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(VpcEndpointServiceArrayOutput)
}
// VpcEndpointServiceMapInput is an input type that accepts VpcEndpointServiceMap and VpcEndpointServiceMapOutput values.
// You can construct a concrete instance of `VpcEndpointServiceMapInput` via:
//
// VpcEndpointServiceMap{ "key": VpcEndpointServiceArgs{...} }
type VpcEndpointServiceMapInput interface {
pulumi.Input
ToVpcEndpointServiceMapOutput() VpcEndpointServiceMapOutput
ToVpcEndpointServiceMapOutputWithContext(context.Context) VpcEndpointServiceMapOutput
}
type VpcEndpointServiceMap map[string]VpcEndpointServiceInput
func (VpcEndpointServiceMap) ElementType() reflect.Type {
return reflect.TypeOf((map[string]*VpcEndpointService)(nil))
}
func (i VpcEndpointServiceMap) ToVpcEndpointServiceMapOutput() VpcEndpointServiceMapOutput {
return i.ToVpcEndpointServiceMapOutputWithContext(context.Background())
}
func (i VpcEndpointServiceMap) ToVpcEndpointServiceMapOutputWithContext(ctx context.Context) VpcEndpointServiceMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(VpcEndpointServiceMapOutput)
}
type VpcEndpointServiceOutput struct {
*pulumi.OutputState
}
func (VpcEndpointServiceOutput) ElementType() reflect.Type {
return reflect.TypeOf((*VpcEndpointService)(nil))
}
func (o VpcEndpointServiceOutput) ToVpcEndpointServiceOutput() VpcEndpointServiceOutput {
return o
}
func (o VpcEndpointServiceOutput) ToVpcEndpointServiceOutputWithContext(ctx context.Context) VpcEndpointServiceOutput {
return o
}
func (o VpcEndpointServiceOutput) ToVpcEndpointServicePtrOutput() VpcEndpointServicePtrOutput {
return o.ToVpcEndpointServicePtrOutputWithContext(context.Background())
}
func (o VpcEndpointServiceOutput) ToVpcEndpointServicePtrOutputWithContext(ctx context.Context) VpcEndpointServicePtrOutput {
return o.ApplyT(func(v VpcEndpointService) *VpcEndpointService {
return &v
}).(VpcEndpointServicePtrOutput)
}
type VpcEndpointServicePtrOutput struct {
*pulumi.OutputState
}
func (VpcEndpointServicePtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**VpcEndpointService)(nil))
}
func (o VpcEndpointServicePtrOutput) ToVpcEndpointServicePtrOutput() VpcEndpointServicePtrOutput {
return o
}
func (o VpcEndpointServicePtrOutput) ToVpcEndpointServicePtrOutputWithContext(ctx context.Context) VpcEndpointServicePtrOutput {
return o
}
type VpcEndpointServiceArrayOutput struct{ *pulumi.OutputState }
func (VpcEndpointServiceArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]VpcEndpointService)(nil))
}
func (o VpcEndpointServiceArrayOutput) ToVpcEndpointServiceArrayOutput() VpcEndpointServiceArrayOutput {
return o
}
func (o VpcEndpointServiceArrayOutput) ToVpcEndpointServiceArrayOutputWithContext(ctx context.Context) VpcEndpointServiceArrayOutput {
return o
}
func (o VpcEndpointServiceArrayOutput) Index(i pulumi.IntInput) VpcEndpointServiceOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) VpcEndpointService {
return vs[0].([]VpcEndpointService)[vs[1].(int)]
}).(VpcEndpointServiceOutput)
}
type VpcEndpointServiceMapOutput struct{ *pulumi.OutputState }
func (VpcEndpointServiceMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]VpcEndpointService)(nil))
}
func (o VpcEndpointServiceMapOutput) ToVpcEndpointServiceMapOutput() VpcEndpointServiceMapOutput {
return o
}
func (o VpcEndpointServiceMapOutput) ToVpcEndpointServiceMapOutputWithContext(ctx context.Context) VpcEndpointServiceMapOutput {
return o
}
func (o VpcEndpointServiceMapOutput) MapIndex(k pulumi.StringInput) VpcEndpointServiceOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) VpcEndpointService {
return vs[0].(map[string]VpcEndpointService)[vs[1].(string)]
}).(VpcEndpointServiceOutput)
}
func init() {
pulumi.RegisterOutputType(VpcEndpointServiceOutput{})
pulumi.RegisterOutputType(VpcEndpointServicePtrOutput{})
pulumi.RegisterOutputType(VpcEndpointServiceArrayOutput{})
pulumi.RegisterOutputType(VpcEndpointServiceMapOutput{})
}