cdk-drizzle-migrate 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +4136 -0
- package/.jsiiignore +0 -0
- package/API.md +249 -0
- package/LICENSE +202 -0
- package/README.md +115 -0
- package/lib/drizzle-migrate-provider.d.ts +58 -0
- package/lib/drizzle-migrate-provider.js +95 -0
- package/lib/handler/handler.js +49302 -0
- package/lib/handler/index.d.ts +8 -0
- package/lib/handler/index.js +8 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +18 -0
- package/node_modules/@types/aws-lambda/LICENSE +21 -0
- package/node_modules/@types/aws-lambda/README.md +15 -0
- package/node_modules/@types/aws-lambda/common/api-gateway.d.ts +83 -0
- package/node_modules/@types/aws-lambda/common/cloudfront.d.ts +245 -0
- package/node_modules/@types/aws-lambda/handler.d.ts +172 -0
- package/node_modules/@types/aws-lambda/index.d.ts +54 -0
- package/node_modules/@types/aws-lambda/package.json +226 -0
- package/node_modules/@types/aws-lambda/trigger/alb.d.ts +48 -0
- package/node_modules/@types/aws-lambda/trigger/amplify-resolver.d.ts +38 -0
- package/node_modules/@types/aws-lambda/trigger/api-gateway-authorizer.d.ts +246 -0
- package/node_modules/@types/aws-lambda/trigger/api-gateway-proxy.d.ts +336 -0
- package/node_modules/@types/aws-lambda/trigger/appsync-resolver.d.ts +121 -0
- package/node_modules/@types/aws-lambda/trigger/autoscaling.d.ts +41 -0
- package/node_modules/@types/aws-lambda/trigger/cdk-custom-resource.d.ts +158 -0
- package/node_modules/@types/aws-lambda/trigger/cloudformation-custom-resource.d.ts +236 -0
- package/node_modules/@types/aws-lambda/trigger/cloudfront-request.d.ts +22 -0
- package/node_modules/@types/aws-lambda/trigger/cloudfront-response.d.ts +21 -0
- package/node_modules/@types/aws-lambda/trigger/cloudwatch-alarm.d.ts +69 -0
- package/node_modules/@types/aws-lambda/trigger/cloudwatch-events.d.ts +8 -0
- package/node_modules/@types/aws-lambda/trigger/cloudwatch-logs.d.ts +37 -0
- package/node_modules/@types/aws-lambda/trigger/codebuild-cloudwatch-state.d.ts +104 -0
- package/node_modules/@types/aws-lambda/trigger/codecommit.d.ts +35 -0
- package/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch-action.d.ts +31 -0
- package/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch-pipeline.d.ts +32 -0
- package/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch-stage.d.ts +23 -0
- package/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch.d.ts +11 -0
- package/node_modules/@types/aws-lambda/trigger/codepipeline.d.ts +55 -0
- package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/_common.d.ts +41 -0
- package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/create-auth-challenge.d.ts +22 -0
- package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/custom-email-sender.d.ts +76 -0
- package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/custom-message.d.ts +52 -0
- package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/custom-sms-sender.d.ts +51 -0
- package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/define-auth-challenge.d.ts +21 -0
- package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/index.d.ts +128 -0
- package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/post-authentication.d.ts +15 -0
- package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/post-confirmation.d.ts +26 -0
- package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/pre-authentication.d.ts +16 -0
- package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/pre-signup.d.ts +31 -0
- package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/pre-token-generation-v2.d.ts +73 -0
- package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/pre-token-generation.d.ts +53 -0
- package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/user-migration.d.ts +40 -0
- package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/verify-auth-challenge-response.d.ts +22 -0
- package/node_modules/@types/aws-lambda/trigger/connect-contact-flow.d.ts +64 -0
- package/node_modules/@types/aws-lambda/trigger/dynamodb-stream.d.ts +55 -0
- package/node_modules/@types/aws-lambda/trigger/eventbridge.d.ts +19 -0
- package/node_modules/@types/aws-lambda/trigger/guard-duty-event-notification.d.ts +36 -0
- package/node_modules/@types/aws-lambda/trigger/iot-authorizer.d.ts +48 -0
- package/node_modules/@types/aws-lambda/trigger/iot.d.ts +28 -0
- package/node_modules/@types/aws-lambda/trigger/kinesis-firehose-transformation.d.ts +51 -0
- package/node_modules/@types/aws-lambda/trigger/kinesis-stream.d.ts +56 -0
- package/node_modules/@types/aws-lambda/trigger/lambda-function-url.d.ts +45 -0
- package/node_modules/@types/aws-lambda/trigger/lex-v2.d.ts +164 -0
- package/node_modules/@types/aws-lambda/trigger/lex.d.ts +120 -0
- package/node_modules/@types/aws-lambda/trigger/msk.d.ts +28 -0
- package/node_modules/@types/aws-lambda/trigger/s3-batch.d.ts +41 -0
- package/node_modules/@types/aws-lambda/trigger/s3-event-notification.d.ts +290 -0
- package/node_modules/@types/aws-lambda/trigger/s3.d.ts +60 -0
- package/node_modules/@types/aws-lambda/trigger/secretsmanager.d.ts +15 -0
- package/node_modules/@types/aws-lambda/trigger/self-managed-kafka.d.ts +27 -0
- package/node_modules/@types/aws-lambda/trigger/ses.d.ts +109 -0
- package/node_modules/@types/aws-lambda/trigger/sns.d.ts +39 -0
- package/node_modules/@types/aws-lambda/trigger/sqs.d.ts +58 -0
- package/node_modules/@types/aws-lambda/trigger/transfer-family-authorizer.d.ts +110 -0
- package/package.json +165 -0
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
import {
|
|
2
|
+
APIGatewayEventClientCertificate,
|
|
3
|
+
APIGatewayEventDefaultAuthorizerContext,
|
|
4
|
+
APIGatewayEventRequestContextWithAuthorizer,
|
|
5
|
+
} from "../common/api-gateway";
|
|
6
|
+
import { Callback, CognitoIdentity, Handler } from "../handler";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Works with Lambda Proxy Integration for Rest API or HTTP API integration Payload Format version 1.0
|
|
10
|
+
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
|
|
11
|
+
*/
|
|
12
|
+
export type APIGatewayProxyHandler = Handler<APIGatewayProxyEvent, APIGatewayProxyResult>;
|
|
13
|
+
/**
|
|
14
|
+
* Works with Lambda Proxy Integration for Rest API or HTTP API integration Payload Format version 1.0
|
|
15
|
+
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
|
|
16
|
+
*/
|
|
17
|
+
export type APIGatewayProxyCallback = Callback<APIGatewayProxyResult>;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Works with HTTP API integration Payload Format version 2.0
|
|
21
|
+
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
|
|
22
|
+
*/
|
|
23
|
+
export type APIGatewayProxyHandlerV2<T = never> = Handler<APIGatewayProxyEventV2, APIGatewayProxyResultV2<T>>;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Works with HTTP API integration Payload Format version 2.0
|
|
27
|
+
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-integration-requests.html
|
|
28
|
+
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-mapping-template-reference.html
|
|
29
|
+
*/
|
|
30
|
+
export type APIGatewayProxyWebsocketHandlerV2<T = never> = Handler<
|
|
31
|
+
APIGatewayProxyWebsocketEventV2,
|
|
32
|
+
APIGatewayProxyResultV2<T>
|
|
33
|
+
>;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Works with HTTP API integration Payload Format version 2.0 adds JWT Authroizer to RequestContext
|
|
37
|
+
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
|
|
38
|
+
*/
|
|
39
|
+
export type APIGatewayProxyHandlerV2WithJWTAuthorizer<T = never> = Handler<
|
|
40
|
+
APIGatewayProxyEventV2WithJWTAuthorizer,
|
|
41
|
+
APIGatewayProxyResultV2<T>
|
|
42
|
+
>;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Works with HTTP API integration Payload Format version 2.0 adds Lambda Authroizer to RequestContext
|
|
46
|
+
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
|
|
47
|
+
*/
|
|
48
|
+
export type APIGatewayProxyHandlerV2WithLambdaAuthorizer<TAuthorizerContext, T = never> = Handler<
|
|
49
|
+
APIGatewayProxyEventV2WithLambdaAuthorizer<TAuthorizerContext>,
|
|
50
|
+
APIGatewayProxyResultV2<T>
|
|
51
|
+
>;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Works with HTTP API integration Payload Format version 2.0 adds IAM Authroizer to RequestContext
|
|
55
|
+
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
|
|
56
|
+
*/
|
|
57
|
+
export type APIGatewayProxyHandlerV2WithIAMAuthorizer<T = never> = Handler<
|
|
58
|
+
APIGatewayProxyEventV2WithIAMAuthorizer,
|
|
59
|
+
APIGatewayProxyResultV2<T>
|
|
60
|
+
>;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Works with HTTP API integration Payload Format version 2.0
|
|
64
|
+
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
|
|
65
|
+
*/
|
|
66
|
+
export type APIGatewayProxyCallbackV2 = Callback<APIGatewayProxyResultV2>;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Works with Lambda Proxy Integration for Rest API or HTTP API integration Payload Format version 1.0
|
|
70
|
+
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
|
|
71
|
+
*/
|
|
72
|
+
export type APIGatewayProxyEvent = APIGatewayProxyEventBase<APIGatewayEventDefaultAuthorizerContext>;
|
|
73
|
+
|
|
74
|
+
export type APIGatewayProxyWithLambdaAuthorizerHandler<TAuthorizerContext> = Handler<
|
|
75
|
+
APIGatewayProxyWithLambdaAuthorizerEvent<TAuthorizerContext>,
|
|
76
|
+
APIGatewayProxyResult
|
|
77
|
+
>;
|
|
78
|
+
|
|
79
|
+
export type APIGatewayProxyWithCognitoAuthorizerHandler = Handler<
|
|
80
|
+
APIGatewayProxyWithCognitoAuthorizerEvent,
|
|
81
|
+
APIGatewayProxyResult
|
|
82
|
+
>;
|
|
83
|
+
|
|
84
|
+
export type APIGatewayProxyWithLambdaAuthorizerEvent<TAuthorizerContext> = APIGatewayProxyEventBase<
|
|
85
|
+
APIGatewayEventLambdaAuthorizerContext<TAuthorizerContext>
|
|
86
|
+
>;
|
|
87
|
+
|
|
88
|
+
export type APIGatewayProxyWithLambdaAuthorizerEventRequestContext<TAuthorizerContext> =
|
|
89
|
+
APIGatewayEventRequestContextWithAuthorizer<APIGatewayEventLambdaAuthorizerContext<TAuthorizerContext>>;
|
|
90
|
+
|
|
91
|
+
// API Gateway proxy integration mangles the context from a custom authorizer,
|
|
92
|
+
// converting all number or boolean properties to string, and adding some extra properties.
|
|
93
|
+
export type APIGatewayEventLambdaAuthorizerContext<TAuthorizerContext> =
|
|
94
|
+
& {
|
|
95
|
+
[P in keyof TAuthorizerContext]: TAuthorizerContext[P] extends null ? null : string;
|
|
96
|
+
}
|
|
97
|
+
& {
|
|
98
|
+
principalId: string;
|
|
99
|
+
integrationLatency: number;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export type APIGatewayProxyWithCognitoAuthorizerEvent = APIGatewayProxyEventBase<APIGatewayProxyCognitoAuthorizer>;
|
|
103
|
+
|
|
104
|
+
// All claims are coerced into strings.
|
|
105
|
+
export interface APIGatewayProxyCognitoAuthorizer {
|
|
106
|
+
claims: {
|
|
107
|
+
[name: string]: string;
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export interface APIGatewayProxyEventHeaders {
|
|
112
|
+
[name: string]: string | undefined;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface APIGatewayProxyEventMultiValueHeaders {
|
|
116
|
+
[name: string]: string[] | undefined;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface APIGatewayProxyEventPathParameters {
|
|
120
|
+
[name: string]: string | undefined;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export interface APIGatewayProxyEventQueryStringParameters {
|
|
124
|
+
[name: string]: string | undefined;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export interface APIGatewayProxyEventMultiValueQueryStringParameters {
|
|
128
|
+
[name: string]: string[] | undefined;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface APIGatewayProxyEventStageVariables {
|
|
132
|
+
[name: string]: string | undefined;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export interface APIGatewayProxyEventBase<TAuthorizerContext> {
|
|
136
|
+
body: string | null;
|
|
137
|
+
headers: APIGatewayProxyEventHeaders;
|
|
138
|
+
multiValueHeaders: APIGatewayProxyEventMultiValueHeaders;
|
|
139
|
+
httpMethod: string;
|
|
140
|
+
isBase64Encoded: boolean;
|
|
141
|
+
path: string;
|
|
142
|
+
pathParameters: APIGatewayProxyEventPathParameters | null;
|
|
143
|
+
queryStringParameters: APIGatewayProxyEventQueryStringParameters | null;
|
|
144
|
+
multiValueQueryStringParameters: APIGatewayProxyEventMultiValueQueryStringParameters | null;
|
|
145
|
+
stageVariables: APIGatewayProxyEventStageVariables | null;
|
|
146
|
+
requestContext: APIGatewayEventRequestContextWithAuthorizer<TAuthorizerContext>;
|
|
147
|
+
resource: string;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Works with Lambda Proxy Integration for Rest API or HTTP API integration Payload Format version 1.0
|
|
152
|
+
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
|
|
153
|
+
*/
|
|
154
|
+
export interface APIGatewayProxyResult {
|
|
155
|
+
statusCode: number;
|
|
156
|
+
headers?:
|
|
157
|
+
| {
|
|
158
|
+
[header: string]: boolean | number | string;
|
|
159
|
+
}
|
|
160
|
+
| undefined;
|
|
161
|
+
multiValueHeaders?:
|
|
162
|
+
| {
|
|
163
|
+
[header: string]: Array<boolean | number | string>;
|
|
164
|
+
}
|
|
165
|
+
| undefined;
|
|
166
|
+
body: string;
|
|
167
|
+
isBase64Encoded?: boolean | undefined;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Works with HTTP API integration Payload Format version 2.0
|
|
172
|
+
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
|
|
173
|
+
*/
|
|
174
|
+
export interface APIGatewayEventRequestContextV2 {
|
|
175
|
+
accountId: string;
|
|
176
|
+
apiId: string;
|
|
177
|
+
authentication?: {
|
|
178
|
+
clientCert: APIGatewayEventClientCertificate;
|
|
179
|
+
};
|
|
180
|
+
domainName: string;
|
|
181
|
+
domainPrefix: string;
|
|
182
|
+
http: {
|
|
183
|
+
method: string;
|
|
184
|
+
path: string;
|
|
185
|
+
protocol: string;
|
|
186
|
+
sourceIp: string;
|
|
187
|
+
userAgent: string;
|
|
188
|
+
};
|
|
189
|
+
requestId: string;
|
|
190
|
+
routeKey: string;
|
|
191
|
+
stage: string;
|
|
192
|
+
time: string;
|
|
193
|
+
timeEpoch: number;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Works with Websocket API integration Payload Format version 2.0
|
|
197
|
+
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-integration-requests.html
|
|
198
|
+
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-mapping-template-reference.html
|
|
199
|
+
*/
|
|
200
|
+
export interface APIGatewayEventWebsocketRequestContextV2 {
|
|
201
|
+
routeKey: string;
|
|
202
|
+
messageId: string;
|
|
203
|
+
eventType: "CONNECT" | "MESSAGE" | "DISCONNECT";
|
|
204
|
+
extendedRequestId: string;
|
|
205
|
+
requestTime: string;
|
|
206
|
+
messageDirection: "IN";
|
|
207
|
+
stage: string;
|
|
208
|
+
connectedAt: number;
|
|
209
|
+
requestTimeEpoch: number;
|
|
210
|
+
requestId: string;
|
|
211
|
+
domainName: string;
|
|
212
|
+
connectionId: string;
|
|
213
|
+
apiId: string;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Proxy Event with adaptable requestContext for different authorizer scenarios
|
|
218
|
+
*/
|
|
219
|
+
export interface APIGatewayProxyEventV2WithRequestContext<TRequestContext> {
|
|
220
|
+
version: string;
|
|
221
|
+
routeKey: string;
|
|
222
|
+
rawPath: string;
|
|
223
|
+
rawQueryString: string;
|
|
224
|
+
cookies?: string[];
|
|
225
|
+
headers: APIGatewayProxyEventHeaders;
|
|
226
|
+
queryStringParameters?: APIGatewayProxyEventQueryStringParameters;
|
|
227
|
+
requestContext: TRequestContext;
|
|
228
|
+
body?: string;
|
|
229
|
+
pathParameters?: APIGatewayProxyEventPathParameters;
|
|
230
|
+
isBase64Encoded: boolean;
|
|
231
|
+
stageVariables?: APIGatewayProxyEventStageVariables;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Proxy Websocket Event with adaptable requestContext for different authorizer scenarios
|
|
236
|
+
*/
|
|
237
|
+
export interface APIGatewayProxyWebsocketEventV2WithRequestContext<TRequestContext> {
|
|
238
|
+
requestContext: TRequestContext;
|
|
239
|
+
body?: string;
|
|
240
|
+
isBase64Encoded: boolean;
|
|
241
|
+
stageVariables?: APIGatewayProxyEventStageVariables;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Lambda Authorizer Payload
|
|
246
|
+
*/
|
|
247
|
+
export interface APIGatewayEventRequestContextLambdaAuthorizer<TAuthorizerContext> {
|
|
248
|
+
lambda: TAuthorizerContext;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* JWT Authorizer Payload
|
|
253
|
+
*/
|
|
254
|
+
export interface APIGatewayEventRequestContextJWTAuthorizer {
|
|
255
|
+
principalId: string;
|
|
256
|
+
integrationLatency: number;
|
|
257
|
+
jwt: {
|
|
258
|
+
claims: { [name: string]: string | number | boolean | string[] };
|
|
259
|
+
scopes: string[];
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* IAM Authorizer Payload
|
|
265
|
+
*/
|
|
266
|
+
export interface APIGatewayEventRequestContextIAMAuthorizer {
|
|
267
|
+
iam: {
|
|
268
|
+
accessKey: string;
|
|
269
|
+
accountId: string;
|
|
270
|
+
callerId: string;
|
|
271
|
+
cognitoIdentity: null;
|
|
272
|
+
principalOrgId: string;
|
|
273
|
+
userArn: string;
|
|
274
|
+
userId: string;
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export type APIGatewayProxyEventV2WithJWTAuthorizer = APIGatewayProxyEventV2WithRequestContext<
|
|
279
|
+
APIGatewayEventRequestContextV2WithAuthorizer<APIGatewayEventRequestContextJWTAuthorizer>
|
|
280
|
+
>;
|
|
281
|
+
|
|
282
|
+
export type APIGatewayProxyEventV2WithLambdaAuthorizer<TAuthorizerContext> = APIGatewayProxyEventV2WithRequestContext<
|
|
283
|
+
APIGatewayEventRequestContextV2WithAuthorizer<APIGatewayEventRequestContextLambdaAuthorizer<TAuthorizerContext>>
|
|
284
|
+
>;
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Event type when invoking Lambda function URLs with IAM authorizer
|
|
288
|
+
*/
|
|
289
|
+
export type APIGatewayProxyEventV2WithIAMAuthorizer = APIGatewayProxyEventV2WithRequestContext<
|
|
290
|
+
APIGatewayEventRequestContextV2WithAuthorizer<APIGatewayEventRequestContextIAMAuthorizer>
|
|
291
|
+
>;
|
|
292
|
+
|
|
293
|
+
export interface APIGatewayEventRequestContextV2WithAuthorizer<TAuthorizer> extends APIGatewayEventRequestContextV2 {
|
|
294
|
+
authorizer: TAuthorizer;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Default Proxy event with no Authorizer
|
|
299
|
+
*/
|
|
300
|
+
export type APIGatewayProxyEventV2 = APIGatewayProxyEventV2WithRequestContext<APIGatewayEventRequestContextV2>;
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Default Websocket Proxy event with no Authorizer
|
|
304
|
+
*/
|
|
305
|
+
export type APIGatewayProxyWebsocketEventV2 = APIGatewayProxyWebsocketEventV2WithRequestContext<
|
|
306
|
+
APIGatewayEventWebsocketRequestContextV2
|
|
307
|
+
>;
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Works with HTTP API integration Payload Format version 2.0
|
|
311
|
+
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
|
|
312
|
+
*/
|
|
313
|
+
export type APIGatewayProxyResultV2<T = never> = APIGatewayProxyStructuredResultV2 | string | T;
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Interface for structured response with `statusCode` and`headers`
|
|
317
|
+
* Works with HTTP API integration Payload Format version 2.0
|
|
318
|
+
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
|
|
319
|
+
*/
|
|
320
|
+
export interface APIGatewayProxyStructuredResultV2 {
|
|
321
|
+
statusCode?: number | undefined;
|
|
322
|
+
headers?:
|
|
323
|
+
| {
|
|
324
|
+
[header: string]: boolean | number | string;
|
|
325
|
+
}
|
|
326
|
+
| undefined;
|
|
327
|
+
body?: string | undefined;
|
|
328
|
+
isBase64Encoded?: boolean | undefined;
|
|
329
|
+
cookies?: string[] | undefined;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
// Legacy names
|
|
333
|
+
export type ProxyHandler = APIGatewayProxyHandler;
|
|
334
|
+
export type ProxyCallback = APIGatewayProxyCallback;
|
|
335
|
+
export type APIGatewayEvent = APIGatewayProxyEvent;
|
|
336
|
+
export type ProxyResult = APIGatewayProxyResult;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { Handler } from "../handler";
|
|
2
|
+
|
|
3
|
+
export type AppSyncResolverHandler<TArguments, TResult, TSource = Record<string, any> | null> = Handler<
|
|
4
|
+
AppSyncResolverEvent<TArguments, TSource>,
|
|
5
|
+
TResult
|
|
6
|
+
>;
|
|
7
|
+
|
|
8
|
+
// https:docs.aws.amazon.com/appsync/latest/devguide/tutorial-lambda-resolvers.html#advanced-use-case-batching
|
|
9
|
+
export type AppSyncBatchResolverHandler<TArguments, TResult, TSource = Record<string, any> | null> = Handler<
|
|
10
|
+
Array<AppSyncResolverEvent<TArguments, TSource>>,
|
|
11
|
+
TResult[]
|
|
12
|
+
>;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Use {@link AppSyncAuthorizerHandler}
|
|
16
|
+
*/
|
|
17
|
+
export type AppSyncAuthorizerHander<TResolverContext = undefined> = AppSyncAuthorizerHandler<TResolverContext>;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* See https://docs.aws.amazon.com/appsync/latest/devguide/security-authz.html#aws-lambda-authorization
|
|
21
|
+
*
|
|
22
|
+
* @param TResolverContext type of the resolverContext object that you can return from the handler
|
|
23
|
+
*/
|
|
24
|
+
export type AppSyncAuthorizerHandler<TResolverContext = undefined> = Handler<
|
|
25
|
+
AppSyncAuthorizerEvent,
|
|
26
|
+
AppSyncAuthorizerResult<TResolverContext>
|
|
27
|
+
>;
|
|
28
|
+
|
|
29
|
+
export interface AppSyncResolverEventHeaders {
|
|
30
|
+
[name: string]: string | undefined;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface AppSyncAuthorizerEventHeaders {
|
|
34
|
+
[name: string]: string | undefined;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type AppSyncIdentity =
|
|
38
|
+
| AppSyncIdentityIAM
|
|
39
|
+
| AppSyncIdentityCognito
|
|
40
|
+
| AppSyncIdentityOIDC
|
|
41
|
+
| AppSyncIdentityLambda
|
|
42
|
+
| undefined
|
|
43
|
+
| null;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* See https://docs.aws.amazon.com/appsync/latest/devguide/resolver-context-reference.html
|
|
47
|
+
*
|
|
48
|
+
* @param TArguments type of the arguments
|
|
49
|
+
* @param TSource type of the source
|
|
50
|
+
*/
|
|
51
|
+
// Maintainer's note: Some of these properties are shared with the Amplify resolver.
|
|
52
|
+
// It may be worth checking if changes here may be applicable there too.
|
|
53
|
+
export interface AppSyncResolverEvent<TArguments, TSource = Record<string, any> | null> {
|
|
54
|
+
arguments: TArguments;
|
|
55
|
+
identity?: AppSyncIdentity;
|
|
56
|
+
source: TSource;
|
|
57
|
+
request: {
|
|
58
|
+
headers: AppSyncResolverEventHeaders;
|
|
59
|
+
/** The API's custom domain if used for the request. */
|
|
60
|
+
domainName: string | null;
|
|
61
|
+
};
|
|
62
|
+
info: {
|
|
63
|
+
selectionSetList: string[];
|
|
64
|
+
selectionSetGraphQL: string;
|
|
65
|
+
parentTypeName: string;
|
|
66
|
+
fieldName: string;
|
|
67
|
+
variables: { [key: string]: any };
|
|
68
|
+
};
|
|
69
|
+
prev: { result: { [key: string]: any } } | null;
|
|
70
|
+
stash: { [key: string]: any };
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface AppSyncAuthorizerEvent {
|
|
74
|
+
authorizationToken: string;
|
|
75
|
+
requestContext: {
|
|
76
|
+
apiId: string;
|
|
77
|
+
accountId: string;
|
|
78
|
+
requestId: string;
|
|
79
|
+
queryString: string;
|
|
80
|
+
operationName?: string;
|
|
81
|
+
variables: { [key: string]: any };
|
|
82
|
+
};
|
|
83
|
+
requestHeaders: AppSyncAuthorizerEventHeaders;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface AppSyncAuthorizerResult<TResolverContext = undefined> {
|
|
87
|
+
isAuthorized: boolean;
|
|
88
|
+
resolverContext?: TResolverContext;
|
|
89
|
+
deniedFields?: string[];
|
|
90
|
+
ttlOverride?: number;
|
|
91
|
+
}
|
|
92
|
+
export interface AppSyncIdentityIAM {
|
|
93
|
+
accountId: string;
|
|
94
|
+
cognitoIdentityPoolId: string;
|
|
95
|
+
cognitoIdentityId: string;
|
|
96
|
+
sourceIp: string[];
|
|
97
|
+
username: string;
|
|
98
|
+
userArn: string;
|
|
99
|
+
cognitoIdentityAuthType: string;
|
|
100
|
+
cognitoIdentityAuthProvider: string;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface AppSyncIdentityCognito {
|
|
104
|
+
sub: string;
|
|
105
|
+
issuer: string;
|
|
106
|
+
username: string;
|
|
107
|
+
claims: any;
|
|
108
|
+
sourceIp: string[];
|
|
109
|
+
defaultAuthStrategy: string;
|
|
110
|
+
groups: string[] | null;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export interface AppSyncIdentityOIDC {
|
|
114
|
+
claims: any;
|
|
115
|
+
issuer: string;
|
|
116
|
+
sub: string;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface AppSyncIdentityLambda {
|
|
120
|
+
resolverContext: any;
|
|
121
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Callback, Handler } from "../handler";
|
|
2
|
+
|
|
3
|
+
export type AutoScalingScaleInHandler = Handler<AutoScalingScaleInEvent, AutoScalingScaleInResult>;
|
|
4
|
+
export type AutoScalingScaleInCallback = Callback<AutoScalingScaleInResult>;
|
|
5
|
+
|
|
6
|
+
export type AutoScalingInstanceMarketOption = "spot" | "on-demand";
|
|
7
|
+
|
|
8
|
+
export type AutoScalingScaleInCause = "SCALE_IN" | "INSTANCE_REFRESH" | "MAX_INSTANCE_LIFETIME" | "REBALANCE";
|
|
9
|
+
|
|
10
|
+
export interface AutoScalingTerminationRequest {
|
|
11
|
+
AvailabilityZone: string;
|
|
12
|
+
Capacity: number;
|
|
13
|
+
InstanceMarketOption: AutoScalingInstanceMarketOption;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface AutoScalingInstanceRecord {
|
|
17
|
+
AvailabilityZone: string;
|
|
18
|
+
InstanceId: string;
|
|
19
|
+
InstanceType: string;
|
|
20
|
+
InstanceMarketOption: AutoScalingInstanceMarketOption;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* An Auto Scaling Group may trigger a Scale In Event when you have attached
|
|
25
|
+
* a custom termination policy function. This event and the expected response are
|
|
26
|
+
* described in the Auto Scaling docs at:
|
|
27
|
+
*
|
|
28
|
+
* https://docs.aws.amazon.com/autoscaling/ec2/userguide/lambda-custom-termination-policy.html
|
|
29
|
+
*/
|
|
30
|
+
export interface AutoScalingScaleInEvent {
|
|
31
|
+
AutoScalingGroupARN: string;
|
|
32
|
+
AutoScalingGroupName: string;
|
|
33
|
+
CapacityToTerminate: AutoScalingTerminationRequest[];
|
|
34
|
+
Instances: AutoScalingInstanceRecord[];
|
|
35
|
+
Cause: AutoScalingScaleInCause;
|
|
36
|
+
HasMoreInstances?: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface AutoScalingScaleInResult {
|
|
40
|
+
InstanceIDs: string[];
|
|
41
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { Callback, Handler } from "../handler";
|
|
2
|
+
import {
|
|
3
|
+
CloudFormationCustomResourceEvent,
|
|
4
|
+
CloudFormationCustomResourceResourcePropertiesCommon,
|
|
5
|
+
} from "./cloudformation-custom-resource";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Request event sent to the Lambda `OnEvent` handler for a CDK Custom Resource
|
|
9
|
+
* Reference: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.custom_resources-readme.html#handling-lifecycle-events-onevent
|
|
10
|
+
* @template TResourceProperties User-defined input properties passed to the Custom Resource as part of any invocation
|
|
11
|
+
* @template TOldResourceProperties User-defined input properties passed to the Custom Resource as part of an `Update` invocation
|
|
12
|
+
*/
|
|
13
|
+
export type CdkCustomResourceEvent<
|
|
14
|
+
TResourceProperties = CloudFormationCustomResourceResourcePropertiesCommon,
|
|
15
|
+
TOldResourceProperties = TResourceProperties,
|
|
16
|
+
> =
|
|
17
|
+
& CloudFormationCustomResourceEvent<TResourceProperties, TOldResourceProperties>
|
|
18
|
+
& {
|
|
19
|
+
/**
|
|
20
|
+
* The response URL identifies a presigned S3 bucket that receives responses from the custom resource provider to AWS CloudFormation.
|
|
21
|
+
*
|
|
22
|
+
* **This URL should not be used.**
|
|
23
|
+
* The CDK Provider Framework will call this URL automatically based on the response produced by the Lambda handler.
|
|
24
|
+
*/
|
|
25
|
+
ResponseURL: string;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Lambda handler function for the `OnEvent` CDK Custom Resource
|
|
30
|
+
* Reference: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.custom_resources-readme.html#handling-lifecycle-events-onevent
|
|
31
|
+
*
|
|
32
|
+
* NOTE: this is not to be confused with traditional CloudFormation custom resources.
|
|
33
|
+
* @template TResourceProperties User-defined input properties passed to the Custom Resource as part of any invocation
|
|
34
|
+
* @template TData User-defined output properties that are retuned from any invocation
|
|
35
|
+
* @template TOldResourceProperties User-defined input properties passed to the Custom Resource as part of an `Update` invocation
|
|
36
|
+
*/
|
|
37
|
+
export type CdkCustomResourceHandler<
|
|
38
|
+
TResourceProperties = CloudFormationCustomResourceResourcePropertiesCommon,
|
|
39
|
+
TData extends Record<string, any> = Record<string, any>,
|
|
40
|
+
TOldResourceProperties = TResourceProperties,
|
|
41
|
+
> = Handler<CdkCustomResourceEvent<TResourceProperties, TOldResourceProperties>, CdkCustomResourceResponse<TData>>;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Lambda `OnEvent` callback function for a CDK Custom Resource
|
|
45
|
+
* @template TData User-defined output properties that are retuned from any invocation
|
|
46
|
+
*/
|
|
47
|
+
export type CdkCustomResourceCallback<TData extends Record<string, any>> = Callback<CdkCustomResourceResponse<TData>>;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Response from the `OnEvent` Lambda handler for a CDK Custom Resource
|
|
51
|
+
* Reference: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.custom_resources-readme.html#handling-lifecycle-events-onevent
|
|
52
|
+
* @template TData User-defined output properties that are retuned from any invocation
|
|
53
|
+
*/
|
|
54
|
+
export interface CdkCustomResourceResponse<TData extends Record<string, any> = Record<string, any>> {
|
|
55
|
+
/**
|
|
56
|
+
* This value should be an identifier unique to the custom resource vendor, and can be up to 1 KB in size. The value must be a non-empty string and must be identical for all responses for the same resource.
|
|
57
|
+
* The value returned for a `PhysicalResourceId` can change custom resource update operations. If the value returned is the same, it is considered a normal update. If the value returned is different, AWS CloudFormation recognizes the update as a replacement and sends a delete request to the old resource.
|
|
58
|
+
*
|
|
59
|
+
* If omitted for `Create` events, the event's `RequestId` will be used.
|
|
60
|
+
* For `Update`, the current physical ID will be used. If a different value is returned, CloudFormation will follow with a subsequent `Delete` for the previous ID (resource replacement).
|
|
61
|
+
* For `Delete`, it will always return the current physical resource ID, and if the user returns a different one, an error will occur.
|
|
62
|
+
*/
|
|
63
|
+
PhysicalResourceId?: string;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* The custom resource provider-defined name-value pairs to send with the response. You can access the values provided here by name in the template with `Fn::GetAtt`.
|
|
67
|
+
* NOTE: If the name-value pairs contain sensitive information, you should use the `NoEcho` field to mask the output of the custom resource. Otherwise, the values are visible through APIs that surface property values (such as `DescribeStackEvents`).
|
|
68
|
+
*/
|
|
69
|
+
Data?: TData;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Indicates whether to mask the output of the custom resource when retrieved by using the `Fn::GetAtt` function. If set to `true`, all returned values are masked with asterisks (*****), __except for those stored in the `Metadata` section of the template__. AWS CloudFormation does not transform, modify, or redact any information you include in the `Metadata` section. The default value is `false`.
|
|
73
|
+
*/
|
|
74
|
+
NoEcho?: boolean;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Any other field included in the response will be passed through to `isComplete`. This can sometimes be useful to pass state between the handlers.
|
|
78
|
+
*/
|
|
79
|
+
[Key: string]: any;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Request event sent to the Lambda `IsComplete` handler for an asynchronous CDK Custom Resource
|
|
84
|
+
* The input event to isComplete includes all request fields, combined with all fields returned from onEvent. If PhysicalResourceId has not been explicitly returned from onEvent, it's value will be calculated based on heuristics.
|
|
85
|
+
* Reference: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.custom_resources-readme.html#asynchronous-providers-iscomplete
|
|
86
|
+
* @template TResourceProperties User-defined input properties passed to the Custom Resource as part of any invocation
|
|
87
|
+
* @template TData User-defined output properties that are retuned from any invocation
|
|
88
|
+
* @template TOldResourceProperties User-defined input properties passed to the Custom Resource as part of an `Update` invocation
|
|
89
|
+
*/
|
|
90
|
+
export type CdkCustomResourceIsCompleteEvent<
|
|
91
|
+
TResourceProperties = CloudFormationCustomResourceResourcePropertiesCommon,
|
|
92
|
+
TData extends Record<string, any> = Record<string, any>,
|
|
93
|
+
TOldResourceProperties = TResourceProperties,
|
|
94
|
+
> = CdkCustomResourceEvent<TResourceProperties, TOldResourceProperties> & CdkCustomResourceResponse<TData>;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Common response properties from the `IsComplete` Lambda handler for a CDK Custom Resource
|
|
98
|
+
* Reference: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.custom_resources-readme.html#asynchronous-providers-iscomplete
|
|
99
|
+
* @template TData User-defined output properties that are retuned from any invocation
|
|
100
|
+
*/
|
|
101
|
+
export type CdkCustomResourceIsCompleteResponse<TData extends Record<string, any> = Record<string, any>> =
|
|
102
|
+
| CdkCustomResourceIsCompleteResponseSuccess<TData>
|
|
103
|
+
| CdkCustomResourceIsCompleteResponseWaiting;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Response properties that are specifically for a successful `IsComplete` response for a CDK Custom Resource
|
|
107
|
+
* Reference: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.custom_resources-readme.html#asynchronous-providers-iscomplete
|
|
108
|
+
* @template TData User-defined output properties that are retuned from any invocation
|
|
109
|
+
*/
|
|
110
|
+
export interface CdkCustomResourceIsCompleteResponseSuccess<TData extends Record<string, any> = Record<string, any>> {
|
|
111
|
+
/**
|
|
112
|
+
* Indicates the operation has finished.
|
|
113
|
+
*/
|
|
114
|
+
IsComplete: true;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* The custom resource provider-defined name-value pairs to send with the response. You can access the values provided here by name in the template with `Fn::GetAtt`.
|
|
118
|
+
* These attributes will be **merged** with the ones returned from `onEvent`.
|
|
119
|
+
*/
|
|
120
|
+
Data?: TData;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Response properties that are specifically for a still waiting `IsComplete` response for a CDK Custom Resource
|
|
125
|
+
* Reference: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.custom_resources-readme.html#asynchronous-providers-iscomplete
|
|
126
|
+
*/
|
|
127
|
+
export interface CdkCustomResourceIsCompleteResponseWaiting {
|
|
128
|
+
/**
|
|
129
|
+
* Indicates the operation has not finished.
|
|
130
|
+
*/
|
|
131
|
+
IsComplete: false;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Lambda `IsComplete` handler function for asynchronous CDK Custom Resources
|
|
136
|
+
* Reference: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.custom_resources-readme.html#asynchronous-providers-iscomplete
|
|
137
|
+
* @template TResourceProperties User-defined input properties passed to the Custom Resource as part of any invocation
|
|
138
|
+
* @template TOnEventData User-defined output properties that are retuned from any invocation of the `OnEvent` function
|
|
139
|
+
* @template TOldResourceProperties User-defined input properties passed to the Custom Resource as part of an `Update` invocation
|
|
140
|
+
* @template TIsCompleteData User-defined output properties that are retuned from any invocation of the `IsComplete` function
|
|
141
|
+
*/
|
|
142
|
+
export type CdkCustomResourceIsCompleteHandler<
|
|
143
|
+
TResourceProperties = CloudFormationCustomResourceResourcePropertiesCommon,
|
|
144
|
+
TOnEventData extends Record<string, any> = Record<string, any>,
|
|
145
|
+
TOldResourceProperties = TResourceProperties,
|
|
146
|
+
TIsCompleteData extends Record<string, any> = TOnEventData,
|
|
147
|
+
> = Handler<
|
|
148
|
+
CdkCustomResourceIsCompleteEvent<TResourceProperties, TOnEventData, TOldResourceProperties>,
|
|
149
|
+
CdkCustomResourceIsCompleteResponse<TIsCompleteData>
|
|
150
|
+
>;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Lambda `IsComplete` callback function for a CDK Custom Resource
|
|
154
|
+
* @template TData User-defined output properties that are retuned from any invocation
|
|
155
|
+
*/
|
|
156
|
+
export type CdkCustomResourceIsCompleteCallback<TData extends Record<string, any> = Record<string, any>> = Callback<
|
|
157
|
+
CdkCustomResourceIsCompleteResponse<TData>
|
|
158
|
+
>;
|