-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathfunction.ts
More file actions
156 lines (134 loc) · 3.03 KB
/
function.ts
File metadata and controls
156 lines (134 loc) · 3.03 KB
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
import { IKV, ICodeUri, Runtime } from './base';
export type IRuntime = `${Runtime}`;
export interface ILifecycleHook {
handler?: string;
timeout?: number;
}
export interface IHealthCheckConfig {
failureThreshold?: number;
httpGetUrl?: string;
initialDelaySeconds?: number;
periodSeconds?: number;
successThreshold?: number;
timeoutSeconds?: number;
}
export interface IAuthConfig {
userName?: string;
password?: string;
}
export interface ICertConfig {
insecure?: boolean;
rootCaCertBase64?: string;
}
export interface INetworkConfig {
vpcId?: string;
vSwitchId?: string;
securityGroupId?: string;
}
export interface IRegistryConfig {
authConfig?: IAuthConfig;
certConfig?: ICertConfig;
networkConfig?: INetworkConfig;
}
export interface ICustomContainerConfig {
command?: string[];
entrypoint?: string[];
healthCheckConfig?: IHealthCheckConfig;
image?: string;
port?: number;
registryConfig?: IRegistryConfig;
}
export interface ICustomRuntimeConfig {
args?: string[];
command?: string[];
healthCheckConfig?: IHealthCheckConfig;
port?: number;
}
export interface ICustomDNS {
searches?: string[];
nameServers?: string[];
dnsOptions?: Array<{ name: string; value: string }>;
}
export interface IGpuConfig {
gpuMemorySize?: number;
gpuType?: 'fc.gpu.tesla.1' | 'fc.gpu.ampere.1';
}
export interface ILogConfig {
project: string;
logstore: string;
enableInstanceMetrics?: boolean;
enableRequestMetrics?: boolean;
logBeginRule?: 'DefaultRegex' | 'None';
}
export interface INasConfig {
userId: number;
groupId: number;
mountPoints: Array<{
enableTLS?: boolean;
serverAddr: string;
mountDir: string;
}>;
}
export interface IOssMountConfig {
mountPoints: Array<{
bucketName: string;
bucketPath?: string;
endpoint: string;
mountDir: string;
readOnly?: boolean;
}>;
}
export interface ITracingConfig {
jaegerConfig?: {
endpoint: string;
};
params?: string;
type?: string;
}
export interface IVpcConfig {
securityGroupId: string;
vSwitchIds: string[] | 'auto';
vpcId: string;
}
export interface ITags {
key: string;
value: string;
}
export interface IFunction {
functionName: string;
runtime: IRuntime;
handler?: string;
code?: ICodeUri;
description?: string;
diskSize?: 512 | 10240;
internetAccess?: boolean;
layers?: string[];
cpu?: number;
memorySize?: number;
timeout?: number;
sessionAffinity?: string;
logConfig?: 'auto' | ILogConfig;
nasConfig?: 'auto' | INasConfig;
ossMountConfig?: IOssMountConfig;
role?: 'auto' | string;
vpcConfig?: 'auto' | IVpcConfig;
vpcBinding?: {
vpcIds: string[];
};
customContainerConfig?: ICustomContainerConfig;
customDNS?: ICustomDNS;
customRuntimeConfig?: ICustomRuntimeConfig;
environmentVariables?: IKV;
gpuConfig?: IGpuConfig;
tracingConfig?: ITracingConfig;
instanceLifecycleConfig?: {
initializer?: ILifecycleHook;
preStop?: ILifecycleHook;
};
tags?: ITags[];
annotations?: {
headers?: {
[key: string]: string;
};
};
}