forked from clouddrove/terraform-aws-api-gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.tf
576 lines (483 loc) · 18.4 KB
/
variables.tf
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
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
#Module : LABEL
#Description : Terraform label module variables
variable "name" {
type = string
default = ""
description = "Name (e.g. `app` or `cluster`)."
}
variable "repository" {
type = string
default = "https://github.com/clouddrove/terraform-aws-api-gateway"
description = "Terraform current module repo"
validation {
# regex(...) fails if it cannot find a match
condition = can(regex("^https://", var.repository))
error_message = "The module-repo value must be a valid Git repo link."
}
}
variable "environment" {
type = string
default = "https://registry.terraform.io/modules/clouddrove/api-gateway/aws"
description = "Environment (e.g. `prod`, `dev`, `staging`)."
}
variable "label_order" {
type = list(any)
default = []
description = "Label order, e.g. `name`,`application`."
}
variable "attributes" {
type = list(any)
default = []
description = "Additional attributes (e.g. `1`)."
}
variable "tags" {
type = map(any)
default = {}
description = "Additional tags (e.g. map(`BusinessUnit`,`XYZ`)."
}
variable "managedby" {
type = string
default = "hello@clouddrove.com"
description = "ManagedBy, eg 'CloudDrove'."
}
# Module : Api Gateway
# Description : Terraform Api Gateway module variables.
variable "enabled" {
type = bool
default = false
description = "Whether to create rest api."
}
variable "description" {
type = string
default = ""
description = "The description of the REST API "
}
variable "binary_media_types" {
type = list(any)
default = ["UTF-8-encoded"]
description = "The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads."
}
variable "minimum_compression_size" {
type = number
default = -1
description = "Minimum response size to compress for the REST API. Integer between -1 and 10485760 (10MB). Setting a value greater than -1 will enable compression, -1 disables compression (default)."
}
variable "api_key_source" {
type = string
default = "HEADER"
description = "The source of the API key for requests. Valid values are HEADER (default) and AUTHORIZER."
}
variable "types" {
type = list(any)
default = ["EDGE"]
description = "Whether to create rest api."
}
variable "vpc_endpoint_ids" {
type = list(string)
default = ["", ]
description = "Set of VPC Endpoint identifiers. It is only supported for PRIVATE endpoint type."
}
variable "path_parts" {
type = list(any)
default = []
description = "The last path segment of this API resource."
}
variable "stage_enabled" {
type = bool
default = false
description = "Whether to create stage for rest api."
}
variable "deployment_enabled" {
type = bool
default = false
description = "Whether to deploy rest api."
}
variable "api_log_enabled" {
type = bool
default = false
description = "Whether to enable log for rest api."
}
variable "stage_name" {
type = string
default = ""
description = "The name of the stage. If the specified stage already exists, it will be updated to point to the new deployment. If the stage does not exist, a new one will be created and point to this deployment."
}
variable "deploy_description" {
type = string
default = ""
description = "The description of the deployment."
}
variable "stage_description" {
type = string
default = ""
description = "The description of the stage."
}
variable "variables" {
type = map(any)
default = {}
description = "A map that defines variables for the stage."
}
variable "method_enabled" {
type = bool
default = false
description = "Whether to create stage for rest api."
}
variable "http_methods" {
type = list(any)
default = []
description = "The HTTP Method (GET, POST, PUT, DELETE, HEAD, OPTIONS, ANY)."
}
variable "authorizations" {
type = list(any)
default = []
description = "The type of authorization used for the method (NONE, CUSTOM, AWS_IAM, COGNITO_USER_POOLS)."
}
variable "authorizer_ids" {
type = list(any)
default = []
description = "The authorizer id to be used when the authorization is CUSTOM or COGNITO_USER_POOLS."
}
variable "authorization_scopes" {
type = list(any)
default = []
description = "The authorization scopes used when the authorization is COGNITO_USER_POOLS."
sensitive = true
}
variable "api_key_requireds" {
type = list(any)
default = []
description = "Specify if the method requires an API key."
sensitive = true
}
variable "request_models" {
type = list(any)
default = []
description = "A map of the API models used for the request's content type where key is the content type (e.g. application/json) and value is either Error, Empty (built-in models) or aws_api_gateway_model's name."
}
variable "request_validator_ids" {
type = list(any)
default = []
description = "The ID of a aws_api_gateway_request_validator."
sensitive = true
}
variable "request_parameters" {
type = list(any)
default = []
description = "A map of request query string parameters and headers that should be passed to the integration. For example: request_parameters = {\"method.request.header.X-Some-Header\" = true \"method.request.querystring.some-query-param\" = true} would define that the header X-Some-Header and the query string some-query-param must be provided in the request."
}
variable "integration_http_methods" {
type = list(any)
default = []
description = "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 via POST."
}
variable "integration_types" {
type = list(any)
default = []
description = "The integration input's type. 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 connection_type 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."
}
variable "connection_types" {
type = list(any)
default = []
description = "The integration input's 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)."
sensitive = true
}
variable "connection_ids" {
type = list(any)
default = []
description = "The id of the VpcLink used for the integration. Required if connection_type is VPC_LINK."
sensitive = true
}
variable "uri" {
type = list(any)
default = []
description = "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."
sensitive = true
}
variable "credentials" {
type = list(any)
default = []
description = "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/*."
sensitive = true
}
variable "integration_request_parameters" {
type = list(any)
default = []
description = "A map of request query string parameters and headers that should be passed to the backend responder. For example: request_parameters = { \"integration.request.header.X-Some-Other-Header\" = \"method.request.header.X-Some-Header\" }."
}
variable "request_templates" {
type = list(any)
default = []
description = "A map of the integration's request templates."
sensitive = true
}
variable "passthrough_behaviors" {
type = list(any)
default = []
description = "The integration passthrough behavior (WHEN_NO_MATCH, WHEN_NO_TEMPLATES, NEVER). Required if request_templates is used."
}
variable "cache_key_parameters" {
type = list(any)
default = []
description = "A list of cache key parameters for the integration."
sensitive = true
}
variable "cache_namespaces" {
type = list(any)
default = []
description = "The integration's cache namespace."
sensitive = true
}
variable "content_handlings" {
type = list(any)
default = []
description = "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."
}
variable "timeout_milliseconds" {
type = list(any)
default = []
description = "Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds."
}
variable "status_codes" {
type = list(any)
default = []
description = "The HTTP status code."
}
variable "response_models" {
type = list(any)
default = []
description = "A map of the API models used for the response's content type."
}
variable "response_parameters" {
type = list(any)
default = []
description = "A map of response parameters that can be sent to the caller. For example: response_parameters = { \"method.response.header.X-Some-Header\" = true } would define that the header X-Some-Header can be provided on the response."
}
variable "integration_response_parameters" {
type = list(any)
default = []
description = "A map of response parameters that can be read from the backend response. For example: response_parameters = { \"method.response.header.X-Some-Header\" = \"integration.response.header.X-Some-Other-Header\" }."
}
variable "response_templates" {
type = list(any)
default = []
description = "A map specifying the templates used to transform the integration response body."
}
variable "response_content_handlings" {
type = list(any)
default = []
description = "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 response payload will be passed through from the integration response to the method response without modification."
}
variable "stage_names" {
type = list(any)
default = []
description = "The name of the stage."
}
variable "cache_cluster_enableds" {
type = list(any)
default = []
description = "Specifies whether a cache cluster is enabled for the stage."
}
variable "cache_cluster_sizes" {
type = list(any)
default = []
description = "The size of the cache cluster for the stage, if enabled. Allowed values include 0.5, 1.6, 6.1, 13.5, 28.4, 58.2, 118 and 237."
}
variable "client_certificate_ids" {
type = list(any)
default = []
description = "The identifier of a client certificate for the stage"
sensitive = true
}
variable "descriptions" {
type = list(any)
default = []
description = "The description of the stage."
}
variable "documentation_versions" {
type = list(any)
default = []
description = "The version of the associated API documentation."
}
variable "stage_variables" {
type = list(any)
default = []
description = "A map that defines the stage variables."
}
variable "xray_tracing_enabled" {
type = list(any)
default = []
description = "A mapping of tags to assign to the resource."
}
variable "destination_arns" {
type = list(any)
default = []
description = "ARN of the log group to send the logs to. Automatically removes trailing :* if present."
sensitive = true
}
variable "formats" {
type = list(any)
default = []
description = "The formatting and values recorded in the logs."
}
variable "cert_enabled" {
type = bool
default = false
description = "Whether to create client certificate."
}
variable "cert_description" {
type = string
default = ""
description = "The description of the client certificate."
}
variable "authorizer_names" {
type = list(any)
default = []
description = "The name of the authorizer."
}
variable "authorizer_uri" {
type = list(any)
default = []
description = "The authorizer's Uniform Resource Identifier (URI). This must be a well-formed Lambda function URI in the form of arn:aws:apigateway:{region}:lambda:path/{service_api}, e.g. arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:012345678912:function:my-function/invocations."
sensitive = true
}
variable "authorizer_credentials" {
type = list(any)
default = []
description = "The credentials required for the authorizer. To specify an IAM Role for API Gateway to assume, use the IAM Role ARN."
sensitive = true
}
variable "authorizer_result_ttl_in_seconds" {
type = list(any)
default = []
description = "The TTL of cached authorizer results in seconds. Defaults to 300."
}
variable "identity_sources" {
type = list(any)
default = []
description = "The source of the identity in an incoming request. Defaults to method.request.header.Authorization. For REQUEST type, this may be a comma-separated list of values, including headers, query string parameters and stage variables - e.g. \"method.request.header.SomeHeaderName,method.request.querystring.SomeQueryStringName\"."
}
variable "authorizer_types" {
type = list(any)
default = []
description = "The type of the authorizer. Possible values are TOKEN for a Lambda function using a single authorization token submitted in a custom header, REQUEST for a Lambda function using incoming request parameters, or COGNITO_USER_POOLS for using an Amazon Cognito user pool. Defaults to TOKEN."
}
variable "identity_validation_expressions" {
type = list(any)
default = []
description = "A validation expression for the incoming identity. For TOKEN type, this value should be a regular expression. The incoming token from the client is matched against this expression, and will proceed if the token matches. If the token doesn't match, the client receives a 401 Unauthorized response."
}
variable "provider_arns" {
type = list(any)
default = []
description = "required for type COGNITO_USER_POOLS) A list of the Amazon Cognito user pool ARNs. Each element is of this format: arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}."
sensitive = true
}
variable "authorizer_count" {
type = number
default = 0
description = "Number of count to create Authorizers for api."
}
variable "gateway_response_count" {
type = number
default = 0
description = "Number of count to create Gateway Response for api."
}
variable "response_types" {
type = list(any)
default = []
description = "The response type of the associated GatewayResponse."
}
variable "gateway_status_codes" {
type = list(any)
default = []
description = "The HTTP status code of the Gateway Response."
}
variable "gateway_response_templates" {
type = list(any)
default = []
description = "A map specifying the parameters (paths, query strings and headers) of the Gateway Response."
}
variable "gateway_response_parameters" {
type = list(any)
default = []
description = "A map specifying the templates used to transform the response body."
}
variable "model_count" {
type = number
default = 0
description = "Number of count to create Model for api."
}
variable "model_names" {
type = list(any)
default = []
description = "The name of the model."
}
variable "model_descriptions" {
type = list(any)
default = []
description = "The description of the model."
}
variable "content_types" {
type = list(any)
default = []
description = "The content type of the model."
}
variable "schemas" {
type = list(any)
default = []
description = "The schema of the model in a JSON form."
}
variable "vpc_link_count" {
type = number
default = 0
description = "Number of count to create VPC Link for api."
}
variable "vpc_link_names" {
type = list(any)
default = []
description = "The name used to label and identify the VPC link."
}
variable "vpc_link_descriptions" {
type = list(any)
default = []
description = "The description of the VPC link."
}
variable "target_arns" {
type = list(any)
default = []
description = "The list of network load balancer arns in the VPC targeted by the VPC link. Currently AWS only supports 1 target."
sensitive = true
}
variable "key_count" {
type = number
default = 0
description = "Number of count to create key for api gateway."
}
variable "key_names" {
type = list(any)
default = []
description = "The name of the API key."
}
variable "key_descriptions" {
type = list(any)
default = []
description = "The API key description. Defaults to \"Managed by Terraform\"."
}
variable "enableds" {
type = list(any)
default = []
description = "Specifies whether the API key can be used by callers. Defaults to true."
}
variable "values" {
type = list(any)
default = []
description = "The value of the API key. If not specified, it will be automatically generated by AWS on creation."
}
variable "api_policy" {
default = null
description = "The policy document."
}
variable "model_schemas" {
default = []
description = "The schema of the model in a JSON form."
}