/
integration.go
546 lines (486 loc) · 31.9 KB
/
integration.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
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
// *** 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 apigateway
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Provides an HTTP Method Integration for an API Gateway Integration.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "fmt"
//
// "github.com/pulumi/pulumi-aws/sdk/v3/go/aws/apigateway"
// "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// myDemoAPI, err := apigateway.NewRestApi(ctx, "myDemoAPI", &apigateway.RestApiArgs{
// Description: pulumi.String("This is my API for demonstration purposes"),
// })
// if err != nil {
// return err
// }
// myDemoResource, err := apigateway.NewResource(ctx, "myDemoResource", &apigateway.ResourceArgs{
// RestApi: myDemoAPI.ID(),
// ParentId: myDemoAPI.RootResourceId,
// PathPart: pulumi.String("mydemoresource"),
// })
// if err != nil {
// return err
// }
// myDemoMethod, err := apigateway.NewMethod(ctx, "myDemoMethod", &apigateway.MethodArgs{
// RestApi: myDemoAPI.ID(),
// ResourceId: myDemoResource.ID(),
// HttpMethod: pulumi.String("GET"),
// Authorization: pulumi.String("NONE"),
// })
// if err != nil {
// return err
// }
// _, err = apigateway.NewIntegration(ctx, "myDemoIntegration", &apigateway.IntegrationArgs{
// RestApi: myDemoAPI.ID(),
// ResourceId: myDemoResource.ID(),
// HttpMethod: myDemoMethod.HttpMethod,
// Type: pulumi.String("MOCK"),
// CacheKeyParameters: pulumi.StringArray{
// pulumi.String("method.request.path.param"),
// },
// CacheNamespace: pulumi.String("foobar"),
// TimeoutMilliseconds: pulumi.Int(29000),
// RequestParameters: pulumi.StringMap{
// "integration.request.header.X-Authorization": pulumi.String("'static'"),
// },
// RequestTemplates: pulumi.StringMap{
// "application/xml": pulumi.String(fmt.Sprintf("%v%v%v%v%v%v%v", "{\n", " \"body\" : ", "$", "input.json('", "$", "')\n", "}\n")),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// `aws_api_gateway_integration` can be imported using `REST-API-ID/RESOURCE-ID/HTTP-METHOD`, e.g.
//
// ```sh
// $ pulumi import aws:apigateway/integration:Integration example 12345abcde/67890fghij/GET
// ```
type Integration struct {
pulumi.CustomResourceState
// A list of cache key parameters for the integration.
CacheKeyParameters pulumi.StringArrayOutput `pulumi:"cacheKeyParameters"`
// The integration's cache namespace.
CacheNamespace pulumi.StringOutput `pulumi:"cacheNamespace"`
// The id of the VpcLink used for the integration. **Required** if `connectionType` is `VPC_LINK`
ConnectionId pulumi.StringPtrOutput `pulumi:"connectionId"`
// The integration input's [connectionType](https://docs.aws.amazon.com/apigateway/api-reference/resource/integration/#connectionType). Valid values are `INTERNET` (default for connections through the public routable internet), and `VPC_LINK` (for private connections between API Gateway and a network load balancer in a VPC).
ConnectionType pulumi.StringPtrOutput `pulumi:"connectionType"`
// Specifies how to handle request payload content type conversions. Supported values are `CONVERT_TO_BINARY` and `CONVERT_TO_TEXT`. If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the passthroughBehaviors is configured to support payload pass-through.
ContentHandling pulumi.StringPtrOutput `pulumi:"contentHandling"`
// The credentials required for the integration. For `AWS` integrations, 2 options are available. To specify an IAM Role for Amazon API Gateway to assume, use the role's ARN. To require that the caller's identity be passed through from the request, specify the string `arn:aws:iam::\*:user/\*`.
Credentials pulumi.StringPtrOutput `pulumi:"credentials"`
// The HTTP method (`GET`, `POST`, `PUT`, `DELETE`, `HEAD`, `OPTION`, `ANY`)
// when calling the associated resource.
HttpMethod pulumi.StringOutput `pulumi:"httpMethod"`
// The integration HTTP method
// (`GET`, `POST`, `PUT`, `DELETE`, `HEAD`, `OPTIONs`, `ANY`, `PATCH`) specifying how API Gateway will interact with the back end.
// **Required** if `type` is `AWS`, `AWS_PROXY`, `HTTP` or `HTTP_PROXY`.
// Not all methods are compatible with all `AWS` integrations.
// e.g. Lambda function [can only be invoked](https://github.com/awslabs/aws-apigateway-importer/issues/9#issuecomment-129651005) via `POST`.
IntegrationHttpMethod pulumi.StringPtrOutput `pulumi:"integrationHttpMethod"`
// The integration passthrough behavior (`WHEN_NO_MATCH`, `WHEN_NO_TEMPLATES`, `NEVER`). **Required** if `requestTemplates` is used.
PassthroughBehavior pulumi.StringOutput `pulumi:"passthroughBehavior"`
// A map of request query string parameters and headers that should be passed to the backend responder.
// For example: `requestParameters = { "integration.request.header.X-Some-Other-Header" = "method.request.header.X-Some-Header" }`
RequestParameters pulumi.StringMapOutput `pulumi:"requestParameters"`
// A map of the integration's request templates.
RequestTemplates pulumi.StringMapOutput `pulumi:"requestTemplates"`
// The API resource ID.
ResourceId pulumi.StringOutput `pulumi:"resourceId"`
// The ID of the associated REST API.
RestApi pulumi.StringOutput `pulumi:"restApi"`
// Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds.
TimeoutMilliseconds pulumi.IntPtrOutput `pulumi:"timeoutMilliseconds"`
// Configuration block specifying the TLS configuration for an integration. Defined below.
TlsConfig IntegrationTlsConfigPtrOutput `pulumi:"tlsConfig"`
// The integration input's [type](https://docs.aws.amazon.com/apigateway/api-reference/resource/integration/). Valid values are `HTTP` (for HTTP backends), `MOCK` (not calling any real backend), `AWS` (for AWS services), `AWS_PROXY` (for Lambda proxy integration) and `HTTP_PROXY` (for HTTP proxy integration). An `HTTP` or `HTTP_PROXY` integration with a `connectionType` of `VPC_LINK` is referred to as a private integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC.
Type pulumi.StringOutput `pulumi:"type"`
// The input's URI. **Required** if `type` is `AWS`, `AWS_PROXY`, `HTTP` or `HTTP_PROXY`.
// For HTTP integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification . For AWS integrations, the URI should be of the form `arn:aws:apigateway:{region}:{subdomain.service|service}:{path|action}/{service_api}`. `region`, `subdomain` and `service` are used to determine the right endpoint.
// e.g. `arn:aws:apigateway:eu-west-1:lambda:path/2015-03-31/functions/arn:aws:lambda:eu-west-1:012345678901:function:my-func/invocations`. For private integrations, the URI parameter is not used for routing requests to your endpoint, but is used for setting the Host header and for certificate validation.
Uri pulumi.StringPtrOutput `pulumi:"uri"`
}
// NewIntegration registers a new resource with the given unique name, arguments, and options.
func NewIntegration(ctx *pulumi.Context,
name string, args *IntegrationArgs, opts ...pulumi.ResourceOption) (*Integration, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.HttpMethod == nil {
return nil, errors.New("invalid value for required argument 'HttpMethod'")
}
if args.ResourceId == nil {
return nil, errors.New("invalid value for required argument 'ResourceId'")
}
if args.RestApi == nil {
return nil, errors.New("invalid value for required argument 'RestApi'")
}
if args.Type == nil {
return nil, errors.New("invalid value for required argument 'Type'")
}
var resource Integration
err := ctx.RegisterResource("aws:apigateway/integration:Integration", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetIntegration gets an existing Integration 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 GetIntegration(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *IntegrationState, opts ...pulumi.ResourceOption) (*Integration, error) {
var resource Integration
err := ctx.ReadResource("aws:apigateway/integration:Integration", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Integration resources.
type integrationState struct {
// A list of cache key parameters for the integration.
CacheKeyParameters []string `pulumi:"cacheKeyParameters"`
// The integration's cache namespace.
CacheNamespace *string `pulumi:"cacheNamespace"`
// The id of the VpcLink used for the integration. **Required** if `connectionType` is `VPC_LINK`
ConnectionId *string `pulumi:"connectionId"`
// The integration input's [connectionType](https://docs.aws.amazon.com/apigateway/api-reference/resource/integration/#connectionType). Valid values are `INTERNET` (default for connections through the public routable internet), and `VPC_LINK` (for private connections between API Gateway and a network load balancer in a VPC).
ConnectionType *string `pulumi:"connectionType"`
// Specifies how to handle request payload content type conversions. Supported values are `CONVERT_TO_BINARY` and `CONVERT_TO_TEXT`. If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the passthroughBehaviors is configured to support payload pass-through.
ContentHandling *string `pulumi:"contentHandling"`
// The credentials required for the integration. For `AWS` integrations, 2 options are available. To specify an IAM Role for Amazon API Gateway to assume, use the role's ARN. To require that the caller's identity be passed through from the request, specify the string `arn:aws:iam::\*:user/\*`.
Credentials *string `pulumi:"credentials"`
// The HTTP method (`GET`, `POST`, `PUT`, `DELETE`, `HEAD`, `OPTION`, `ANY`)
// when calling the associated resource.
HttpMethod *string `pulumi:"httpMethod"`
// The integration HTTP method
// (`GET`, `POST`, `PUT`, `DELETE`, `HEAD`, `OPTIONs`, `ANY`, `PATCH`) specifying how API Gateway will interact with the back end.
// **Required** if `type` is `AWS`, `AWS_PROXY`, `HTTP` or `HTTP_PROXY`.
// Not all methods are compatible with all `AWS` integrations.
// e.g. Lambda function [can only be invoked](https://github.com/awslabs/aws-apigateway-importer/issues/9#issuecomment-129651005) via `POST`.
IntegrationHttpMethod *string `pulumi:"integrationHttpMethod"`
// The integration passthrough behavior (`WHEN_NO_MATCH`, `WHEN_NO_TEMPLATES`, `NEVER`). **Required** if `requestTemplates` is used.
PassthroughBehavior *string `pulumi:"passthroughBehavior"`
// A map of request query string parameters and headers that should be passed to the backend responder.
// For example: `requestParameters = { "integration.request.header.X-Some-Other-Header" = "method.request.header.X-Some-Header" }`
RequestParameters map[string]string `pulumi:"requestParameters"`
// A map of the integration's request templates.
RequestTemplates map[string]string `pulumi:"requestTemplates"`
// The API resource ID.
ResourceId *string `pulumi:"resourceId"`
// The ID of the associated REST API.
RestApi *string `pulumi:"restApi"`
// Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds.
TimeoutMilliseconds *int `pulumi:"timeoutMilliseconds"`
// Configuration block specifying the TLS configuration for an integration. Defined below.
TlsConfig *IntegrationTlsConfig `pulumi:"tlsConfig"`
// The integration input's [type](https://docs.aws.amazon.com/apigateway/api-reference/resource/integration/). Valid values are `HTTP` (for HTTP backends), `MOCK` (not calling any real backend), `AWS` (for AWS services), `AWS_PROXY` (for Lambda proxy integration) and `HTTP_PROXY` (for HTTP proxy integration). An `HTTP` or `HTTP_PROXY` integration with a `connectionType` of `VPC_LINK` is referred to as a private integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC.
Type *string `pulumi:"type"`
// The input's URI. **Required** if `type` is `AWS`, `AWS_PROXY`, `HTTP` or `HTTP_PROXY`.
// For HTTP integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification . For AWS integrations, the URI should be of the form `arn:aws:apigateway:{region}:{subdomain.service|service}:{path|action}/{service_api}`. `region`, `subdomain` and `service` are used to determine the right endpoint.
// e.g. `arn:aws:apigateway:eu-west-1:lambda:path/2015-03-31/functions/arn:aws:lambda:eu-west-1:012345678901:function:my-func/invocations`. For private integrations, the URI parameter is not used for routing requests to your endpoint, but is used for setting the Host header and for certificate validation.
Uri *string `pulumi:"uri"`
}
type IntegrationState struct {
// A list of cache key parameters for the integration.
CacheKeyParameters pulumi.StringArrayInput
// The integration's cache namespace.
CacheNamespace pulumi.StringPtrInput
// The id of the VpcLink used for the integration. **Required** if `connectionType` is `VPC_LINK`
ConnectionId pulumi.StringPtrInput
// The integration input's [connectionType](https://docs.aws.amazon.com/apigateway/api-reference/resource/integration/#connectionType). Valid values are `INTERNET` (default for connections through the public routable internet), and `VPC_LINK` (for private connections between API Gateway and a network load balancer in a VPC).
ConnectionType pulumi.StringPtrInput
// Specifies how to handle request payload content type conversions. Supported values are `CONVERT_TO_BINARY` and `CONVERT_TO_TEXT`. If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the passthroughBehaviors is configured to support payload pass-through.
ContentHandling pulumi.StringPtrInput
// The credentials required for the integration. For `AWS` integrations, 2 options are available. To specify an IAM Role for Amazon API Gateway to assume, use the role's ARN. To require that the caller's identity be passed through from the request, specify the string `arn:aws:iam::\*:user/\*`.
Credentials pulumi.StringPtrInput
// The HTTP method (`GET`, `POST`, `PUT`, `DELETE`, `HEAD`, `OPTION`, `ANY`)
// when calling the associated resource.
HttpMethod pulumi.StringPtrInput
// The integration HTTP method
// (`GET`, `POST`, `PUT`, `DELETE`, `HEAD`, `OPTIONs`, `ANY`, `PATCH`) specifying how API Gateway will interact with the back end.
// **Required** if `type` is `AWS`, `AWS_PROXY`, `HTTP` or `HTTP_PROXY`.
// Not all methods are compatible with all `AWS` integrations.
// e.g. Lambda function [can only be invoked](https://github.com/awslabs/aws-apigateway-importer/issues/9#issuecomment-129651005) via `POST`.
IntegrationHttpMethod pulumi.StringPtrInput
// The integration passthrough behavior (`WHEN_NO_MATCH`, `WHEN_NO_TEMPLATES`, `NEVER`). **Required** if `requestTemplates` is used.
PassthroughBehavior pulumi.StringPtrInput
// A map of request query string parameters and headers that should be passed to the backend responder.
// For example: `requestParameters = { "integration.request.header.X-Some-Other-Header" = "method.request.header.X-Some-Header" }`
RequestParameters pulumi.StringMapInput
// A map of the integration's request templates.
RequestTemplates pulumi.StringMapInput
// The API resource ID.
ResourceId pulumi.StringPtrInput
// The ID of the associated REST API.
RestApi pulumi.StringPtrInput
// Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds.
TimeoutMilliseconds pulumi.IntPtrInput
// Configuration block specifying the TLS configuration for an integration. Defined below.
TlsConfig IntegrationTlsConfigPtrInput
// The integration input's [type](https://docs.aws.amazon.com/apigateway/api-reference/resource/integration/). Valid values are `HTTP` (for HTTP backends), `MOCK` (not calling any real backend), `AWS` (for AWS services), `AWS_PROXY` (for Lambda proxy integration) and `HTTP_PROXY` (for HTTP proxy integration). An `HTTP` or `HTTP_PROXY` integration with a `connectionType` of `VPC_LINK` is referred to as a private integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC.
Type pulumi.StringPtrInput
// The input's URI. **Required** if `type` is `AWS`, `AWS_PROXY`, `HTTP` or `HTTP_PROXY`.
// For HTTP integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification . For AWS integrations, the URI should be of the form `arn:aws:apigateway:{region}:{subdomain.service|service}:{path|action}/{service_api}`. `region`, `subdomain` and `service` are used to determine the right endpoint.
// e.g. `arn:aws:apigateway:eu-west-1:lambda:path/2015-03-31/functions/arn:aws:lambda:eu-west-1:012345678901:function:my-func/invocations`. For private integrations, the URI parameter is not used for routing requests to your endpoint, but is used for setting the Host header and for certificate validation.
Uri pulumi.StringPtrInput
}
func (IntegrationState) ElementType() reflect.Type {
return reflect.TypeOf((*integrationState)(nil)).Elem()
}
type integrationArgs struct {
// A list of cache key parameters for the integration.
CacheKeyParameters []string `pulumi:"cacheKeyParameters"`
// The integration's cache namespace.
CacheNamespace *string `pulumi:"cacheNamespace"`
// The id of the VpcLink used for the integration. **Required** if `connectionType` is `VPC_LINK`
ConnectionId *string `pulumi:"connectionId"`
// The integration input's [connectionType](https://docs.aws.amazon.com/apigateway/api-reference/resource/integration/#connectionType). Valid values are `INTERNET` (default for connections through the public routable internet), and `VPC_LINK` (for private connections between API Gateway and a network load balancer in a VPC).
ConnectionType *string `pulumi:"connectionType"`
// Specifies how to handle request payload content type conversions. Supported values are `CONVERT_TO_BINARY` and `CONVERT_TO_TEXT`. If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the passthroughBehaviors is configured to support payload pass-through.
ContentHandling *string `pulumi:"contentHandling"`
// The credentials required for the integration. For `AWS` integrations, 2 options are available. To specify an IAM Role for Amazon API Gateway to assume, use the role's ARN. To require that the caller's identity be passed through from the request, specify the string `arn:aws:iam::\*:user/\*`.
Credentials *string `pulumi:"credentials"`
// The HTTP method (`GET`, `POST`, `PUT`, `DELETE`, `HEAD`, `OPTION`, `ANY`)
// when calling the associated resource.
HttpMethod string `pulumi:"httpMethod"`
// The integration HTTP method
// (`GET`, `POST`, `PUT`, `DELETE`, `HEAD`, `OPTIONs`, `ANY`, `PATCH`) specifying how API Gateway will interact with the back end.
// **Required** if `type` is `AWS`, `AWS_PROXY`, `HTTP` or `HTTP_PROXY`.
// Not all methods are compatible with all `AWS` integrations.
// e.g. Lambda function [can only be invoked](https://github.com/awslabs/aws-apigateway-importer/issues/9#issuecomment-129651005) via `POST`.
IntegrationHttpMethod *string `pulumi:"integrationHttpMethod"`
// The integration passthrough behavior (`WHEN_NO_MATCH`, `WHEN_NO_TEMPLATES`, `NEVER`). **Required** if `requestTemplates` is used.
PassthroughBehavior *string `pulumi:"passthroughBehavior"`
// A map of request query string parameters and headers that should be passed to the backend responder.
// For example: `requestParameters = { "integration.request.header.X-Some-Other-Header" = "method.request.header.X-Some-Header" }`
RequestParameters map[string]string `pulumi:"requestParameters"`
// A map of the integration's request templates.
RequestTemplates map[string]string `pulumi:"requestTemplates"`
// The API resource ID.
ResourceId string `pulumi:"resourceId"`
// The ID of the associated REST API.
RestApi interface{} `pulumi:"restApi"`
// Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds.
TimeoutMilliseconds *int `pulumi:"timeoutMilliseconds"`
// Configuration block specifying the TLS configuration for an integration. Defined below.
TlsConfig *IntegrationTlsConfig `pulumi:"tlsConfig"`
// The integration input's [type](https://docs.aws.amazon.com/apigateway/api-reference/resource/integration/). Valid values are `HTTP` (for HTTP backends), `MOCK` (not calling any real backend), `AWS` (for AWS services), `AWS_PROXY` (for Lambda proxy integration) and `HTTP_PROXY` (for HTTP proxy integration). An `HTTP` or `HTTP_PROXY` integration with a `connectionType` of `VPC_LINK` is referred to as a private integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC.
Type string `pulumi:"type"`
// The input's URI. **Required** if `type` is `AWS`, `AWS_PROXY`, `HTTP` or `HTTP_PROXY`.
// For HTTP integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification . For AWS integrations, the URI should be of the form `arn:aws:apigateway:{region}:{subdomain.service|service}:{path|action}/{service_api}`. `region`, `subdomain` and `service` are used to determine the right endpoint.
// e.g. `arn:aws:apigateway:eu-west-1:lambda:path/2015-03-31/functions/arn:aws:lambda:eu-west-1:012345678901:function:my-func/invocations`. For private integrations, the URI parameter is not used for routing requests to your endpoint, but is used for setting the Host header and for certificate validation.
Uri *string `pulumi:"uri"`
}
// The set of arguments for constructing a Integration resource.
type IntegrationArgs struct {
// A list of cache key parameters for the integration.
CacheKeyParameters pulumi.StringArrayInput
// The integration's cache namespace.
CacheNamespace pulumi.StringPtrInput
// The id of the VpcLink used for the integration. **Required** if `connectionType` is `VPC_LINK`
ConnectionId pulumi.StringPtrInput
// The integration input's [connectionType](https://docs.aws.amazon.com/apigateway/api-reference/resource/integration/#connectionType). Valid values are `INTERNET` (default for connections through the public routable internet), and `VPC_LINK` (for private connections between API Gateway and a network load balancer in a VPC).
ConnectionType pulumi.StringPtrInput
// Specifies how to handle request payload content type conversions. Supported values are `CONVERT_TO_BINARY` and `CONVERT_TO_TEXT`. If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the passthroughBehaviors is configured to support payload pass-through.
ContentHandling pulumi.StringPtrInput
// The credentials required for the integration. For `AWS` integrations, 2 options are available. To specify an IAM Role for Amazon API Gateway to assume, use the role's ARN. To require that the caller's identity be passed through from the request, specify the string `arn:aws:iam::\*:user/\*`.
Credentials pulumi.StringPtrInput
// The HTTP method (`GET`, `POST`, `PUT`, `DELETE`, `HEAD`, `OPTION`, `ANY`)
// when calling the associated resource.
HttpMethod pulumi.StringInput
// The integration HTTP method
// (`GET`, `POST`, `PUT`, `DELETE`, `HEAD`, `OPTIONs`, `ANY`, `PATCH`) specifying how API Gateway will interact with the back end.
// **Required** if `type` is `AWS`, `AWS_PROXY`, `HTTP` or `HTTP_PROXY`.
// Not all methods are compatible with all `AWS` integrations.
// e.g. Lambda function [can only be invoked](https://github.com/awslabs/aws-apigateway-importer/issues/9#issuecomment-129651005) via `POST`.
IntegrationHttpMethod pulumi.StringPtrInput
// The integration passthrough behavior (`WHEN_NO_MATCH`, `WHEN_NO_TEMPLATES`, `NEVER`). **Required** if `requestTemplates` is used.
PassthroughBehavior pulumi.StringPtrInput
// A map of request query string parameters and headers that should be passed to the backend responder.
// For example: `requestParameters = { "integration.request.header.X-Some-Other-Header" = "method.request.header.X-Some-Header" }`
RequestParameters pulumi.StringMapInput
// A map of the integration's request templates.
RequestTemplates pulumi.StringMapInput
// The API resource ID.
ResourceId pulumi.StringInput
// The ID of the associated REST API.
RestApi pulumi.Input
// Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds.
TimeoutMilliseconds pulumi.IntPtrInput
// Configuration block specifying the TLS configuration for an integration. Defined below.
TlsConfig IntegrationTlsConfigPtrInput
// The integration input's [type](https://docs.aws.amazon.com/apigateway/api-reference/resource/integration/). Valid values are `HTTP` (for HTTP backends), `MOCK` (not calling any real backend), `AWS` (for AWS services), `AWS_PROXY` (for Lambda proxy integration) and `HTTP_PROXY` (for HTTP proxy integration). An `HTTP` or `HTTP_PROXY` integration with a `connectionType` of `VPC_LINK` is referred to as a private integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC.
Type pulumi.StringInput
// The input's URI. **Required** if `type` is `AWS`, `AWS_PROXY`, `HTTP` or `HTTP_PROXY`.
// For HTTP integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification . For AWS integrations, the URI should be of the form `arn:aws:apigateway:{region}:{subdomain.service|service}:{path|action}/{service_api}`. `region`, `subdomain` and `service` are used to determine the right endpoint.
// e.g. `arn:aws:apigateway:eu-west-1:lambda:path/2015-03-31/functions/arn:aws:lambda:eu-west-1:012345678901:function:my-func/invocations`. For private integrations, the URI parameter is not used for routing requests to your endpoint, but is used for setting the Host header and for certificate validation.
Uri pulumi.StringPtrInput
}
func (IntegrationArgs) ElementType() reflect.Type {
return reflect.TypeOf((*integrationArgs)(nil)).Elem()
}
type IntegrationInput interface {
pulumi.Input
ToIntegrationOutput() IntegrationOutput
ToIntegrationOutputWithContext(ctx context.Context) IntegrationOutput
}
func (*Integration) ElementType() reflect.Type {
return reflect.TypeOf((*Integration)(nil))
}
func (i *Integration) ToIntegrationOutput() IntegrationOutput {
return i.ToIntegrationOutputWithContext(context.Background())
}
func (i *Integration) ToIntegrationOutputWithContext(ctx context.Context) IntegrationOutput {
return pulumi.ToOutputWithContext(ctx, i).(IntegrationOutput)
}
func (i *Integration) ToIntegrationPtrOutput() IntegrationPtrOutput {
return i.ToIntegrationPtrOutputWithContext(context.Background())
}
func (i *Integration) ToIntegrationPtrOutputWithContext(ctx context.Context) IntegrationPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(IntegrationPtrOutput)
}
type IntegrationPtrInput interface {
pulumi.Input
ToIntegrationPtrOutput() IntegrationPtrOutput
ToIntegrationPtrOutputWithContext(ctx context.Context) IntegrationPtrOutput
}
type integrationPtrType IntegrationArgs
func (*integrationPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**Integration)(nil))
}
func (i *integrationPtrType) ToIntegrationPtrOutput() IntegrationPtrOutput {
return i.ToIntegrationPtrOutputWithContext(context.Background())
}
func (i *integrationPtrType) ToIntegrationPtrOutputWithContext(ctx context.Context) IntegrationPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(IntegrationPtrOutput)
}
// IntegrationArrayInput is an input type that accepts IntegrationArray and IntegrationArrayOutput values.
// You can construct a concrete instance of `IntegrationArrayInput` via:
//
// IntegrationArray{ IntegrationArgs{...} }
type IntegrationArrayInput interface {
pulumi.Input
ToIntegrationArrayOutput() IntegrationArrayOutput
ToIntegrationArrayOutputWithContext(context.Context) IntegrationArrayOutput
}
type IntegrationArray []IntegrationInput
func (IntegrationArray) ElementType() reflect.Type {
return reflect.TypeOf(([]*Integration)(nil))
}
func (i IntegrationArray) ToIntegrationArrayOutput() IntegrationArrayOutput {
return i.ToIntegrationArrayOutputWithContext(context.Background())
}
func (i IntegrationArray) ToIntegrationArrayOutputWithContext(ctx context.Context) IntegrationArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(IntegrationArrayOutput)
}
// IntegrationMapInput is an input type that accepts IntegrationMap and IntegrationMapOutput values.
// You can construct a concrete instance of `IntegrationMapInput` via:
//
// IntegrationMap{ "key": IntegrationArgs{...} }
type IntegrationMapInput interface {
pulumi.Input
ToIntegrationMapOutput() IntegrationMapOutput
ToIntegrationMapOutputWithContext(context.Context) IntegrationMapOutput
}
type IntegrationMap map[string]IntegrationInput
func (IntegrationMap) ElementType() reflect.Type {
return reflect.TypeOf((map[string]*Integration)(nil))
}
func (i IntegrationMap) ToIntegrationMapOutput() IntegrationMapOutput {
return i.ToIntegrationMapOutputWithContext(context.Background())
}
func (i IntegrationMap) ToIntegrationMapOutputWithContext(ctx context.Context) IntegrationMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(IntegrationMapOutput)
}
type IntegrationOutput struct {
*pulumi.OutputState
}
func (IntegrationOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Integration)(nil))
}
func (o IntegrationOutput) ToIntegrationOutput() IntegrationOutput {
return o
}
func (o IntegrationOutput) ToIntegrationOutputWithContext(ctx context.Context) IntegrationOutput {
return o
}
func (o IntegrationOutput) ToIntegrationPtrOutput() IntegrationPtrOutput {
return o.ToIntegrationPtrOutputWithContext(context.Background())
}
func (o IntegrationOutput) ToIntegrationPtrOutputWithContext(ctx context.Context) IntegrationPtrOutput {
return o.ApplyT(func(v Integration) *Integration {
return &v
}).(IntegrationPtrOutput)
}
type IntegrationPtrOutput struct {
*pulumi.OutputState
}
func (IntegrationPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Integration)(nil))
}
func (o IntegrationPtrOutput) ToIntegrationPtrOutput() IntegrationPtrOutput {
return o
}
func (o IntegrationPtrOutput) ToIntegrationPtrOutputWithContext(ctx context.Context) IntegrationPtrOutput {
return o
}
type IntegrationArrayOutput struct{ *pulumi.OutputState }
func (IntegrationArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]Integration)(nil))
}
func (o IntegrationArrayOutput) ToIntegrationArrayOutput() IntegrationArrayOutput {
return o
}
func (o IntegrationArrayOutput) ToIntegrationArrayOutputWithContext(ctx context.Context) IntegrationArrayOutput {
return o
}
func (o IntegrationArrayOutput) Index(i pulumi.IntInput) IntegrationOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) Integration {
return vs[0].([]Integration)[vs[1].(int)]
}).(IntegrationOutput)
}
type IntegrationMapOutput struct{ *pulumi.OutputState }
func (IntegrationMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]Integration)(nil))
}
func (o IntegrationMapOutput) ToIntegrationMapOutput() IntegrationMapOutput {
return o
}
func (o IntegrationMapOutput) ToIntegrationMapOutputWithContext(ctx context.Context) IntegrationMapOutput {
return o
}
func (o IntegrationMapOutput) MapIndex(k pulumi.StringInput) IntegrationOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) Integration {
return vs[0].(map[string]Integration)[vs[1].(string)]
}).(IntegrationOutput)
}
func init() {
pulumi.RegisterOutputType(IntegrationOutput{})
pulumi.RegisterOutputType(IntegrationPtrOutput{})
pulumi.RegisterOutputType(IntegrationArrayOutput{})
pulumi.RegisterOutputType(IntegrationMapOutput{})
}