/
virtualGateway.go
395 lines (339 loc) · 16 KB
/
virtualGateway.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
393
394
395
// 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 appmesh
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides an AWS App Mesh virtual gateway resource.
//
// ## Example Usage
// ### Access Logs and TLS
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v5/go/aws/appmesh"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := appmesh.NewVirtualGateway(ctx, "example", &appmesh.VirtualGatewayArgs{
// MeshName: pulumi.String("example-service-mesh"),
// Spec: &appmesh.VirtualGatewaySpecArgs{
// Listener: &appmesh.VirtualGatewaySpecListenerArgs{
// PortMapping: &appmesh.VirtualGatewaySpecListenerPortMappingArgs{
// Port: pulumi.Int(8080),
// Protocol: pulumi.String("http"),
// },
// Tls: &appmesh.VirtualGatewaySpecListenerTlsArgs{
// Certificate: &appmesh.VirtualGatewaySpecListenerTlsCertificateArgs{
// Acm: &appmesh.VirtualGatewaySpecListenerTlsCertificateAcmArgs{
// CertificateArn: pulumi.Any(aws_acm_certificate.Example.Arn),
// },
// },
// Mode: pulumi.String("STRICT"),
// },
// },
// Logging: &appmesh.VirtualGatewaySpecLoggingArgs{
// AccessLog: &appmesh.VirtualGatewaySpecLoggingAccessLogArgs{
// File: &appmesh.VirtualGatewaySpecLoggingAccessLogFileArgs{
// Path: pulumi.String("/var/log/access.log"),
// },
// },
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// App Mesh virtual gateway can be imported using `mesh_name` together with the virtual gateway's `name`, e.g.,
//
// ```sh
//
// $ pulumi import aws:appmesh/virtualGateway:VirtualGateway example mesh/gw1
//
// ```
type VirtualGateway struct {
pulumi.CustomResourceState
// ARN of the virtual gateway.
Arn pulumi.StringOutput `pulumi:"arn"`
// Creation date of the virtual gateway.
CreatedDate pulumi.StringOutput `pulumi:"createdDate"`
// Last update date of the virtual gateway.
LastUpdatedDate pulumi.StringOutput `pulumi:"lastUpdatedDate"`
// Name of the service mesh in which to create the virtual gateway. Must be between 1 and 255 characters in length.
MeshName pulumi.StringOutput `pulumi:"meshName"`
// AWS account ID of the service mesh's owner. Defaults to the account ID the AWS provider is currently connected to.
MeshOwner pulumi.StringOutput `pulumi:"meshOwner"`
// Name to use for the virtual gateway. Must be between 1 and 255 characters in length.
Name pulumi.StringOutput `pulumi:"name"`
// Resource owner's AWS account ID.
ResourceOwner pulumi.StringOutput `pulumi:"resourceOwner"`
// Virtual gateway specification to apply.
Spec VirtualGatewaySpecOutput `pulumi:"spec"`
// Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
}
// NewVirtualGateway registers a new resource with the given unique name, arguments, and options.
func NewVirtualGateway(ctx *pulumi.Context,
name string, args *VirtualGatewayArgs, opts ...pulumi.ResourceOption) (*VirtualGateway, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.MeshName == nil {
return nil, errors.New("invalid value for required argument 'MeshName'")
}
if args.Spec == nil {
return nil, errors.New("invalid value for required argument 'Spec'")
}
var resource VirtualGateway
err := ctx.RegisterResource("aws:appmesh/virtualGateway:VirtualGateway", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetVirtualGateway gets an existing VirtualGateway 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 GetVirtualGateway(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *VirtualGatewayState, opts ...pulumi.ResourceOption) (*VirtualGateway, error) {
var resource VirtualGateway
err := ctx.ReadResource("aws:appmesh/virtualGateway:VirtualGateway", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering VirtualGateway resources.
type virtualGatewayState struct {
// ARN of the virtual gateway.
Arn *string `pulumi:"arn"`
// Creation date of the virtual gateway.
CreatedDate *string `pulumi:"createdDate"`
// Last update date of the virtual gateway.
LastUpdatedDate *string `pulumi:"lastUpdatedDate"`
// Name of the service mesh in which to create the virtual gateway. Must be between 1 and 255 characters in length.
MeshName *string `pulumi:"meshName"`
// AWS account ID of the service mesh's owner. Defaults to the account ID the AWS provider is currently connected to.
MeshOwner *string `pulumi:"meshOwner"`
// Name to use for the virtual gateway. Must be between 1 and 255 characters in length.
Name *string `pulumi:"name"`
// Resource owner's AWS account ID.
ResourceOwner *string `pulumi:"resourceOwner"`
// Virtual gateway specification to apply.
Spec *VirtualGatewaySpec `pulumi:"spec"`
// Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags map[string]string `pulumi:"tags"`
// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
TagsAll map[string]string `pulumi:"tagsAll"`
}
type VirtualGatewayState struct {
// ARN of the virtual gateway.
Arn pulumi.StringPtrInput
// Creation date of the virtual gateway.
CreatedDate pulumi.StringPtrInput
// Last update date of the virtual gateway.
LastUpdatedDate pulumi.StringPtrInput
// Name of the service mesh in which to create the virtual gateway. Must be between 1 and 255 characters in length.
MeshName pulumi.StringPtrInput
// AWS account ID of the service mesh's owner. Defaults to the account ID the AWS provider is currently connected to.
MeshOwner pulumi.StringPtrInput
// Name to use for the virtual gateway. Must be between 1 and 255 characters in length.
Name pulumi.StringPtrInput
// Resource owner's AWS account ID.
ResourceOwner pulumi.StringPtrInput
// Virtual gateway specification to apply.
Spec VirtualGatewaySpecPtrInput
// Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapInput
// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
TagsAll pulumi.StringMapInput
}
func (VirtualGatewayState) ElementType() reflect.Type {
return reflect.TypeOf((*virtualGatewayState)(nil)).Elem()
}
type virtualGatewayArgs struct {
// Name of the service mesh in which to create the virtual gateway. Must be between 1 and 255 characters in length.
MeshName string `pulumi:"meshName"`
// AWS account ID of the service mesh's owner. Defaults to the account ID the AWS provider is currently connected to.
MeshOwner *string `pulumi:"meshOwner"`
// Name to use for the virtual gateway. Must be between 1 and 255 characters in length.
Name *string `pulumi:"name"`
// Virtual gateway specification to apply.
Spec VirtualGatewaySpec `pulumi:"spec"`
// Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a VirtualGateway resource.
type VirtualGatewayArgs struct {
// Name of the service mesh in which to create the virtual gateway. Must be between 1 and 255 characters in length.
MeshName pulumi.StringInput
// AWS account ID of the service mesh's owner. Defaults to the account ID the AWS provider is currently connected to.
MeshOwner pulumi.StringPtrInput
// Name to use for the virtual gateway. Must be between 1 and 255 characters in length.
Name pulumi.StringPtrInput
// Virtual gateway specification to apply.
Spec VirtualGatewaySpecInput
// Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapInput
}
func (VirtualGatewayArgs) ElementType() reflect.Type {
return reflect.TypeOf((*virtualGatewayArgs)(nil)).Elem()
}
type VirtualGatewayInput interface {
pulumi.Input
ToVirtualGatewayOutput() VirtualGatewayOutput
ToVirtualGatewayOutputWithContext(ctx context.Context) VirtualGatewayOutput
}
func (*VirtualGateway) ElementType() reflect.Type {
return reflect.TypeOf((**VirtualGateway)(nil)).Elem()
}
func (i *VirtualGateway) ToVirtualGatewayOutput() VirtualGatewayOutput {
return i.ToVirtualGatewayOutputWithContext(context.Background())
}
func (i *VirtualGateway) ToVirtualGatewayOutputWithContext(ctx context.Context) VirtualGatewayOutput {
return pulumi.ToOutputWithContext(ctx, i).(VirtualGatewayOutput)
}
// VirtualGatewayArrayInput is an input type that accepts VirtualGatewayArray and VirtualGatewayArrayOutput values.
// You can construct a concrete instance of `VirtualGatewayArrayInput` via:
//
// VirtualGatewayArray{ VirtualGatewayArgs{...} }
type VirtualGatewayArrayInput interface {
pulumi.Input
ToVirtualGatewayArrayOutput() VirtualGatewayArrayOutput
ToVirtualGatewayArrayOutputWithContext(context.Context) VirtualGatewayArrayOutput
}
type VirtualGatewayArray []VirtualGatewayInput
func (VirtualGatewayArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*VirtualGateway)(nil)).Elem()
}
func (i VirtualGatewayArray) ToVirtualGatewayArrayOutput() VirtualGatewayArrayOutput {
return i.ToVirtualGatewayArrayOutputWithContext(context.Background())
}
func (i VirtualGatewayArray) ToVirtualGatewayArrayOutputWithContext(ctx context.Context) VirtualGatewayArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(VirtualGatewayArrayOutput)
}
// VirtualGatewayMapInput is an input type that accepts VirtualGatewayMap and VirtualGatewayMapOutput values.
// You can construct a concrete instance of `VirtualGatewayMapInput` via:
//
// VirtualGatewayMap{ "key": VirtualGatewayArgs{...} }
type VirtualGatewayMapInput interface {
pulumi.Input
ToVirtualGatewayMapOutput() VirtualGatewayMapOutput
ToVirtualGatewayMapOutputWithContext(context.Context) VirtualGatewayMapOutput
}
type VirtualGatewayMap map[string]VirtualGatewayInput
func (VirtualGatewayMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*VirtualGateway)(nil)).Elem()
}
func (i VirtualGatewayMap) ToVirtualGatewayMapOutput() VirtualGatewayMapOutput {
return i.ToVirtualGatewayMapOutputWithContext(context.Background())
}
func (i VirtualGatewayMap) ToVirtualGatewayMapOutputWithContext(ctx context.Context) VirtualGatewayMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(VirtualGatewayMapOutput)
}
type VirtualGatewayOutput struct{ *pulumi.OutputState }
func (VirtualGatewayOutput) ElementType() reflect.Type {
return reflect.TypeOf((**VirtualGateway)(nil)).Elem()
}
func (o VirtualGatewayOutput) ToVirtualGatewayOutput() VirtualGatewayOutput {
return o
}
func (o VirtualGatewayOutput) ToVirtualGatewayOutputWithContext(ctx context.Context) VirtualGatewayOutput {
return o
}
// ARN of the virtual gateway.
func (o VirtualGatewayOutput) Arn() pulumi.StringOutput {
return o.ApplyT(func(v *VirtualGateway) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
}
// Creation date of the virtual gateway.
func (o VirtualGatewayOutput) CreatedDate() pulumi.StringOutput {
return o.ApplyT(func(v *VirtualGateway) pulumi.StringOutput { return v.CreatedDate }).(pulumi.StringOutput)
}
// Last update date of the virtual gateway.
func (o VirtualGatewayOutput) LastUpdatedDate() pulumi.StringOutput {
return o.ApplyT(func(v *VirtualGateway) pulumi.StringOutput { return v.LastUpdatedDate }).(pulumi.StringOutput)
}
// Name of the service mesh in which to create the virtual gateway. Must be between 1 and 255 characters in length.
func (o VirtualGatewayOutput) MeshName() pulumi.StringOutput {
return o.ApplyT(func(v *VirtualGateway) pulumi.StringOutput { return v.MeshName }).(pulumi.StringOutput)
}
// AWS account ID of the service mesh's owner. Defaults to the account ID the AWS provider is currently connected to.
func (o VirtualGatewayOutput) MeshOwner() pulumi.StringOutput {
return o.ApplyT(func(v *VirtualGateway) pulumi.StringOutput { return v.MeshOwner }).(pulumi.StringOutput)
}
// Name to use for the virtual gateway. Must be between 1 and 255 characters in length.
func (o VirtualGatewayOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *VirtualGateway) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Resource owner's AWS account ID.
func (o VirtualGatewayOutput) ResourceOwner() pulumi.StringOutput {
return o.ApplyT(func(v *VirtualGateway) pulumi.StringOutput { return v.ResourceOwner }).(pulumi.StringOutput)
}
// Virtual gateway specification to apply.
func (o VirtualGatewayOutput) Spec() VirtualGatewaySpecOutput {
return o.ApplyT(func(v *VirtualGateway) VirtualGatewaySpecOutput { return v.Spec }).(VirtualGatewaySpecOutput)
}
// Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
func (o VirtualGatewayOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *VirtualGateway) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
func (o VirtualGatewayOutput) TagsAll() pulumi.StringMapOutput {
return o.ApplyT(func(v *VirtualGateway) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
}
type VirtualGatewayArrayOutput struct{ *pulumi.OutputState }
func (VirtualGatewayArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*VirtualGateway)(nil)).Elem()
}
func (o VirtualGatewayArrayOutput) ToVirtualGatewayArrayOutput() VirtualGatewayArrayOutput {
return o
}
func (o VirtualGatewayArrayOutput) ToVirtualGatewayArrayOutputWithContext(ctx context.Context) VirtualGatewayArrayOutput {
return o
}
func (o VirtualGatewayArrayOutput) Index(i pulumi.IntInput) VirtualGatewayOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *VirtualGateway {
return vs[0].([]*VirtualGateway)[vs[1].(int)]
}).(VirtualGatewayOutput)
}
type VirtualGatewayMapOutput struct{ *pulumi.OutputState }
func (VirtualGatewayMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*VirtualGateway)(nil)).Elem()
}
func (o VirtualGatewayMapOutput) ToVirtualGatewayMapOutput() VirtualGatewayMapOutput {
return o
}
func (o VirtualGatewayMapOutput) ToVirtualGatewayMapOutputWithContext(ctx context.Context) VirtualGatewayMapOutput {
return o
}
func (o VirtualGatewayMapOutput) MapIndex(k pulumi.StringInput) VirtualGatewayOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *VirtualGateway {
return vs[0].(map[string]*VirtualGateway)[vs[1].(string)]
}).(VirtualGatewayOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*VirtualGatewayInput)(nil)).Elem(), &VirtualGateway{})
pulumi.RegisterInputType(reflect.TypeOf((*VirtualGatewayArrayInput)(nil)).Elem(), VirtualGatewayArray{})
pulumi.RegisterInputType(reflect.TypeOf((*VirtualGatewayMapInput)(nil)).Elem(), VirtualGatewayMap{})
pulumi.RegisterOutputType(VirtualGatewayOutput{})
pulumi.RegisterOutputType(VirtualGatewayArrayOutput{})
pulumi.RegisterOutputType(VirtualGatewayMapOutput{})
}