/
schema.lua
94 lines (91 loc) 路 2.37 KB
/
schema.lua
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
local typedefs = require "kong.db.schema.typedefs"
local REGIONS = {
"ap-northeast-1", "ap-northeast-2",
"ap-south-1",
"ap-southeast-1", "ap-southeast-2",
"ca-central-1",
"eu-central-1",
"eu-west-1", "eu-west-2",
"sa-east-1",
"us-east-1", "us-east-2",
"us-gov-west-1",
"us-west-1", "us-west-2",
}
return {
name = "aws-lambda",
fields = {
{ layer = typedefs.layer({ one_of = { "outer" } }) },
{ config = {
type = "record",
fields = {
{ timeout = {
type = "number",
required = true,
default = 60000
} },
{ keepalive = {
type = "number",
required = true,
default = 60000
} },
{ aws_key = {
type = "string",
required = true
} },
{ aws_secret = {
type = "string",
required = true
} },
{ aws_region = {
type = "string",
required = true,
one_of = REGIONS
} },
{ function_name = {
type = "string",
required = true
} },
{ qualifier = {
type = "string"
} },
{ invocation_type = {
type = "string",
required = true,
default = "RequestResponse",
one_of = { "RequestResponse", "Event", "DryRun" },
} },
{ log_type = {
type = "string",
required = true,
default = "Tail",
one_of = { "Tail", "None" },
} },
{ port = typedefs.port { default = 443 }, },
{ unhandled_status = {
type = "integer",
between = { 100, 999 },
} },
{ forward_request_method = {
type = "boolean",
default = false
} },
{ forward_request_uri = {
type = "boolean",
default = false
} },
{ forward_request_headers = {
type = "boolean",
default = false
} },
{ forward_request_body = {
type = "boolean",
default = false
} },
{ is_proxy_integration = {
type = "boolean",
default = false
} },
}
} },
},
}