@incloodsolutions/devkit 0.0.2 → 0.0.4

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 (128) hide show
  1. package/README.md +150 -41
  2. package/dist/aws-cdk/api-gateway-v2.cjs +77 -0
  3. package/dist/aws-cdk/api-gateway-v2.cjs.map +1 -0
  4. package/dist/aws-cdk/api-gateway-v2.d.cts +55 -0
  5. package/dist/aws-cdk/api-gateway-v2.d.ts +55 -0
  6. package/dist/aws-cdk/api-gateway-v2.js +75 -0
  7. package/dist/aws-cdk/api-gateway-v2.js.map +1 -0
  8. package/dist/aws-cdk/api-gateway-websocket.cjs +77 -0
  9. package/dist/aws-cdk/api-gateway-websocket.cjs.map +1 -0
  10. package/dist/aws-cdk/api-gateway-websocket.d.cts +73 -0
  11. package/dist/aws-cdk/api-gateway-websocket.d.ts +73 -0
  12. package/dist/aws-cdk/api-gateway-websocket.js +75 -0
  13. package/dist/aws-cdk/api-gateway-websocket.js.map +1 -0
  14. package/dist/aws-cdk/api-gateway.cjs +98 -0
  15. package/dist/aws-cdk/api-gateway.cjs.map +1 -0
  16. package/dist/aws-cdk/api-gateway.d.cts +80 -0
  17. package/dist/aws-cdk/api-gateway.d.ts +80 -0
  18. package/dist/aws-cdk/api-gateway.js +96 -0
  19. package/dist/aws-cdk/api-gateway.js.map +1 -0
  20. package/dist/aws-cdk/cloudfront.cjs +68 -0
  21. package/dist/aws-cdk/cloudfront.cjs.map +1 -0
  22. package/dist/aws-cdk/cloudfront.d.cts +36 -0
  23. package/dist/aws-cdk/cloudfront.d.ts +36 -0
  24. package/dist/aws-cdk/cloudfront.js +66 -0
  25. package/dist/aws-cdk/cloudfront.js.map +1 -0
  26. package/dist/aws-cdk/cloudwatch.cjs +43 -0
  27. package/dist/aws-cdk/cloudwatch.cjs.map +1 -0
  28. package/dist/aws-cdk/cloudwatch.d.cts +36 -0
  29. package/dist/aws-cdk/cloudwatch.d.ts +36 -0
  30. package/dist/aws-cdk/cloudwatch.js +41 -0
  31. package/dist/aws-cdk/cloudwatch.js.map +1 -0
  32. package/dist/aws-cdk/dynamo-db.cjs +113 -0
  33. package/dist/aws-cdk/dynamo-db.cjs.map +1 -0
  34. package/dist/aws-cdk/dynamo-db.d.cts +53 -0
  35. package/dist/aws-cdk/dynamo-db.d.ts +53 -0
  36. package/dist/aws-cdk/dynamo-db.js +111 -0
  37. package/dist/aws-cdk/dynamo-db.js.map +1 -0
  38. package/dist/aws-cdk/event-bridge.cjs +47 -0
  39. package/dist/aws-cdk/event-bridge.cjs.map +1 -0
  40. package/dist/aws-cdk/event-bridge.d.cts +41 -0
  41. package/dist/aws-cdk/event-bridge.d.ts +41 -0
  42. package/dist/aws-cdk/event-bridge.js +45 -0
  43. package/dist/aws-cdk/event-bridge.js.map +1 -0
  44. package/dist/aws-cdk/lambda-authorizer-v2.cjs +50 -0
  45. package/dist/aws-cdk/lambda-authorizer-v2.cjs.map +1 -0
  46. package/dist/aws-cdk/lambda-authorizer-v2.d.cts +45 -0
  47. package/dist/aws-cdk/lambda-authorizer-v2.d.ts +45 -0
  48. package/dist/aws-cdk/lambda-authorizer-v2.js +48 -0
  49. package/dist/aws-cdk/lambda-authorizer-v2.js.map +1 -0
  50. package/dist/aws-cdk/lambda-authorizer.cjs +37 -0
  51. package/dist/aws-cdk/lambda-authorizer.cjs.map +1 -0
  52. package/dist/aws-cdk/lambda-authorizer.d.cts +44 -0
  53. package/dist/aws-cdk/lambda-authorizer.d.ts +44 -0
  54. package/dist/aws-cdk/lambda-authorizer.js +35 -0
  55. package/dist/aws-cdk/lambda-authorizer.js.map +1 -0
  56. package/dist/aws-cdk/lambda-layer.cjs +69 -0
  57. package/dist/aws-cdk/lambda-layer.cjs.map +1 -0
  58. package/dist/aws-cdk/lambda-layer.d.cts +52 -0
  59. package/dist/aws-cdk/lambda-layer.d.ts +52 -0
  60. package/dist/aws-cdk/lambda-layer.js +67 -0
  61. package/dist/aws-cdk/lambda-layer.js.map +1 -0
  62. package/dist/aws-cdk/lambda.cjs +82 -0
  63. package/dist/aws-cdk/lambda.cjs.map +1 -0
  64. package/dist/aws-cdk/lambda.d.cts +37 -0
  65. package/dist/aws-cdk/lambda.d.ts +37 -0
  66. package/dist/aws-cdk/lambda.js +80 -0
  67. package/dist/aws-cdk/lambda.js.map +1 -0
  68. package/dist/aws-cdk/role-policy.cjs +53 -0
  69. package/dist/aws-cdk/role-policy.cjs.map +1 -0
  70. package/dist/aws-cdk/role-policy.d.cts +44 -0
  71. package/dist/aws-cdk/role-policy.d.ts +44 -0
  72. package/dist/aws-cdk/role-policy.js +51 -0
  73. package/dist/aws-cdk/role-policy.js.map +1 -0
  74. package/dist/aws-cdk/s3-deployment.cjs +177 -0
  75. package/dist/aws-cdk/s3-deployment.cjs.map +1 -0
  76. package/dist/aws-cdk/s3-deployment.d.cts +72 -0
  77. package/dist/aws-cdk/s3-deployment.d.ts +72 -0
  78. package/dist/aws-cdk/s3-deployment.js +175 -0
  79. package/dist/aws-cdk/s3-deployment.js.map +1 -0
  80. package/dist/aws-cdk/s3.cjs +38 -0
  81. package/dist/aws-cdk/s3.cjs.map +1 -0
  82. package/dist/aws-cdk/s3.d.cts +36 -0
  83. package/dist/aws-cdk/s3.d.ts +36 -0
  84. package/dist/aws-cdk/s3.js +36 -0
  85. package/dist/aws-cdk/s3.js.map +1 -0
  86. package/dist/aws-cdk/sns.cjs +43 -0
  87. package/dist/aws-cdk/sns.cjs.map +1 -0
  88. package/dist/aws-cdk/sns.d.cts +45 -0
  89. package/dist/aws-cdk/sns.d.ts +45 -0
  90. package/dist/aws-cdk/sns.js +41 -0
  91. package/dist/aws-cdk/sns.js.map +1 -0
  92. package/dist/aws-cdk/sqs.cjs +55 -0
  93. package/dist/aws-cdk/sqs.cjs.map +1 -0
  94. package/dist/aws-cdk/sqs.d.cts +52 -0
  95. package/dist/aws-cdk/sqs.d.ts +52 -0
  96. package/dist/aws-cdk/sqs.js +53 -0
  97. package/dist/aws-cdk/sqs.js.map +1 -0
  98. package/dist/aws-cdk/vpc.cjs +33 -0
  99. package/dist/aws-cdk/vpc.cjs.map +1 -0
  100. package/dist/aws-cdk/vpc.d.cts +34 -0
  101. package/dist/aws-cdk/vpc.d.ts +34 -0
  102. package/dist/aws-cdk/vpc.js +31 -0
  103. package/dist/aws-cdk/vpc.js.map +1 -0
  104. package/dist/aws-cdk.cjs +905 -0
  105. package/dist/aws-cdk.cjs.map +1 -0
  106. package/dist/aws-cdk.d.cts +34 -0
  107. package/dist/aws-cdk.d.ts +34 -0
  108. package/dist/aws-cdk.js +887 -0
  109. package/dist/aws-cdk.js.map +1 -0
  110. package/dist/aws-types.cjs +4 -0
  111. package/dist/aws-types.cjs.map +1 -0
  112. package/dist/aws-types.d.cts +42 -0
  113. package/dist/aws-types.d.ts +42 -0
  114. package/dist/aws-types.js +3 -0
  115. package/dist/aws-types.js.map +1 -0
  116. package/dist/aws.cjs +905 -0
  117. package/dist/aws.cjs.map +1 -0
  118. package/dist/aws.d.cts +34 -0
  119. package/dist/aws.d.ts +34 -0
  120. package/dist/aws.js +887 -0
  121. package/dist/aws.js.map +1 -0
  122. package/dist/index.cjs +43 -19
  123. package/dist/index.cjs.map +1 -1
  124. package/dist/index.d.cts +34 -755
  125. package/dist/index.d.ts +34 -755
  126. package/dist/index.js +43 -19
  127. package/dist/index.js.map +1 -1
  128. package/package.json +181 -19
package/dist/index.d.ts CHANGED
@@ -1,755 +1,34 @@
1
- import { Construct } from 'constructs';
2
- import { Function, FunctionProps, LayerVersion, ILayerVersion, LayerVersionProps, Runtime, EventSourceMappingProps } from 'aws-cdk-lib/aws-lambda';
3
- import { HttpMethod, HttpApi, HttpApiProps, AddRoutesOptions, WebSocketApi, WebSocketApiProps, WebSocketStageProps, WebSocketRouteOptions } from 'aws-cdk-lib/aws-apigatewayv2';
4
- import { RestApi, RestApiProps, TokenAuthorizer, TokenAuthorizerProps } from 'aws-cdk-lib/aws-apigateway';
5
- import { IBaseEnableDebug, ObjectType, AppEnvironmentType } from '@incloodsolutions/toolkit';
6
- import { Distribution, DistributionProps, BehaviorOptions } from 'aws-cdk-lib/aws-cloudfront';
7
- import { LogGroup, LogGroupProps } from 'aws-cdk-lib/aws-logs';
8
- import { Table, ITable, TableProps, TableAttributes, GlobalSecondaryIndexProps, LocalSecondaryIndexProps } from 'aws-cdk-lib/aws-dynamodb';
9
- import { Rule, RuleProps } from 'aws-cdk-lib/aws-events';
10
- import { HttpLambdaAuthorizer, HttpLambdaAuthorizerProps } from 'aws-cdk-lib/aws-apigatewayv2-authorizers';
11
- import { Role, RoleProps, PolicyStatementProps } from 'aws-cdk-lib/aws-iam';
12
- import { Bucket, BucketProps } from 'aws-cdk-lib/aws-s3';
13
- import { BucketDeployment, BucketDeploymentProps } from 'aws-cdk-lib/aws-s3-deployment';
14
- import { Topic, TopicProps } from 'aws-cdk-lib/aws-sns';
15
- import { Queue, QueueProps } from 'aws-cdk-lib/aws-sqs';
16
- import { Vpc, VpcProps } from 'aws-cdk-lib/aws-ec2';
17
-
18
- /** Base interface that enables debugging features */
19
- interface IBaseConstruct extends IBaseEnableDebug {
20
- }
21
- /** Base interface for CDK construct configuration */
22
- interface IBaseCdkConstructProps<TOptions extends ObjectType = any> extends Readonly<Partial<IBaseEnableDebug>> {
23
- /** Deployment stage/environment */
24
- readonly stage?: AppEnvironmentType;
25
- /** Additional construct options */
26
- readonly options?: TOptions;
27
- /** Optional stack name */
28
- readonly stackName?: string;
29
- /** Optional application name */
30
- readonly appName?: string;
31
- }
32
-
33
- /**
34
- * Route definition for API Gateway resources
35
- *
36
- * Supports hierarchical route structures using `children`
37
- */
38
- interface IRouteOption {
39
- /** Path segment (e.g. 'users', 'orders') */
40
- name: string;
41
- /** HTTP method for the route */
42
- method: `${HttpMethod}`;
43
- /** Nested routes under this path */
44
- children?: IRouteOption[];
45
- }
46
- /**
47
- * Props for BaseApiGatewayConstruct
48
- *
49
- * Provides configuration for:
50
- * - REST API (API Gateway v1)
51
- * - Route definitions
52
- * - Lambda handler
53
- */
54
- interface IApiGatewayConstructProps extends Omit<IBaseCdkConstructProps<{
55
- /** REST API configuration options */
56
- readonly gatewayOptions: RestApiProps;
57
- /** Route definitions used to build API resources */
58
- readonly routeOptions: IRouteOption[];
59
- }>, 'appName' | 'stage' | 'stackName'> {
60
- /**
61
- * Lambda function handling all API routes
62
- *
63
- * Note:
64
- * A single Lambda integration is reused across all routes
65
- */
66
- readonly handlerFunction: Function;
67
- }
68
- /**
69
- * CDK construct for REST API Gateway with Lambda integration
70
- *
71
- * Responsibilities:
72
- * - Creates a REST API with configurable options
73
- * - Applies default CORS and compression settings when not provided
74
- * - Recursively builds API resources from route definitions
75
- * - Exposes API base URL as a CloudFormation output
76
- */
77
- declare class BaseApiGatewayConstruct extends Construct implements IBaseConstruct {
78
- /** The created REST API instance */
79
- readonly api: RestApi;
80
- /** Enables debug logging for route creation */
81
- enableDebug: boolean;
82
- /**
83
- * @param scope Parent construct
84
- * @param id Unique construct identifier
85
- * @param props Configuration for API, routes, and Lambda handler
86
- */
87
- constructor(scope: Construct, id: string, props: IApiGatewayConstructProps);
88
- /**
89
- * Recursively attaches routes to the API Gateway
90
- *
91
- * Behaviour:
92
- * - Creates a resource for each route segment
93
- * - Attaches method + Lambda integration
94
- * - Traverses child routes for nested paths
95
- *
96
- * @param parent Parent API resource
97
- * @param routes Route definitions
98
- * @param integration Lambda integration applied to each route
99
- * @param previousPath Accumulated path (used for debug logging)
100
- * @private
101
- */
102
- private addRoutes;
103
- }
104
-
105
- /**
106
- * Properties for configuring the API Gateway v2 construct
107
- *
108
- * Extends base CDK construct props and provides configuration for:
109
- * - HTTP API (Api Gateway v2)
110
- * - Route definitions
111
- * - Lambda handlers
112
- */
113
- interface IApiGatewayV2ConstructProps extends Omit<IBaseCdkConstructProps<{
114
- /** HTTP API configuration options */
115
- readonly gatewayOptions: HttpApiProps;
116
- /** Route definitions passed directly to `addRoutes` */
117
- readonly routeOptions: Partial<AddRoutesOptions>[];
118
- }>, 'appName' | 'stage' | 'stackName'> {
119
- /**
120
- * Lambda functions used as route handlers
121
- *
122
- * Note:
123
- * Each handler is paired with each route during route creation
124
- */
125
- readonly handlerFunctions: Function[];
126
- }
127
- /**
128
- * CDK construct for creating an API Gateway v2 (HTTP API)
129
- *
130
- * Responsibilities:
131
- * - Creates an HTTP API with optional custom configuration
132
- * - Applies default CORS configuration when not provided
133
- * - Attaches routes with Lambda integrations
134
- * - Exposes API URL as a CloudFormation output
135
- *
136
- * Behaviour:
137
- * - Each route is registered for every provided handler function
138
- * - Throws if no handler functions are supplied
139
- */
140
- declare class BaseApiGatewayV2Construct extends Construct implements IBaseConstruct {
141
- /** The created HTTP API instance */
142
- readonly api: HttpApi;
143
- /** Enables debug logging (if used externally) */
144
- enableDebug: boolean;
145
- /**
146
- * @param scope Parent construct
147
- * @param id Unique construct identifier
148
- * @param props Configuration for API, routes, and handlers
149
- */
150
- constructor(scope: Construct, id: string, props: IApiGatewayV2ConstructProps);
151
- }
152
-
153
- /**
154
- * Props for BaseApiGatewayWebSocketConstruct
155
- *
156
- * Provides configuration for:
157
- * - WebSocket API (API Gateway v2)
158
- * - WebSocket stage
159
- * - Route handlers for lifecycle events
160
- */
161
- interface IApiGatewayWebsocketConstructProps extends Omit<IBaseCdkConstructProps<{
162
- /** WebSocket API configuration options */
163
- readonly webSocketApiOptions: WebSocketApiProps;
164
- /** WebSocket stage configuration options */
165
- readonly webSocketStageOptions: WebSocketStageProps;
166
- }>, 'appName' | 'stage' | 'stackName'> {
167
- /**
168
- * Lambda handlers mapped to WebSocket lifecycle routes
169
- *
170
- * Includes:
171
- * - $connect
172
- * - $disconnect
173
- * - $default
174
- * - custom message route
175
- */
176
- readonly handlers: {
177
- /** Handler for connection establishment ($connect) */
178
- readonly connect: {
179
- option: WebSocketRouteOptions;
180
- function: Function;
181
- };
182
- /** Handler for unmatched routes ($default) */
183
- readonly default: {
184
- option: WebSocketRouteOptions;
185
- function: Function;
186
- };
187
- /** Handler for custom message route (e.g. 'notifications') */
188
- readonly message: {
189
- option: WebSocketRouteOptions;
190
- function: Function;
191
- };
192
- /** Handler for disconnection events ($disconnect) */
193
- readonly disconnect: {
194
- option: WebSocketRouteOptions;
195
- function: Function;
196
- };
197
- };
198
- }
199
- /**
200
- * CDK construct for WebSocket API Gateway
201
- *
202
- * Responsibilities:
203
- * - Creates a WebSocket API with lifecycle route integrations
204
- * - Registers a custom message route
205
- * - Deploys a stage with auto-deploy enabled
206
- * - Exposes WebSocket endpoint URL as a CloudFormation output
207
- */
208
- declare class BaseApiGatewayWebSocketConstruct extends Construct {
209
- /** The created WebSocket API instance */
210
- readonly socketApi: WebSocketApi;
211
- /**
212
- * @param scope Parent construct
213
- * @param id Unique construct identifier
214
- * @param props Configuration for API, stage, and route handlers
215
- */
216
- constructor(scope: Construct, id: string, props: IApiGatewayWebsocketConstructProps);
217
- }
218
-
219
- /**
220
- * Props for BaseCloudfrontConstruct
221
- *
222
- * Provides configuration for creating a CloudFront distribution
223
- * with optional overrides for default behaviour and error handling.
224
- */
225
- interface ICloudfrontConstructProps extends Omit<IBaseCdkConstructProps<{
226
- /** Partial configuration for the CloudFront distribution */
227
- readonly cloudfrontOptions: Partial<DistributionProps>;
228
- }>, 'appName' | 'stage' | 'stackName'> {
229
- }
230
- /**
231
- * CDK construct for CloudFront distribution
232
- *
233
- * Responsibilities:
234
- * - Creates a CloudFront distribution with configurable options
235
- * - Enforces HTTPS redirection by default
236
- * - Adds fallback error responses for SPA routing (400, 403, 404 → index.html)
237
- */
238
- declare class BaseCloudfrontConstruct extends Construct {
239
- /** The created CloudFront distribution instance */
240
- readonly distribution: Distribution;
241
- /**
242
- * @param scope Parent construct
243
- * @param id Unique construct identifier
244
- * @param props Configuration for CloudFront distribution
245
- */
246
- constructor(scope: Construct, id: string, props: ICloudfrontConstructProps);
247
- }
248
-
249
- /**
250
- * Props for BaseCloudwatchLogGroupConstruct
251
- *
252
- * Provides configuration for creating a CloudWatch Log Group
253
- * with optional overrides for retention and removal policy.
254
- */
255
- interface ILogGroupConstructProps extends Omit<IBaseCdkConstructProps<{
256
- /** Log Group configuration options */
257
- readonly logGroupOptions: LogGroupProps;
258
- }>, 'appName' | 'stage' | 'stackName'> {
259
- }
260
- /**
261
- * CDK construct for CloudWatch Log Group
262
- *
263
- * Responsibilities:
264
- * - Creates a log group with configurable options
265
- * - Applies default removal policy and retention if not provided
266
- * - Exposes the log group ARN as a CloudFormation output
267
- */
268
- declare class BaseCloudwatchLogGroupConstruct extends Construct {
269
- /** The created CloudWatch Log Group instance */
270
- readonly logGroup: LogGroup;
271
- /**
272
- * @param scope Parent construct
273
- * @param id Unique construct identifier
274
- * @param props Configuration for the log group
275
- */
276
- constructor(scope: Construct, id: string, props: ILogGroupConstructProps);
277
- }
278
-
279
- /**
280
- * Props for BaseDynamoDBConstruct
281
- *
282
- * Provides configuration for:
283
- * - Creating a new DynamoDB table
284
- * - Importing an existing table (by name, ARN, or attributes)
285
- * - Defining Global Secondary Indexes (GSI) and Local Secondary Indexes (LSI)
286
- */
287
- interface IDynamoDBConstructProps$1 extends Omit<IBaseCdkConstructProps<{
288
- /** Configuration for creating a new table */
289
- readonly tableOptions?: TableProps;
290
- /** Import an existing table by ARN */
291
- readonly fromExistingTableArn?: string;
292
- /** Import an existing table by name */
293
- readonly fromExistingTableName?: string;
294
- /** Import an existing table using attributes */
295
- readonly fromExistingTableAttributes?: TableAttributes;
296
- /** Global Secondary Index definitions */
297
- readonly globalSecondaryIndexes?: GlobalSecondaryIndexProps[];
298
- /** Local Secondary Index definitions */
299
- readonly localSecondaryIndexes?: LocalSecondaryIndexProps[];
300
- }>, 'appName' | 'stackName'> {
301
- }
302
- /**
303
- * CDK construct for DynamoDB table management
304
- *
305
- * Responsibilities:
306
- * - Creates a new DynamoDB table or imports an existing one
307
- * - Applies default billing mode and deletion protection
308
- * - Attaches optional GSIs and LSIs
309
- * - Exposes table ARN as a CloudFormation output
310
- */
311
- declare class BaseDynamoDBConstruct extends Construct implements IBaseConstruct {
312
- /** Newly created DynamoDB table (null if importing existing table) */
313
- readonly table: Table;
314
- /** Imported DynamoDB table reference (null if creating new table) */
315
- readonly existingTable: ITable;
316
- /** Enables debug logging */
317
- enableDebug: boolean;
318
- /**
319
- * @param scope Parent construct
320
- * @param id Unique construct identifier
321
- * @param props Configuration for table creation or import
322
- */
323
- constructor(scope: Construct, id: string, props: IDynamoDBConstructProps$1);
324
- }
325
-
326
- /**
327
- * Props for BaseEventBridgeConstruct
328
- *
329
- * Provides configuration for:
330
- * - EventBridge rule creation
331
- * - Target Lambda functions
332
- */
333
- interface IEventBridgeConstructProps extends Omit<IBaseCdkConstructProps<{
334
- /** Lambda functions to be triggered by the rule */
335
- readonly targetFunctions: Function[];
336
- /** EventBridge rule configuration */
337
- readonly eventBridgeOptions: RuleProps;
338
- }>, 'appName' | 'stage' | 'stackName'> {
339
- }
340
- /**
341
- * CDK construct for EventBridge rule
342
- *
343
- * Responsibilities:
344
- * - Creates an EventBridge rule with configurable options
345
- * - Attaches one or more Lambda targets
346
- * - Applies a removal policy
347
- * - Exposes the rule ARN as a CloudFormation output
348
- */
349
- declare class BaseEventBridgeConstruct extends Construct {
350
- /** The created EventBridge rule instance */
351
- readonly eventSchedule: Rule;
352
- /**
353
- * @param scope Parent construct
354
- * @param id Unique construct identifier
355
- * @param props Configuration for rule and target functions
356
- */
357
- constructor(scope: Construct, id: string, props: IEventBridgeConstructProps);
358
- }
359
-
360
- /**
361
- * Props for BaseLambdaAuthoriserConstruct
362
- *
363
- * Provides configuration for:
364
- * - Lambda token authorizer
365
- * - Authorizer behaviour and settings
366
- */
367
- interface ILambdaAuthoriserConstructProps extends Omit<IBaseCdkConstructProps<{
368
- /** Token authorizer configuration options */
369
- readonly authorizerOptions: TokenAuthorizerProps;
370
- }>, 'appName' | 'stage' | 'stackName'> {
371
- /**
372
- * Lambda function used as the authorizer handler
373
- *
374
- * This function is invoked to validate incoming requests
375
- */
376
- readonly handlerFunction: Function;
377
- }
378
- /**
379
- * CDK construct for Lambda Token Authorizer (API Gateway v1)
380
- *
381
- * Responsibilities:
382
- * - Creates a Token Authorizer backed by a Lambda function
383
- * - Applies optional configuration overrides
384
- * - Exposes the authorizer ARN as a CloudFormation output
385
- */
386
- declare class BaseLambdaAuthoriserConstruct extends Construct {
387
- /** The created Token Authorizer instance */
388
- readonly authoriser: TokenAuthorizer;
389
- /**
390
- * @param scope Parent construct
391
- * @param id Unique construct identifier
392
- * @param props Configuration for authorizer and handler function
393
- */
394
- constructor(scope: Construct, id: string, props: ILambdaAuthoriserConstructProps);
395
- }
396
-
397
- /**
398
- * Props for BaseLambdaAuthoriserV2Construct
399
- *
400
- * Provides configuration for:
401
- * - HTTP API Lambda authorizer (API Gateway v2)
402
- * - Authorizer behaviour and identity sources
403
- */
404
- interface ILambdaAuthoriserV2ConstructProps extends Omit<IBaseCdkConstructProps<{
405
- /** HTTP Lambda authorizer configuration options */
406
- readonly authorizerOptions: HttpLambdaAuthorizerProps;
407
- }>, 'appName' | 'stage' | 'stackName'> {
408
- /**
409
- * Lambda function used as the authorizer handler
410
- *
411
- * This function is invoked to validate incoming HTTP requests
412
- */
413
- readonly handlerFunction: Function;
414
- }
415
- /**
416
- * CDK construct for Lambda Authorizer (API Gateway v2 - HTTP API)
417
- *
418
- * Responsibilities:
419
- * - Creates an HTTP Lambda authorizer
420
- * - Applies default identity sources (Cookie and Authorization headers)
421
- * - Supports multiple response types (IAM and SIMPLE by default)
422
- * - Exposes the authorizer ID as a CloudFormation output
423
- */
424
- declare class BaseLambdaAuthoriserV2Construct extends Construct {
425
- /** The created HTTP Lambda Authorizer instance */
426
- readonly authoriser: HttpLambdaAuthorizer;
427
- /**
428
- * @param scope Parent construct
429
- * @param id Unique construct identifier
430
- * @param props Configuration for authorizer and handler function
431
- */
432
- constructor(scope: Construct, id: string, props: ILambdaAuthoriserV2ConstructProps);
433
- }
434
-
435
- /**
436
- * Props for BaseLambdaConstruct
437
- *
438
- * Provides configuration for creating a Lambda function
439
- * with optional overrides for runtime, memory, timeout, and environment.
440
- */
441
- interface ILambdaConstructProps extends Omit<IBaseCdkConstructProps<{
442
- /** Partial Lambda configuration options */
443
- readonly lambdaOptions: Partial<FunctionProps>;
444
- }>, 'appName'> {
445
- }
446
- /**
447
- * CDK construct for AWS Lambda function
448
- *
449
- * Responsibilities:
450
- * - Creates a Lambda function with sensible defaults
451
- * - Merges and validates environment variables
452
- * - Applies stage-based configuration (e.g. timeout)
453
- * - Exposes the function ARN as a CloudFormation output
454
- */
455
- declare class BaseLambdaConstruct extends Construct {
456
- /** The created Lambda function instance */
457
- readonly function: Function;
458
- /**
459
- * @param scope Parent construct
460
- * @param id Unique construct identifier
461
- * @param props Configuration for Lambda function
462
- */
463
- constructor(scope: Construct, id: string, props: ILambdaConstructProps);
464
- }
465
-
466
- /**
467
- * Props for BaseLambdaLayerConstruct
468
- *
469
- * Provides configuration for:
470
- * - Creating a new Lambda Layer
471
- * - Importing an existing layer by ARN or attributes
472
- */
473
- interface ILambdaLayerConstructProps extends Omit<IBaseCdkConstructProps<{
474
- /**
475
- * Configuration for creating a new Lambda layer
476
- *
477
- * Note:
478
- * - `layerVersionName` is required
479
- * - `compatibleArchitectures` is managed internally
480
- */
481
- readonly layerOptions?: Partial<Omit<LayerVersionProps, 'layerVersionName' | 'compatibleArchitectures'>> & Required<Pick<LayerVersionProps, 'layerVersionName'>>;
482
- /** Import an existing layer by ARN */
483
- readonly fromExistingLayerArn?: string;
484
- /** Import an existing layer using attributes */
485
- readonly fromExistingLayerAttribute?: {
486
- readonly layerVersionArn: string;
487
- readonly compatibleRuntimes?: Runtime[];
488
- };
489
- }>, 'appName' | 'stage' | 'stackName'> {
490
- }
491
- /**
492
- * CDK construct for Lambda Layer
493
- *
494
- * Responsibilities:
495
- * - Creates a new Lambda layer or imports an existing one
496
- * - Applies default runtime and architecture compatibility
497
- * - Exposes the layer ARN as a CloudFormation output
498
- */
499
- declare class BaseLambdaLayerConstruct extends Construct {
500
- /** Newly created Lambda Layer (null if importing existing layer) */
501
- readonly layer: LayerVersion;
502
- /** Imported Lambda Layer reference (null if creating new layer) */
503
- readonly existingLayer: ILayerVersion;
504
- /**
505
- * @param scope Parent construct
506
- * @param id Unique construct identifier
507
- * @param props Configuration for layer creation or import
508
- */
509
- constructor(scope: Construct, id: string, props?: ILambdaLayerConstructProps);
510
- }
511
-
512
- /**
513
- * Props for BaseRolePolicyConstruct
514
- *
515
- * Provides configuration for:
516
- * - IAM role creation
517
- * - Inline policy statements
518
- */
519
- interface IDynamoDBConstructProps extends Omit<IBaseCdkConstructProps<{
520
- /** IAM Role configuration options */
521
- readonly roleOptions: RoleProps;
522
- }>, 'appName' | 'stage' | 'stackName'> {
523
- /**
524
- * Additional inline policies to attach to the role
525
- *
526
- * Each entry is converted into a PolicyStatement
527
- */
528
- readonly policies?: PolicyStatementProps[];
529
- }
530
- /**
531
- * CDK construct for IAM Role with policies
532
- *
533
- * Responsibilities:
534
- * - Creates an IAM role with configurable options
535
- * - Applies a default AWS managed policy if none is provided
536
- * - Attaches optional inline policy statements
537
- * - Exposes the role ARN as a CloudFormation output
538
- */
539
- declare class BaseRolePolicyConstruct extends Construct {
540
- /** The created IAM Role instance */
541
- readonly role: Role;
542
- /**
543
- * @param scope Parent construct
544
- * @param id Unique construct identifier
545
- * @param props Configuration for role and policies
546
- */
547
- constructor(scope: Construct, id: string, props: IDynamoDBConstructProps);
548
- }
549
-
550
- /**
551
- * Props for BaseS3Construct
552
- *
553
- * Provides configuration for creating an S3 bucket
554
- * with optional overrides for bucket properties.
555
- */
556
- interface IS3DeploymentConstructProps$1 extends Omit<IBaseCdkConstructProps<{
557
- /** Configuration options for the S3 bucket */
558
- readonly bucketOptions?: BucketProps;
559
- }>, 'appName' | 'stackName'> {
560
- }
561
- /**
562
- * CDK construct for S3 bucket
563
- *
564
- * Responsibilities:
565
- * - Creates an S3 bucket with configurable options
566
- * - Applies a default removal policy if not provided
567
- * - Exposes the bucket ARN as a CloudFormation output
568
- */
569
- declare class BaseS3Construct extends Construct {
570
- /** The created S3 bucket instance */
571
- readonly bucket: Bucket;
572
- /**
573
- * @param scope Parent construct
574
- * @param id Unique construct identifier
575
- * @param props Configuration for S3 bucket
576
- */
577
- constructor(scope: Construct, id: string, props: IS3DeploymentConstructProps$1);
578
- }
579
-
580
- /**
581
- * Props for BaseS3DeploymentConstruct
582
- *
583
- * Provides configuration for:
584
- * - Optional S3 bucket creation
585
- * - Optional CloudFront distribution
586
- * - S3 bucket deployment
587
- */
588
- interface IS3DeploymentConstructProps extends Omit<IBaseCdkConstructProps<{
589
- /** Configuration options for S3 bucket */
590
- readonly bucketOptions?: BucketProps;
591
- /**
592
- * Configuration options for CloudFront distribution
593
- *
594
- * Note:
595
- * - `additionalBehaviors` supports dynamic route mappings
596
- * - Origins are automatically resolved if not provided
597
- */
598
- readonly cloudfrontOptions?: Partial<Omit<DistributionProps, 'additionalBehaviors'>> & {
599
- readonly additionalBehaviors?: ObjectType<Partial<BehaviorOptions>, string>;
600
- };
601
- /**
602
- * Configuration for S3 bucket deployment
603
- *
604
- * Note:
605
- * - `sources` is required
606
- * - `destinationBucket` can be auto-resolved
607
- */
608
- readonly bucketDeploymentOptions: Omit<Partial<BucketDeploymentProps>, 'sources'> & Pick<BucketDeploymentProps, 'sources'>;
609
- }>, 'appName' | 'stackName'> {
610
- /** Whether to create a new S3 bucket */
611
- readonly withS3Bucket?: boolean;
612
- /** Whether to create a CloudFront distribution */
613
- readonly withCloudfront?: boolean;
614
- }
615
- /**
616
- * CDK construct for S3 deployment with optional CloudFront integration
617
- *
618
- * Responsibilities:
619
- * - Optionally creates an S3 bucket
620
- * - Optionally creates a CloudFront distribution with S3 origin
621
- * - Deploys assets to S3 bucket
622
- * - Configures CloudFront invalidation paths
623
- *
624
- * Behaviour:
625
- * - Automatically links S3 bucket as CloudFront origin when enabled
626
- * - Resolves destination bucket and distribution if not explicitly provided
627
- * - Throws when required dependencies are missing
628
- */
629
- declare class BaseS3DeploymentConstruct extends Construct {
630
- /** The created or provided S3 bucket */
631
- readonly bucket: Bucket;
632
- /** The created CloudFront distribution */
633
- readonly distribution: Distribution;
634
- /** S3 bucket deployment instance */
635
- readonly bucketDeployment: BucketDeployment;
636
- /**
637
- * @param scope Parent construct
638
- * @param id Unique construct identifier
639
- * @param props Configuration for bucket, distribution, and deployment
640
- */
641
- constructor(scope: Construct, id: string, props: IS3DeploymentConstructProps);
642
- }
643
-
644
- /**
645
- * Props for BaseSnsConstruct
646
- *
647
- * Provides configuration for:
648
- * - SNS topic creation
649
- * - Lambda subscriptions
650
- */
651
- interface ISnsConstructProps extends Omit<IBaseCdkConstructProps<{
652
- /** SNS topic configuration options */
653
- readonly topicOptions: TopicProps;
654
- /**
655
- * Lambda functions to subscribe to the topic
656
- *
657
- * Each function will receive messages published to the topic
658
- */
659
- readonly targetFunctions: Function[];
660
- }>, 'appName' | 'stage' | 'stackName'> {
661
- }
662
- /**
663
- * CDK construct for SNS topic with Lambda subscriptions
664
- *
665
- * Responsibilities:
666
- * - Creates an SNS topic with configurable options
667
- * - Subscribes one or more Lambda functions to the topic
668
- * - Applies a removal policy
669
- * - Exposes the topic ARN as a CloudFormation output
670
- */
671
- declare class BaseSnsConstruct extends Construct {
672
- /** The created SNS topic instance */
673
- readonly topic: Topic;
674
- /**
675
- * @param scope Parent construct
676
- * @param id Unique construct identifier
677
- * @param props Configuration for topic and subscriptions
678
- */
679
- constructor(scope: Construct, id: string, props: ISnsConstructProps);
680
- }
681
-
682
- /**
683
- * Props for BaseSqsConstruct
684
- *
685
- * Provides configuration for:
686
- * - SQS queue creation
687
- * - Lambda event source mappings
688
- */
689
- interface ISqsConstructProps extends Omit<IBaseCdkConstructProps<{
690
- /** Configuration options for the SQS queue */
691
- readonly queueOptions?: QueueProps;
692
- /**
693
- * Configuration for Lambda event source mapping
694
- *
695
- * Note:
696
- * `eventSourceArn` and `target` are managed internally
697
- */
698
- readonly eventSourceMappingOptions?: Omit<EventSourceMappingProps, 'eventSourceArn' | 'target'>;
699
- }>, 'appName' | 'stage' | 'stackName'> {
700
- /**
701
- * Lambda functions to be triggered by SQS messages
702
- *
703
- * Each function will be connected via an event source mapping
704
- */
705
- readonly targetFunctions?: Function[];
706
- }
707
- /**
708
- * CDK construct for SQS queue with Lambda integration
709
- *
710
- * Responsibilities:
711
- * - Creates an SQS queue with configurable options
712
- * - Attaches one or more Lambda consumers via event source mappings
713
- * - Applies default retry behaviour
714
- * - Exposes the queue ARN as a CloudFormation output
715
- */
716
- declare class BaseSqsConstruct extends Construct {
717
- /** The created SQS queue instance */
718
- readonly queue: Queue;
719
- /**
720
- * @param scope Parent construct
721
- * @param id Unique construct identifier
722
- * @param props Configuration for queue and Lambda consumers
723
- */
724
- constructor(scope: Construct, id: string, props: ISqsConstructProps);
725
- }
726
-
727
- /**
728
- * Props for BaseVpcConstruct
729
- *
730
- * Provides configuration for creating a VPC.
731
- */
732
- interface IVpcConstructProps extends Omit<IBaseCdkConstructProps<{
733
- /** VPC configuration options */
734
- readonly vpcOptions: VpcProps;
735
- }>, 'appName' | 'stage' | 'stackName'> {
736
- }
737
- /**
738
- * CDK construct for Virtual Private Cloud (VPC)
739
- *
740
- * Responsibilities:
741
- * - Creates a VPC with configurable options
742
- * - Exposes the VPC ARN as a CloudFormation output
743
- */
744
- declare class BaseVpcConstruct extends Construct {
745
- /** The created VPC instance */
746
- readonly vpc: Vpc;
747
- /**
748
- * @param scope Parent construct
749
- * @param id Unique construct identifier
750
- * @param props Configuration for VPC
751
- */
752
- constructor(scope: Construct, id: string, props: IVpcConstructProps);
753
- }
754
-
755
- export { BaseApiGatewayConstruct, BaseApiGatewayV2Construct, BaseApiGatewayWebSocketConstruct, BaseCloudfrontConstruct, BaseCloudwatchLogGroupConstruct, BaseDynamoDBConstruct, BaseEventBridgeConstruct, BaseLambdaAuthoriserConstruct, BaseLambdaAuthoriserV2Construct, BaseLambdaConstruct, BaseLambdaLayerConstruct, BaseRolePolicyConstruct, BaseS3Construct, BaseS3DeploymentConstruct, BaseSnsConstruct, BaseSqsConstruct, BaseVpcConstruct, type IBaseCdkConstructProps, type IBaseConstruct };
1
+ export { BaseApiGatewayConstruct } from './aws-cdk/api-gateway.js';
2
+ export { BaseApiGatewayV2Construct } from './aws-cdk/api-gateway-v2.js';
3
+ export { BaseApiGatewayWebSocketConstruct } from './aws-cdk/api-gateway-websocket.js';
4
+ export { BaseCloudfrontConstruct } from './aws-cdk/cloudfront.js';
5
+ export { BaseCloudwatchLogGroupConstruct } from './aws-cdk/cloudwatch.js';
6
+ export { BaseDynamoDBConstruct } from './aws-cdk/dynamo-db.js';
7
+ export { BaseEventBridgeConstruct } from './aws-cdk/event-bridge.js';
8
+ export { BaseLambdaAuthoriserConstruct } from './aws-cdk/lambda-authorizer.js';
9
+ export { BaseLambdaAuthoriserV2Construct } from './aws-cdk/lambda-authorizer-v2.js';
10
+ export { BaseLambdaConstruct } from './aws-cdk/lambda.js';
11
+ export { BaseLambdaLayerConstruct } from './aws-cdk/lambda-layer.js';
12
+ export { BaseRolePolicyConstruct } from './aws-cdk/role-policy.js';
13
+ export { BaseS3Construct } from './aws-cdk/s3.js';
14
+ export { BaseS3DeploymentConstruct } from './aws-cdk/s3-deployment.js';
15
+ export { BaseSnsConstruct } from './aws-cdk/sns.js';
16
+ export { BaseSqsConstruct } from './aws-cdk/sqs.js';
17
+ export { BaseVpcConstruct } from './aws-cdk/vpc.js';
18
+ export { IBaseCdkConstructProps, IBaseConstruct } from './aws-types.js';
19
+ import 'constructs';
20
+ import 'aws-cdk-lib/aws-lambda';
21
+ import 'aws-cdk-lib/aws-apigatewayv2';
22
+ import 'aws-cdk-lib/aws-apigateway';
23
+ import '@incloodsolutions/toolkit';
24
+ import 'aws-cdk-lib/aws-cloudfront';
25
+ import 'aws-cdk-lib/aws-logs';
26
+ import 'aws-cdk-lib/aws-dynamodb';
27
+ import 'aws-cdk-lib/aws-events';
28
+ import 'aws-cdk-lib/aws-apigatewayv2-authorizers';
29
+ import 'aws-cdk-lib/aws-iam';
30
+ import 'aws-cdk-lib/aws-s3';
31
+ import 'aws-cdk-lib/aws-s3-deployment';
32
+ import 'aws-cdk-lib/aws-sns';
33
+ import 'aws-cdk-lib/aws-sqs';
34
+ import 'aws-cdk-lib/aws-ec2';