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.
Files changed (76) hide show
  1. package/.jsii +4136 -0
  2. package/.jsiiignore +0 -0
  3. package/API.md +249 -0
  4. package/LICENSE +202 -0
  5. package/README.md +115 -0
  6. package/lib/drizzle-migrate-provider.d.ts +58 -0
  7. package/lib/drizzle-migrate-provider.js +95 -0
  8. package/lib/handler/handler.js +49302 -0
  9. package/lib/handler/index.d.ts +8 -0
  10. package/lib/handler/index.js +8 -0
  11. package/lib/index.d.ts +1 -0
  12. package/lib/index.js +18 -0
  13. package/node_modules/@types/aws-lambda/LICENSE +21 -0
  14. package/node_modules/@types/aws-lambda/README.md +15 -0
  15. package/node_modules/@types/aws-lambda/common/api-gateway.d.ts +83 -0
  16. package/node_modules/@types/aws-lambda/common/cloudfront.d.ts +245 -0
  17. package/node_modules/@types/aws-lambda/handler.d.ts +172 -0
  18. package/node_modules/@types/aws-lambda/index.d.ts +54 -0
  19. package/node_modules/@types/aws-lambda/package.json +226 -0
  20. package/node_modules/@types/aws-lambda/trigger/alb.d.ts +48 -0
  21. package/node_modules/@types/aws-lambda/trigger/amplify-resolver.d.ts +38 -0
  22. package/node_modules/@types/aws-lambda/trigger/api-gateway-authorizer.d.ts +246 -0
  23. package/node_modules/@types/aws-lambda/trigger/api-gateway-proxy.d.ts +336 -0
  24. package/node_modules/@types/aws-lambda/trigger/appsync-resolver.d.ts +121 -0
  25. package/node_modules/@types/aws-lambda/trigger/autoscaling.d.ts +41 -0
  26. package/node_modules/@types/aws-lambda/trigger/cdk-custom-resource.d.ts +158 -0
  27. package/node_modules/@types/aws-lambda/trigger/cloudformation-custom-resource.d.ts +236 -0
  28. package/node_modules/@types/aws-lambda/trigger/cloudfront-request.d.ts +22 -0
  29. package/node_modules/@types/aws-lambda/trigger/cloudfront-response.d.ts +21 -0
  30. package/node_modules/@types/aws-lambda/trigger/cloudwatch-alarm.d.ts +69 -0
  31. package/node_modules/@types/aws-lambda/trigger/cloudwatch-events.d.ts +8 -0
  32. package/node_modules/@types/aws-lambda/trigger/cloudwatch-logs.d.ts +37 -0
  33. package/node_modules/@types/aws-lambda/trigger/codebuild-cloudwatch-state.d.ts +104 -0
  34. package/node_modules/@types/aws-lambda/trigger/codecommit.d.ts +35 -0
  35. package/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch-action.d.ts +31 -0
  36. package/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch-pipeline.d.ts +32 -0
  37. package/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch-stage.d.ts +23 -0
  38. package/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch.d.ts +11 -0
  39. package/node_modules/@types/aws-lambda/trigger/codepipeline.d.ts +55 -0
  40. package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/_common.d.ts +41 -0
  41. package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/create-auth-challenge.d.ts +22 -0
  42. package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/custom-email-sender.d.ts +76 -0
  43. package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/custom-message.d.ts +52 -0
  44. package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/custom-sms-sender.d.ts +51 -0
  45. package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/define-auth-challenge.d.ts +21 -0
  46. package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/index.d.ts +128 -0
  47. package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/post-authentication.d.ts +15 -0
  48. package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/post-confirmation.d.ts +26 -0
  49. package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/pre-authentication.d.ts +16 -0
  50. package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/pre-signup.d.ts +31 -0
  51. package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/pre-token-generation-v2.d.ts +73 -0
  52. package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/pre-token-generation.d.ts +53 -0
  53. package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/user-migration.d.ts +40 -0
  54. package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/verify-auth-challenge-response.d.ts +22 -0
  55. package/node_modules/@types/aws-lambda/trigger/connect-contact-flow.d.ts +64 -0
  56. package/node_modules/@types/aws-lambda/trigger/dynamodb-stream.d.ts +55 -0
  57. package/node_modules/@types/aws-lambda/trigger/eventbridge.d.ts +19 -0
  58. package/node_modules/@types/aws-lambda/trigger/guard-duty-event-notification.d.ts +36 -0
  59. package/node_modules/@types/aws-lambda/trigger/iot-authorizer.d.ts +48 -0
  60. package/node_modules/@types/aws-lambda/trigger/iot.d.ts +28 -0
  61. package/node_modules/@types/aws-lambda/trigger/kinesis-firehose-transformation.d.ts +51 -0
  62. package/node_modules/@types/aws-lambda/trigger/kinesis-stream.d.ts +56 -0
  63. package/node_modules/@types/aws-lambda/trigger/lambda-function-url.d.ts +45 -0
  64. package/node_modules/@types/aws-lambda/trigger/lex-v2.d.ts +164 -0
  65. package/node_modules/@types/aws-lambda/trigger/lex.d.ts +120 -0
  66. package/node_modules/@types/aws-lambda/trigger/msk.d.ts +28 -0
  67. package/node_modules/@types/aws-lambda/trigger/s3-batch.d.ts +41 -0
  68. package/node_modules/@types/aws-lambda/trigger/s3-event-notification.d.ts +290 -0
  69. package/node_modules/@types/aws-lambda/trigger/s3.d.ts +60 -0
  70. package/node_modules/@types/aws-lambda/trigger/secretsmanager.d.ts +15 -0
  71. package/node_modules/@types/aws-lambda/trigger/self-managed-kafka.d.ts +27 -0
  72. package/node_modules/@types/aws-lambda/trigger/ses.d.ts +109 -0
  73. package/node_modules/@types/aws-lambda/trigger/sns.d.ts +39 -0
  74. package/node_modules/@types/aws-lambda/trigger/sqs.d.ts +58 -0
  75. package/node_modules/@types/aws-lambda/trigger/transfer-family-authorizer.d.ts +110 -0
  76. package/package.json +165 -0
@@ -0,0 +1,236 @@
1
+ import { Handler } from "../handler";
2
+
3
+ /**
4
+ * Named service-defined resource properties
5
+ * Reference: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref-requests.html#crpg-ref-request-properties
6
+ */
7
+ export interface CloudFormationCustomResourceResourcePropertiesCommon extends Record<string, any> {
8
+ /**
9
+ * The service token, such as an Amazon SNS topic ARN or Lambda function ARN. The service token must be from the same Region as the stack.
10
+ */
11
+ ServiceToken: string;
12
+
13
+ /**
14
+ * The maximum time, in seconds, that can elapse before a custom resource operation times out.
15
+ * The value must be an integer from 1 to 3600. The default value is 3600 seconds (1 hour).
16
+ */
17
+ ServiceTimeout?: string;
18
+ }
19
+
20
+ /**
21
+ * Lambda handler function for a Lambda-backed CloudFormation Custom Resource
22
+ *
23
+ * NOTE: responses are *not* returned from the Lambda handler but rather they are sent to the event ResponseURL.
24
+ * @template TResourceProperties User-defined input properties passed to the Custom Resource as part of any invocation
25
+ * @template TOldResourceProperties User-defined input properties passed to the Custom Resource as part of an `Update` invocation
26
+ */
27
+ export type CloudFormationCustomResourceHandler<
28
+ TResourceProperties = CloudFormationCustomResourceResourcePropertiesCommon,
29
+ TOldResourceProperties = TResourceProperties,
30
+ > = Handler<CloudFormationCustomResourceEvent<TResourceProperties, TOldResourceProperties>, void>;
31
+
32
+ /**
33
+ * Request event sent to the Lambda handler for a Lambda-backed CloudFormation Custom Resource
34
+ * Reference: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref-requests.html#crpg-ref-request-fields
35
+ * @template TResourceProperties User-defined input properties passed to the Custom Resource as part of any invocation
36
+ * @template TOldResourceProperties User-defined input properties passed to the Custom Resource as part of an `Update` invocation
37
+ */
38
+ export type CloudFormationCustomResourceEvent<
39
+ TResourceProperties = CloudFormationCustomResourceResourcePropertiesCommon,
40
+ TOldResourceProperties = TResourceProperties,
41
+ > =
42
+ | CloudFormationCustomResourceCreateEvent<TResourceProperties>
43
+ | CloudFormationCustomResourceUpdateEvent<TResourceProperties, TOldResourceProperties>
44
+ | CloudFormationCustomResourceDeleteEvent<TResourceProperties>;
45
+
46
+ /**
47
+ * Response from a Lambda handler for a Lambda-backed CloudFormation Custom Resource
48
+ * Reference: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref-responses.html
49
+ *
50
+ * NOTE: responses are *not* returned from the Lambda handler but rather they are sent to the event ResponseURL.
51
+ * @template TData User-defined output properties that are retuned from any invocation
52
+ */
53
+ export type CloudFormationCustomResourceResponse<TData extends Record<string, any> = Record<string, any>> =
54
+ | CloudFormationCustomResourceSuccessResponse<TData>
55
+ | CloudFormationCustomResourceFailedResponse<TData>;
56
+
57
+ /**
58
+ * Request properties that are common to all invocations of a Lambda-backed CloudFormation Custom Resource
59
+ * Reference: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref-requests.html#crpg-ref-request-fields
60
+ * @template TResourceProperties User-defined input properties passed to the Custom Resource as part of any invocation
61
+ */
62
+ export interface CloudFormationCustomResourceEventCommon<
63
+ TResourceProperties = CloudFormationCustomResourceResourcePropertiesCommon,
64
+ > {
65
+ /**
66
+ * The service token, such as an Amazon SNS topic ARN or Lambda function ARN. The service token must be from the same Region as the stack.
67
+ */
68
+ ServiceToken: string;
69
+
70
+ /**
71
+ * The response URL identifies a presigned S3 bucket that receives responses from the custom resource provider to AWS CloudFormation.
72
+ */
73
+ ResponseURL: string;
74
+
75
+ /**
76
+ * The Amazon Resource Name (ARN) that identifies the stack that contains the custom resource.
77
+ * Combining the `StackId` with the `RequestId` forms a value that you can use to uniquely identify a request on a particular custom resource.
78
+ */
79
+ StackId: string;
80
+
81
+ /**
82
+ * A unique ID for the request.
83
+ * Combining the `StackId` with the `RequestId` forms a value that you can use to uniquely identify a request on a particular custom resource.
84
+ */
85
+ RequestId: string;
86
+
87
+ /**
88
+ * The template developer-chosen name (logical ID) of the custom resource in the AWS CloudFormation template. This is provided to facilitate communication between the custom resource provider and the template developer.
89
+ */
90
+ LogicalResourceId: string;
91
+
92
+ /**
93
+ * The template developer-chosen resource type of the custom resource in the CloudFormation template. Custom resource type names can be up to 60 characters long and can include alphanumeric and the following characters: `_@-`.
94
+ */
95
+ ResourceType: string;
96
+
97
+ /**
98
+ * This field contains the contents of the `Properties` object sent by the template developer. Its contents are defined by the custom resource provider.
99
+ */
100
+ ResourceProperties: TResourceProperties & CloudFormationCustomResourceResourcePropertiesCommon;
101
+ }
102
+
103
+ /**
104
+ * Request properties specifically for the `Create` invocation of a Lambda-backed CloudFormation Custom Resource
105
+ * @template TResourceProperties User-defined input properties passed to the Custom Resource as part of any invocation
106
+ */
107
+ export interface CloudFormationCustomResourceCreateEvent<
108
+ TResourceProperties = CloudFormationCustomResourceResourcePropertiesCommon,
109
+ > extends CloudFormationCustomResourceEventCommon<TResourceProperties> {
110
+ /**
111
+ * The request type is set by the CloudFormation stack operation (create-stack, update-stack, or delete-stack) that was initiated by the template developer for the stack that contains the custom resource.
112
+ */
113
+ RequestType: "Create";
114
+ }
115
+
116
+ /**
117
+ * Request properties specifically for the `Update` invocation of a Lambda-backed CloudFormation Custom Resource
118
+ * @template TResourceProperties User-defined input properties passed to the Custom Resource as part of any invocation
119
+ * @template TOldResourceProperties User-defined input properties passed to the Custom Resource as part of an `Update` invocation
120
+ */
121
+ export interface CloudFormationCustomResourceUpdateEvent<
122
+ TResourceProperties = CloudFormationCustomResourceResourcePropertiesCommon,
123
+ TOldResourceProperties = TResourceProperties,
124
+ > extends CloudFormationCustomResourceEventCommon<TResourceProperties> {
125
+ /**
126
+ * The request type is set by the CloudFormation stack operation (create-stack, update-stack, or delete-stack) that was initiated by the template developer for the stack that contains the custom resource.
127
+ */
128
+ RequestType: "Update";
129
+
130
+ /**
131
+ * A required custom resource provider-defined physical ID that is unique for that provider.
132
+ * 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.
133
+ */
134
+ PhysicalResourceId: string;
135
+
136
+ /**
137
+ * Used only for `Update` requests. Contains the resource properties that were declared previous to the update request.
138
+ */
139
+ OldResourceProperties: TOldResourceProperties;
140
+ }
141
+
142
+ /**
143
+ * Request properties specifically for the `Delete` invocation of a Lambda-backed CloudFormation Custom Resource
144
+ * @template TResourceProperties User-defined input properties passed to the Custom Resource as part of any invocation
145
+ */
146
+ export interface CloudFormationCustomResourceDeleteEvent<
147
+ TResourceProperties = CloudFormationCustomResourceResourcePropertiesCommon,
148
+ > extends CloudFormationCustomResourceEventCommon<TResourceProperties> {
149
+ /**
150
+ * The request type is set by the CloudFormation stack operation (create-stack, update-stack, or delete-stack) that was initiated by the template developer for the stack that contains the custom resource.
151
+ */
152
+ RequestType: "Delete";
153
+
154
+ /**
155
+ * A required custom resource provider-defined physical ID that is unique for that provider.
156
+ * 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.
157
+ */
158
+ PhysicalResourceId: string;
159
+ }
160
+
161
+ /**
162
+ * Response properties that are common to all invocations of a Lambda-backed CloudFormation Custom Resource
163
+ * Reference: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref-responses.html
164
+ * @template TData User-defined output properties that are retuned from any invocation
165
+ */
166
+ export interface CloudFormationCustomResourceResponseCommon<TData extends Record<string, any> = Record<string, any>> {
167
+ /**
168
+ * 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.
169
+ * 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.
170
+ */
171
+ PhysicalResourceId: string;
172
+
173
+ /**
174
+ * The Amazon Resource Name (ARN) that identifies the stack that contains the custom resource. This response value should be copied verbatim from the request.
175
+ */
176
+ StackId: string;
177
+
178
+ /**
179
+ * A unique ID for the request. This response value should be copied verbatim from the request.
180
+ */
181
+ RequestId: string;
182
+
183
+ /**
184
+ * The template developer-chosen name (logical ID) of the custom resource in the AWS CloudFormation template. This response value should be copied verbatim from the request.
185
+ */
186
+ LogicalResourceId: string;
187
+
188
+ /**
189
+ * 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`.
190
+ * 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`).
191
+ */
192
+ Data?: TData | undefined;
193
+
194
+ /**
195
+ * 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`.
196
+ */
197
+ NoEcho?: boolean | undefined;
198
+ }
199
+
200
+ /**
201
+ * Response properties that are specifically for a response indicating succesful invocation of a Lambda-backed CloudFormation Custom Resource
202
+ * Reference: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref-responses.html
203
+ * @template TData User-defined output properties that are retuned from any invocation
204
+ */
205
+ export interface CloudFormationCustomResourceSuccessResponse<TData extends Record<string, any> = Record<string, any>>
206
+ extends CloudFormationCustomResourceResponseCommon<TData>
207
+ {
208
+ /**
209
+ * The status value sent by the custom resource provider in response to an AWS CloudFormation-generated request.
210
+ */
211
+ Status: "SUCCESS";
212
+
213
+ /**
214
+ * Describes the reason for a failure response.
215
+ */
216
+ Reason?: string | undefined;
217
+ }
218
+
219
+ /**
220
+ * Response properties that are specifically for a response indicating failed invocation of a Lambda-backed CloudFormation Custom Resource
221
+ * Reference: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref-responses.html
222
+ * @template TData User-defined output properties that are retuned from any invocation
223
+ */
224
+ export interface CloudFormationCustomResourceFailedResponse<TData extends Record<string, any> = Record<string, any>>
225
+ extends CloudFormationCustomResourceResponseCommon<TData>
226
+ {
227
+ /**
228
+ * The status value sent by the custom resource provider in response to an AWS CloudFormation-generated request.
229
+ */
230
+ Status: "FAILED";
231
+
232
+ /**
233
+ * Describes the reason for a failure response.
234
+ */
235
+ Reason: string;
236
+ }
@@ -0,0 +1,22 @@
1
+ import type { CloudFrontEvent, CloudFrontRequest, CloudFrontResultResponse } from "../common/cloudfront";
2
+ import type { Callback, Handler } from "../handler";
3
+
4
+ export type CloudFrontRequestHandler = Handler<CloudFrontRequestEvent, CloudFrontRequestResult>;
5
+ export type CloudFrontRequestCallback = Callback<CloudFrontRequestResult>;
6
+
7
+ export interface CloudFrontRequestEventRecord {
8
+ cf: CloudFrontEvent & {
9
+ request: CloudFrontRequest;
10
+ };
11
+ }
12
+
13
+ /**
14
+ * CloudFront viewer request or origin request event
15
+ *
16
+ * https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html#lambda-event-structure-request
17
+ */
18
+ export interface CloudFrontRequestEvent {
19
+ Records: CloudFrontRequestEventRecord[];
20
+ }
21
+
22
+ export type CloudFrontRequestResult = undefined | null | CloudFrontResultResponse | CloudFrontRequest;
@@ -0,0 +1,21 @@
1
+ import { CloudFrontEvent, CloudFrontRequest, CloudFrontResponse, CloudFrontResultResponse } from "../common/cloudfront";
2
+ import { Callback, Handler } from "../handler";
3
+
4
+ export type CloudFrontResponseHandler = Handler<CloudFrontResponseEvent, CloudFrontResponseResult>;
5
+ export type CloudFrontResponseCallback = Callback<CloudFrontResponseResult>;
6
+
7
+ /**
8
+ * CloudFront viewer response or origin response event
9
+ *
10
+ * https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html#lambda-event-structure-response
11
+ */
12
+ export interface CloudFrontResponseEvent {
13
+ Records: Array<{
14
+ cf: CloudFrontEvent & {
15
+ readonly request: Pick<CloudFrontRequest, Exclude<keyof CloudFrontRequest, "body">>;
16
+ response: CloudFrontResponse;
17
+ };
18
+ }>;
19
+ }
20
+
21
+ export type CloudFrontResponseResult = undefined | null | CloudFrontResultResponse;
@@ -0,0 +1,69 @@
1
+ import { Handler } from "../handler";
2
+
3
+ export type CloudWatchAlarmHandler = Handler<CloudWatchAlarmEvent, void>;
4
+
5
+ export interface CloudWatchAlarmEvent {
6
+ source: string;
7
+ alarmArn: string;
8
+ accountId: string;
9
+ time: string;
10
+ region: string;
11
+ alarmData: CloudWatchAlarmData;
12
+ }
13
+
14
+ export interface CloudWatchAlarmState {
15
+ value: string;
16
+ reason: string;
17
+ timestamp: string;
18
+ reasonData?: string;
19
+ actionsSuppressedBy?: string;
20
+ actionsSuppressedReason?: string;
21
+ }
22
+
23
+ export interface CloudWatchMetric {
24
+ namespace: string;
25
+ name: string;
26
+ dimensions?: Record<string, string>;
27
+ }
28
+
29
+ export interface CloudWatchMetricStat {
30
+ metric: CloudWatchMetric;
31
+ period: number;
32
+ stat: string;
33
+ unit?: string;
34
+ }
35
+
36
+ export interface CloudWatchAlarmMetric {
37
+ id: string;
38
+ metricStat: CloudWatchMetricStat;
39
+ returnData: boolean;
40
+ }
41
+
42
+ export interface CloudWatchAlarmExpression {
43
+ id: string;
44
+ expression: string;
45
+ label: string;
46
+ returnData: boolean;
47
+ }
48
+
49
+ export type CloudWatchAlarmMetricDataQuery = CloudWatchAlarmMetric | CloudWatchAlarmExpression;
50
+
51
+ export interface CloudWatchAlarmConfiguration {
52
+ metrics: CloudWatchAlarmMetricDataQuery[];
53
+ description?: string;
54
+ }
55
+
56
+ export interface CloudWatchAlarmCompositeConfiguration {
57
+ alarmRule: string;
58
+ description?: string;
59
+ actionsSuppressor?: string;
60
+ actionsSuppressorWaitPeriod?: number;
61
+ actionsSuppressorExtensionPeriod?: number;
62
+ }
63
+
64
+ export interface CloudWatchAlarmData {
65
+ alarmName: string;
66
+ state: CloudWatchAlarmState;
67
+ previousState: CloudWatchAlarmState;
68
+ configuration: CloudWatchAlarmConfiguration | CloudWatchAlarmCompositeConfiguration;
69
+ }
@@ -0,0 +1,8 @@
1
+ import { EventBridgeEvent, EventBridgeHandler } from "../trigger/eventbridge";
2
+
3
+ export type ScheduledHandler<TDetail = any> = EventBridgeHandler<"Scheduled Event", TDetail, void>;
4
+
5
+ /**
6
+ * https://docs.aws.amazon.com/lambda/latest/dg/with-scheduled-events.html
7
+ */
8
+ export interface ScheduledEvent<TDetail = any> extends EventBridgeEvent<"Scheduled Event", TDetail> {}
@@ -0,0 +1,37 @@
1
+ import { Handler } from "../handler";
2
+
3
+ export type CloudWatchLogsHandler = Handler<CloudWatchLogsEvent, void>;
4
+
5
+ /**
6
+ * See http://docs.aws.amazon.com/lambda/latest/dg/eventsources.html#eventsources-cloudwatch-logs
7
+ */
8
+ export interface CloudWatchLogsEvent {
9
+ awslogs: CloudWatchLogsEventData;
10
+ }
11
+
12
+ export interface CloudWatchLogsEventData {
13
+ data: string;
14
+ }
15
+
16
+ export interface CloudWatchLogsDecodedData {
17
+ owner: string;
18
+ logGroup: string;
19
+ logStream: string;
20
+ subscriptionFilters: string[];
21
+ messageType: string;
22
+ logEvents: CloudWatchLogsLogEvent[];
23
+ }
24
+
25
+ export interface CloudWatchLogsLogEventExtractedFields {
26
+ [name: string]: string | undefined;
27
+ }
28
+
29
+ /**
30
+ * See http://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/SubscriptionFilters.html#LambdaFunctionExample
31
+ */
32
+ export interface CloudWatchLogsLogEvent {
33
+ id: string;
34
+ timestamp: number;
35
+ message: string;
36
+ extractedFields?: CloudWatchLogsLogEventExtractedFields | undefined;
37
+ }
@@ -0,0 +1,104 @@
1
+ import { EventBridgeEvent, EventBridgeHandler } from "./eventbridge";
2
+
3
+ export type CodeBuildCloudWatchStateHandler = EventBridgeHandler<
4
+ "CodeBuild Build State Change",
5
+ CodeBuildStateEventDetail,
6
+ void
7
+ >;
8
+
9
+ export type CodeBuildStateType = "IN_PROGRESS" | "SUCCEEDED" | "FAILED" | "STOPPED";
10
+ export type CodeBuildPhaseType =
11
+ | "COMPLETED"
12
+ | "FINALIZING"
13
+ | "UPLOAD_ARTIFACTS"
14
+ | "POST_BUILD"
15
+ | "BUILD"
16
+ | "PRE_BUILD"
17
+ | "INSTALL"
18
+ | "QUEUED"
19
+ | "DOWNLOAD_SOURCE"
20
+ | "PROVISIONING"
21
+ | "SUBMITTED";
22
+ export type CodeBuildPhaseStatusType = "TIMED_OUT" | "STOPPED" | "FAILED" | "SUCCEEDED" | "FAULT" | "CLIENT_ERROR";
23
+ export type CodeBuildCacheType = "NO_CACHE" | "LOCAL" | "S3";
24
+ export type CodeBuildSourceLocationType =
25
+ | "CODECOMMIT"
26
+ | "CODEPIPELINE"
27
+ | "GITHUB"
28
+ | "GITHUB_ENTERPRISE"
29
+ | "BITBUCKET"
30
+ | "S3"
31
+ | "NO_SOURCE";
32
+ export type CodeBuildEnvironmentType =
33
+ | "LINUX_CONTAINER"
34
+ | "LINUX_GPU_CONTAINER"
35
+ | "WINDOWS_CONTAINER"
36
+ | "ARM_CONTAINER";
37
+ export type CodeBuildEnvironmentPullCredentialsType = "CODEBUILD" | "SERVICE_ROLE";
38
+ export type CodeBuildEnvironmentComputeType =
39
+ | "BUILD_GENERAL1_SMALL"
40
+ | "BUILD_GENERAL1_MEDIUM"
41
+ | "BUILD_GENERAL1_LARGE"
42
+ | "BUILD_GENERAL1_2XLARGE";
43
+ export type CodeBuildEnvironmentVariableType = "PARAMETER_STORE" | "PLAINTEXT" | "SECRETS_MANAGER";
44
+
45
+ export interface CodeBuildStateEventDetail {
46
+ "build-status": CodeBuildStateType;
47
+ "project-name": string;
48
+ "build-id": string;
49
+ "current-phase": CodeBuildPhaseType;
50
+ "current-phase-context": string;
51
+ version: string;
52
+ "additional-information": {
53
+ cache: {
54
+ type: CodeBuildCacheType;
55
+ };
56
+ "build-number": number;
57
+ "timeout-in-minutes": number;
58
+ "build-complete": boolean;
59
+ initiator: string;
60
+ "build-start-time": string;
61
+ source: {
62
+ buildspec: string;
63
+ location: string;
64
+ type: CodeBuildSourceLocationType;
65
+ };
66
+ "source-version": string;
67
+ artifact: {
68
+ location: string;
69
+ };
70
+ environment: {
71
+ image: string;
72
+ "privileged-mode": boolean;
73
+ "image-pull-credentials-type"?: CodeBuildEnvironmentPullCredentialsType | undefined;
74
+ "compute-type": CodeBuildEnvironmentComputeType;
75
+ type: CodeBuildEnvironmentType;
76
+ "environment-variables": Array<{
77
+ name: string;
78
+ type?: CodeBuildEnvironmentVariableType | undefined;
79
+ value: string;
80
+ }>;
81
+ };
82
+ "project-file-system-locations": [];
83
+ logs: {
84
+ "group-name": string;
85
+ "stream-name": string;
86
+ "deep-link": string;
87
+ };
88
+ phases: Array<{
89
+ "phase-context"?: string[] | undefined; // Not available for COMPLETED phase-type
90
+ "start-time": string;
91
+ "end-time"?: string | undefined; // Not available for COMPLETED phase-type
92
+ "duration-in-seconds"?: number | undefined; // Not available for COMPLETED phase-type
93
+ "phase-type": CodeBuildPhaseType;
94
+ "phase-status"?: CodeBuildPhaseStatusType | undefined; // Not available for COMPLETED phase-type
95
+ }>;
96
+ "queued-timeout-in-minutes": number;
97
+ };
98
+ }
99
+
100
+ export interface CodeBuildCloudWatchStateEvent
101
+ extends EventBridgeEvent<"CodeBuild Build State Change", CodeBuildStateEventDetail>
102
+ {
103
+ source: "aws.codebuild";
104
+ }
@@ -0,0 +1,35 @@
1
+ import { Handler } from "../handler";
2
+
3
+ export type CodeCommitHandler = Handler<CodeCommitTrigger, void>;
4
+
5
+ /**
6
+ * CodeCommit events
7
+ * https://docs.aws.amazon.com/lambda/latest/dg/services-codecommit.html
8
+ */
9
+ export interface CodeCommitTrigger {
10
+ awsRegion: string;
11
+ codecommit: {
12
+ references: Array<{
13
+ commit: string;
14
+ created?: boolean;
15
+ deleted?: boolean;
16
+ ref: string;
17
+ }>;
18
+ };
19
+ customData?: string;
20
+ eventId: string;
21
+ eventName: string;
22
+ eventPartNumber: number;
23
+ eventSource: string;
24
+ eventSourceARN: string;
25
+ eventTime: string;
26
+ eventTotalParts: number;
27
+ eventTriggerConfigId: string;
28
+ eventTriggerName: string;
29
+ eventVersion: string;
30
+ userIdentityARN: string;
31
+ }
32
+
33
+ export interface CodeCommitTriggerEvent {
34
+ Records: CodeCommitTrigger[];
35
+ }
@@ -0,0 +1,31 @@
1
+ import { Handler } from "../handler";
2
+
3
+ export type CodePipelineCloudWatchActionHandler = Handler<CodePipelineCloudWatchActionEvent, void>;
4
+
5
+ export type CodePipelineActionCategory = "Approval" | "Build" | "Deploy" | "Invoke" | "Source" | "Test";
6
+ export type CodePipelineActionState = "STARTED" | "SUCCEEDED" | "FAILED" | "CANCELED";
7
+
8
+ export interface CodePipelineCloudWatchActionEvent {
9
+ version: string;
10
+ id: string;
11
+ "detail-type": "CodePipeline Action Execution State Change";
12
+ source: "aws.codepipeline";
13
+ account: string;
14
+ time: string;
15
+ region: string;
16
+ resources: string[];
17
+ detail: {
18
+ pipeline: string;
19
+ version: number;
20
+ "execution-id": string;
21
+ stage: string;
22
+ action: string;
23
+ state: CodePipelineActionState;
24
+ type: {
25
+ owner: "AWS" | "Custom" | "ThirdParty";
26
+ category: CodePipelineActionCategory;
27
+ provider: string;
28
+ version: number;
29
+ };
30
+ };
31
+ }
@@ -0,0 +1,32 @@
1
+ import { Handler } from "../handler";
2
+
3
+ export type CodePipelineCloudWatchPipelineHandler = Handler<CodePipelineCloudWatchPipelineEvent, void>;
4
+
5
+ export type CodePipelineState = "STARTED" | "SUCCEEDED" | "RESUMED" | "FAILED" | "CANCELED" | "SUPERSEDED";
6
+
7
+ /**
8
+ * CodePipeline CloudWatch Events
9
+ * https://docs.aws.amazon.com/codepipeline/latest/userguide/detect-state-changes-cloudwatch-events.html
10
+ *
11
+ * The above CodePipelineEvent is when a lambda is invoked by a CodePipeline.
12
+ * These events are when you subscribe to CodePipeline events in CloudWatch.
13
+ *
14
+ * Their documentation says that detail.version is a string, but it is actually an integer
15
+ */
16
+
17
+ export interface CodePipelineCloudWatchPipelineEvent {
18
+ version: string;
19
+ id: string;
20
+ "detail-type": "CodePipeline Pipeline Execution State Change";
21
+ source: "aws.codepipeline";
22
+ account: string;
23
+ time: string;
24
+ region: string;
25
+ resources: string[];
26
+ detail: {
27
+ pipeline: string;
28
+ version: number;
29
+ state: CodePipelineState;
30
+ "execution-id": string;
31
+ };
32
+ }
@@ -0,0 +1,23 @@
1
+ import { Handler } from "../handler";
2
+
3
+ export type CodePipelineCloudWatchStageHandler = Handler<CodePipelineCloudWatchStageEvent, void>;
4
+
5
+ export type CodePipelineStageState = "STARTED" | "SUCCEEDED" | "RESUMED" | "FAILED" | "CANCELED";
6
+
7
+ export interface CodePipelineCloudWatchStageEvent {
8
+ version: string;
9
+ id: string;
10
+ "detail-type": "CodePipeline Stage Execution State Change";
11
+ source: "aws.codepipeline";
12
+ account: string;
13
+ time: string;
14
+ region: string;
15
+ resources: string[];
16
+ detail: {
17
+ pipeline: string;
18
+ version: number;
19
+ "execution-id": string;
20
+ stage: string;
21
+ state: CodePipelineStageState;
22
+ };
23
+ }
@@ -0,0 +1,11 @@
1
+ import { Handler } from "../handler";
2
+ import { CodePipelineCloudWatchActionEvent } from "./codepipeline-cloudwatch-action";
3
+ import { CodePipelineCloudWatchPipelineEvent } from "./codepipeline-cloudwatch-pipeline";
4
+ import { CodePipelineCloudWatchStageEvent } from "./codepipeline-cloudwatch-stage";
5
+
6
+ export type CodePipelineCloudWatchHandler = Handler<CodePipelineCloudWatchEvent, void>;
7
+
8
+ export type CodePipelineCloudWatchEvent =
9
+ | CodePipelineCloudWatchPipelineEvent
10
+ | CodePipelineCloudWatchStageEvent
11
+ | CodePipelineCloudWatchActionEvent;