-
Notifications
You must be signed in to change notification settings - Fork 151
/
getVpcEndpointService.go
275 lines (246 loc) · 10.9 KB
/
getVpcEndpointService.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
// *** 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/pulumi/pulumi/sdk/v3/go/pulumi"
)
// The VPC Endpoint Service data source details about a specific service that
// can be specified when creating a VPC endpoint within the region configured in the provider.
//
// ## Example Usage
// ### AWS Service
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// opt0 := "s3"
// opt1 := "Gateway"
// s3, err := ec2.LookupVpcEndpointService(ctx, &ec2.LookupVpcEndpointServiceArgs{
// Service: &opt0,
// ServiceType: &opt1,
// }, nil)
// if err != nil {
// return err
// }
// foo, err := ec2.NewVpc(ctx, "foo", &ec2.VpcArgs{
// CidrBlock: pulumi.String("10.0.0.0/16"),
// })
// if err != nil {
// return err
// }
// _, err = ec2.NewVpcEndpoint(ctx, "ep", &ec2.VpcEndpointArgs{
// VpcId: foo.ID(),
// ServiceName: pulumi.String(s3.ServiceName),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
// ### Non-AWS Service
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// opt0 := "com.amazonaws.vpce.us-west-2.vpce-svc-0e87519c997c63cd8"
// _, err := ec2.LookupVpcEndpointService(ctx, &ec2.LookupVpcEndpointServiceArgs{
// ServiceName: &opt0,
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
// ### Filter
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := ec2.LookupVpcEndpointService(ctx, &ec2.LookupVpcEndpointServiceArgs{
// Filters: []ec2.GetVpcEndpointServiceFilter{
// ec2.GetVpcEndpointServiceFilter{
// Name: "service-name",
// Values: []string{
// "some-service",
// },
// },
// },
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
func LookupVpcEndpointService(ctx *pulumi.Context, args *LookupVpcEndpointServiceArgs, opts ...pulumi.InvokeOption) (*LookupVpcEndpointServiceResult, error) {
var rv LookupVpcEndpointServiceResult
err := ctx.Invoke("aws:ec2/getVpcEndpointService:getVpcEndpointService", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getVpcEndpointService.
type LookupVpcEndpointServiceArgs struct {
// Configuration block(s) for filtering. Detailed below.
Filters []GetVpcEndpointServiceFilter `pulumi:"filters"`
// The common name of an AWS service (e.g., `s3`).
Service *string `pulumi:"service"`
// The service name that is specified when creating a VPC endpoint. For AWS services the service name is usually in the form `com.amazonaws.<region>.<service>` (the SageMaker Notebook service is an exception to this rule, the service name is in the form `aws.sagemaker.<region>.notebook`).
ServiceName *string `pulumi:"serviceName"`
// The service type, `Gateway` or `Interface`.
ServiceType *string `pulumi:"serviceType"`
// A map of tags, each pair of which must exactly match a pair on the desired VPC Endpoint Service.
Tags map[string]string `pulumi:"tags"`
}
// A collection of values returned by getVpcEndpointService.
type LookupVpcEndpointServiceResult 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 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"`
Filters []GetVpcEndpointServiceFilter `pulumi:"filters"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// Whether or not the service manages its VPC endpoints - `true` or `false`.
ManagesVpcEndpoints bool `pulumi:"managesVpcEndpoints"`
// The AWS account ID of the service owner or `amazon`.
Owner string `pulumi:"owner"`
// The private DNS name for the service.
PrivateDnsName string `pulumi:"privateDnsName"`
Service *string `pulumi:"service"`
// The ID of the endpoint service.
ServiceId string `pulumi:"serviceId"`
ServiceName string `pulumi:"serviceName"`
ServiceType string `pulumi:"serviceType"`
// A map of tags assigned to the resource.
Tags map[string]string `pulumi:"tags"`
// Whether or not the service supports endpoint policies - `true` or `false`.
VpcEndpointPolicySupported bool `pulumi:"vpcEndpointPolicySupported"`
}
func LookupVpcEndpointServiceOutput(ctx *pulumi.Context, args LookupVpcEndpointServiceOutputArgs, opts ...pulumi.InvokeOption) LookupVpcEndpointServiceResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupVpcEndpointServiceResult, error) {
args := v.(LookupVpcEndpointServiceArgs)
r, err := LookupVpcEndpointService(ctx, &args, opts...)
return *r, err
}).(LookupVpcEndpointServiceResultOutput)
}
// A collection of arguments for invoking getVpcEndpointService.
type LookupVpcEndpointServiceOutputArgs struct {
// Configuration block(s) for filtering. Detailed below.
Filters GetVpcEndpointServiceFilterArrayInput `pulumi:"filters"`
// The common name of an AWS service (e.g., `s3`).
Service pulumi.StringPtrInput `pulumi:"service"`
// The service name that is specified when creating a VPC endpoint. For AWS services the service name is usually in the form `com.amazonaws.<region>.<service>` (the SageMaker Notebook service is an exception to this rule, the service name is in the form `aws.sagemaker.<region>.notebook`).
ServiceName pulumi.StringPtrInput `pulumi:"serviceName"`
// The service type, `Gateway` or `Interface`.
ServiceType pulumi.StringPtrInput `pulumi:"serviceType"`
// A map of tags, each pair of which must exactly match a pair on the desired VPC Endpoint Service.
Tags pulumi.StringMapInput `pulumi:"tags"`
}
func (LookupVpcEndpointServiceOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupVpcEndpointServiceArgs)(nil)).Elem()
}
// A collection of values returned by getVpcEndpointService.
type LookupVpcEndpointServiceResultOutput struct{ *pulumi.OutputState }
func (LookupVpcEndpointServiceResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupVpcEndpointServiceResult)(nil)).Elem()
}
func (o LookupVpcEndpointServiceResultOutput) ToLookupVpcEndpointServiceResultOutput() LookupVpcEndpointServiceResultOutput {
return o
}
func (o LookupVpcEndpointServiceResultOutput) ToLookupVpcEndpointServiceResultOutputWithContext(ctx context.Context) LookupVpcEndpointServiceResultOutput {
return o
}
// Whether or not VPC endpoint connection requests to the service must be accepted by the service owner - `true` or `false`.
func (o LookupVpcEndpointServiceResultOutput) AcceptanceRequired() pulumi.BoolOutput {
return o.ApplyT(func(v LookupVpcEndpointServiceResult) bool { return v.AcceptanceRequired }).(pulumi.BoolOutput)
}
// The Amazon Resource Name (ARN) of the VPC endpoint service.
func (o LookupVpcEndpointServiceResultOutput) Arn() pulumi.StringOutput {
return o.ApplyT(func(v LookupVpcEndpointServiceResult) string { return v.Arn }).(pulumi.StringOutput)
}
// The Availability Zones in which the service is available.
func (o LookupVpcEndpointServiceResultOutput) AvailabilityZones() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupVpcEndpointServiceResult) []string { return v.AvailabilityZones }).(pulumi.StringArrayOutput)
}
// The DNS names for the service.
func (o LookupVpcEndpointServiceResultOutput) BaseEndpointDnsNames() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupVpcEndpointServiceResult) []string { return v.BaseEndpointDnsNames }).(pulumi.StringArrayOutput)
}
func (o LookupVpcEndpointServiceResultOutput) Filters() GetVpcEndpointServiceFilterArrayOutput {
return o.ApplyT(func(v LookupVpcEndpointServiceResult) []GetVpcEndpointServiceFilter { return v.Filters }).(GetVpcEndpointServiceFilterArrayOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupVpcEndpointServiceResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupVpcEndpointServiceResult) string { return v.Id }).(pulumi.StringOutput)
}
// Whether or not the service manages its VPC endpoints - `true` or `false`.
func (o LookupVpcEndpointServiceResultOutput) ManagesVpcEndpoints() pulumi.BoolOutput {
return o.ApplyT(func(v LookupVpcEndpointServiceResult) bool { return v.ManagesVpcEndpoints }).(pulumi.BoolOutput)
}
// The AWS account ID of the service owner or `amazon`.
func (o LookupVpcEndpointServiceResultOutput) Owner() pulumi.StringOutput {
return o.ApplyT(func(v LookupVpcEndpointServiceResult) string { return v.Owner }).(pulumi.StringOutput)
}
// The private DNS name for the service.
func (o LookupVpcEndpointServiceResultOutput) PrivateDnsName() pulumi.StringOutput {
return o.ApplyT(func(v LookupVpcEndpointServiceResult) string { return v.PrivateDnsName }).(pulumi.StringOutput)
}
func (o LookupVpcEndpointServiceResultOutput) Service() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupVpcEndpointServiceResult) *string { return v.Service }).(pulumi.StringPtrOutput)
}
// The ID of the endpoint service.
func (o LookupVpcEndpointServiceResultOutput) ServiceId() pulumi.StringOutput {
return o.ApplyT(func(v LookupVpcEndpointServiceResult) string { return v.ServiceId }).(pulumi.StringOutput)
}
func (o LookupVpcEndpointServiceResultOutput) ServiceName() pulumi.StringOutput {
return o.ApplyT(func(v LookupVpcEndpointServiceResult) string { return v.ServiceName }).(pulumi.StringOutput)
}
func (o LookupVpcEndpointServiceResultOutput) ServiceType() pulumi.StringOutput {
return o.ApplyT(func(v LookupVpcEndpointServiceResult) string { return v.ServiceType }).(pulumi.StringOutput)
}
// A map of tags assigned to the resource.
func (o LookupVpcEndpointServiceResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupVpcEndpointServiceResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
// Whether or not the service supports endpoint policies - `true` or `false`.
func (o LookupVpcEndpointServiceResultOutput) VpcEndpointPolicySupported() pulumi.BoolOutput {
return o.ApplyT(func(v LookupVpcEndpointServiceResult) bool { return v.VpcEndpointPolicySupported }).(pulumi.BoolOutput)
}
func init() {
pulumi.RegisterOutputType(LookupVpcEndpointServiceResultOutput{})
}