@incloodsolutions/devkit 0.0.1 → 0.0.3

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 (154) hide show
  1. package/README.md +42 -16
  2. package/dist/aws/cdk/constructs/api-gateway-construct.cjs +95 -0
  3. package/dist/aws/cdk/constructs/api-gateway-construct.cjs.map +1 -0
  4. package/dist/aws/cdk/constructs/api-gateway-construct.d.cts +80 -0
  5. package/dist/aws/cdk/constructs/api-gateway-construct.d.ts +80 -0
  6. package/dist/aws/cdk/constructs/api-gateway-construct.js +93 -0
  7. package/dist/aws/cdk/constructs/api-gateway-construct.js.map +1 -0
  8. package/dist/aws/cdk/constructs/api-gateway-v2-construct.cjs +77 -0
  9. package/dist/aws/cdk/constructs/api-gateway-v2-construct.cjs.map +1 -0
  10. package/dist/aws/cdk/constructs/api-gateway-v2-construct.d.cts +55 -0
  11. package/dist/aws/cdk/constructs/api-gateway-v2-construct.d.ts +55 -0
  12. package/dist/aws/cdk/constructs/api-gateway-v2-construct.js +75 -0
  13. package/dist/aws/cdk/constructs/api-gateway-v2-construct.js.map +1 -0
  14. package/dist/aws/cdk/constructs/api-gateway-websocket-construct.cjs +65 -0
  15. package/dist/aws/cdk/constructs/api-gateway-websocket-construct.cjs.map +1 -0
  16. package/dist/aws/cdk/constructs/api-gateway-websocket-construct.d.cts +73 -0
  17. package/dist/aws/cdk/constructs/api-gateway-websocket-construct.d.ts +73 -0
  18. package/dist/aws/cdk/constructs/api-gateway-websocket-construct.js +63 -0
  19. package/dist/aws/cdk/constructs/api-gateway-websocket-construct.js.map +1 -0
  20. package/dist/aws/cdk/constructs/cloudfront-construct.cjs +68 -0
  21. package/dist/aws/cdk/constructs/cloudfront-construct.cjs.map +1 -0
  22. package/dist/aws/cdk/constructs/cloudfront-construct.d.cts +36 -0
  23. package/dist/aws/cdk/constructs/cloudfront-construct.d.ts +36 -0
  24. package/dist/aws/cdk/constructs/cloudfront-construct.js +66 -0
  25. package/dist/aws/cdk/constructs/cloudfront-construct.js.map +1 -0
  26. package/dist/aws/cdk/constructs/cloudwatch-construct.cjs +43 -0
  27. package/dist/aws/cdk/constructs/cloudwatch-construct.cjs.map +1 -0
  28. package/dist/aws/cdk/constructs/cloudwatch-construct.d.cts +36 -0
  29. package/dist/aws/cdk/constructs/cloudwatch-construct.d.ts +36 -0
  30. package/dist/aws/cdk/constructs/cloudwatch-construct.js +41 -0
  31. package/dist/aws/cdk/constructs/cloudwatch-construct.js.map +1 -0
  32. package/dist/aws/cdk/constructs/dynamo-db-construct.cjs +113 -0
  33. package/dist/aws/cdk/constructs/dynamo-db-construct.cjs.map +1 -0
  34. package/dist/aws/cdk/constructs/dynamo-db-construct.d.cts +53 -0
  35. package/dist/aws/cdk/constructs/dynamo-db-construct.d.ts +53 -0
  36. package/dist/aws/cdk/constructs/dynamo-db-construct.js +111 -0
  37. package/dist/aws/cdk/constructs/dynamo-db-construct.js.map +1 -0
  38. package/dist/aws/cdk/constructs/event-bridge-construct.cjs +47 -0
  39. package/dist/aws/cdk/constructs/event-bridge-construct.cjs.map +1 -0
  40. package/dist/aws/cdk/constructs/event-bridge-construct.d.cts +41 -0
  41. package/dist/aws/cdk/constructs/event-bridge-construct.d.ts +41 -0
  42. package/dist/aws/cdk/constructs/event-bridge-construct.js +45 -0
  43. package/dist/aws/cdk/constructs/event-bridge-construct.js.map +1 -0
  44. package/dist/aws/cdk/constructs/index.cjs +881 -0
  45. package/dist/aws/cdk/constructs/index.cjs.map +1 -0
  46. package/dist/aws/cdk/constructs/index.d.cts +34 -0
  47. package/dist/aws/cdk/constructs/index.d.ts +34 -0
  48. package/dist/aws/cdk/constructs/index.js +863 -0
  49. package/dist/aws/cdk/constructs/index.js.map +1 -0
  50. package/dist/aws/cdk/constructs/lambda-authorizer-construct.cjs +37 -0
  51. package/dist/aws/cdk/constructs/lambda-authorizer-construct.cjs.map +1 -0
  52. package/dist/aws/cdk/constructs/lambda-authorizer-construct.d.cts +44 -0
  53. package/dist/aws/cdk/constructs/lambda-authorizer-construct.d.ts +44 -0
  54. package/dist/aws/cdk/constructs/lambda-authorizer-construct.js +35 -0
  55. package/dist/aws/cdk/constructs/lambda-authorizer-construct.js.map +1 -0
  56. package/dist/aws/cdk/constructs/lambda-authorizer-v2-construct.cjs +47 -0
  57. package/dist/aws/cdk/constructs/lambda-authorizer-v2-construct.cjs.map +1 -0
  58. package/dist/aws/cdk/constructs/lambda-authorizer-v2-construct.d.cts +45 -0
  59. package/dist/aws/cdk/constructs/lambda-authorizer-v2-construct.d.ts +45 -0
  60. package/dist/aws/cdk/constructs/lambda-authorizer-v2-construct.js +45 -0
  61. package/dist/aws/cdk/constructs/lambda-authorizer-v2-construct.js.map +1 -0
  62. package/dist/aws/cdk/constructs/lambda-construct.cjs +82 -0
  63. package/dist/aws/cdk/constructs/lambda-construct.cjs.map +1 -0
  64. package/dist/aws/cdk/constructs/lambda-construct.d.cts +37 -0
  65. package/dist/aws/cdk/constructs/lambda-construct.d.ts +37 -0
  66. package/dist/aws/cdk/constructs/lambda-construct.js +80 -0
  67. package/dist/aws/cdk/constructs/lambda-construct.js.map +1 -0
  68. package/dist/aws/cdk/constructs/lambda-layer-construct.cjs +72 -0
  69. package/dist/aws/cdk/constructs/lambda-layer-construct.cjs.map +1 -0
  70. package/dist/aws/cdk/constructs/lambda-layer-construct.d.cts +52 -0
  71. package/dist/aws/cdk/constructs/lambda-layer-construct.d.ts +52 -0
  72. package/dist/aws/cdk/constructs/lambda-layer-construct.js +70 -0
  73. package/dist/aws/cdk/constructs/lambda-layer-construct.js.map +1 -0
  74. package/dist/aws/cdk/constructs/role-policy-construct.cjs +53 -0
  75. package/dist/aws/cdk/constructs/role-policy-construct.cjs.map +1 -0
  76. package/dist/aws/cdk/constructs/role-policy-construct.d.cts +44 -0
  77. package/dist/aws/cdk/constructs/role-policy-construct.d.ts +44 -0
  78. package/dist/aws/cdk/constructs/role-policy-construct.js +51 -0
  79. package/dist/aws/cdk/constructs/role-policy-construct.js.map +1 -0
  80. package/dist/aws/cdk/constructs/s3-construct.cjs +38 -0
  81. package/dist/aws/cdk/constructs/s3-construct.cjs.map +1 -0
  82. package/dist/aws/cdk/constructs/s3-construct.d.cts +36 -0
  83. package/dist/aws/cdk/constructs/s3-construct.d.ts +36 -0
  84. package/dist/aws/cdk/constructs/s3-construct.js +36 -0
  85. package/dist/aws/cdk/constructs/s3-construct.js.map +1 -0
  86. package/dist/aws/cdk/constructs/s3-deployment-construct.cjs +168 -0
  87. package/dist/aws/cdk/constructs/s3-deployment-construct.cjs.map +1 -0
  88. package/dist/aws/cdk/constructs/s3-deployment-construct.d.cts +72 -0
  89. package/dist/aws/cdk/constructs/s3-deployment-construct.d.ts +72 -0
  90. package/dist/aws/cdk/constructs/s3-deployment-construct.js +166 -0
  91. package/dist/aws/cdk/constructs/s3-deployment-construct.js.map +1 -0
  92. package/dist/aws/cdk/constructs/sns-construct.cjs +43 -0
  93. package/dist/aws/cdk/constructs/sns-construct.cjs.map +1 -0
  94. package/dist/aws/cdk/constructs/sns-construct.d.cts +45 -0
  95. package/dist/aws/cdk/constructs/sns-construct.d.ts +45 -0
  96. package/dist/aws/cdk/constructs/sns-construct.js +41 -0
  97. package/dist/aws/cdk/constructs/sns-construct.js.map +1 -0
  98. package/dist/aws/cdk/constructs/sqs-construct.cjs +55 -0
  99. package/dist/aws/cdk/constructs/sqs-construct.cjs.map +1 -0
  100. package/dist/aws/cdk/constructs/sqs-construct.d.cts +52 -0
  101. package/dist/aws/cdk/constructs/sqs-construct.d.ts +52 -0
  102. package/dist/aws/cdk/constructs/sqs-construct.js +53 -0
  103. package/dist/aws/cdk/constructs/sqs-construct.js.map +1 -0
  104. package/dist/aws/cdk/constructs/vpc-construct.cjs +33 -0
  105. package/dist/aws/cdk/constructs/vpc-construct.cjs.map +1 -0
  106. package/dist/aws/cdk/constructs/vpc-construct.d.cts +34 -0
  107. package/dist/aws/cdk/constructs/vpc-construct.d.ts +34 -0
  108. package/dist/aws/cdk/constructs/vpc-construct.js +31 -0
  109. package/dist/aws/cdk/constructs/vpc-construct.js.map +1 -0
  110. package/dist/aws/cdk/index.cjs +881 -0
  111. package/dist/aws/cdk/index.cjs.map +1 -0
  112. package/dist/aws/cdk/index.d.cts +34 -0
  113. package/dist/aws/cdk/index.d.ts +34 -0
  114. package/dist/aws/cdk/index.js +863 -0
  115. package/dist/aws/cdk/index.js.map +1 -0
  116. package/dist/aws/cli/index.cjs +4 -0
  117. package/dist/aws/cli/index.cjs.map +1 -0
  118. package/dist/aws/cli/index.d.cts +2 -0
  119. package/dist/aws/cli/index.d.ts +2 -0
  120. package/dist/aws/cli/index.js +3 -0
  121. package/dist/aws/cli/index.js.map +1 -0
  122. package/dist/aws/index.cjs +881 -0
  123. package/dist/aws/index.cjs.map +1 -0
  124. package/dist/aws/index.d.cts +34 -0
  125. package/dist/aws/index.d.ts +34 -0
  126. package/dist/aws/index.js +863 -0
  127. package/dist/aws/index.js.map +1 -0
  128. package/dist/aws/types/index.cjs +4 -0
  129. package/dist/aws/types/index.cjs.map +1 -0
  130. package/dist/aws/types/index.d.cts +18 -0
  131. package/dist/aws/types/index.d.ts +18 -0
  132. package/dist/aws/types/index.js +3 -0
  133. package/dist/aws/types/index.js.map +1 -0
  134. package/dist/index.d.cts +34 -755
  135. package/dist/index.d.ts +34 -755
  136. package/dist/lint/index.cjs +4 -0
  137. package/dist/lint/index.cjs.map +1 -0
  138. package/dist/lint/index.d.cts +2 -0
  139. package/dist/lint/index.d.ts +2 -0
  140. package/dist/lint/index.js +3 -0
  141. package/dist/lint/index.js.map +1 -0
  142. package/dist/prettier/index.cjs +4 -0
  143. package/dist/prettier/index.cjs.map +1 -0
  144. package/dist/prettier/index.d.cts +2 -0
  145. package/dist/prettier/index.d.ts +2 -0
  146. package/dist/prettier/index.js +3 -0
  147. package/dist/prettier/index.js.map +1 -0
  148. package/dist/utility/index.cjs +4 -0
  149. package/dist/utility/index.cjs.map +1 -0
  150. package/dist/utility/index.d.cts +2 -0
  151. package/dist/utility/index.d.ts +2 -0
  152. package/dist/utility/index.js +3 -0
  153. package/dist/utility/index.js.map +1 -0
  154. package/package.json +8 -3
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/aws/cdk/constructs/api-gateway-construct.ts","../../../src/aws/cdk/constructs/api-gateway-v2-construct.ts","../../../src/aws/cdk/constructs/api-gateway-websocket-construct.ts","../../../src/aws/cdk/constructs/cloudfront-construct.ts","../../../src/aws/cdk/constructs/cloudwatch-construct.ts","../../../src/aws/cdk/constructs/dynamo-db-construct.ts","../../../src/aws/cdk/constructs/event-bridge-construct.ts","../../../src/aws/cdk/constructs/lambda-authorizer-construct.ts","../../../src/aws/cdk/constructs/lambda-authorizer-v2-construct.ts","../../../src/aws/cdk/constructs/lambda-construct.ts","../../../src/aws/cdk/constructs/lambda-layer-construct.ts","../../../src/aws/cdk/constructs/role-policy-construct.ts","../../../src/aws/cdk/constructs/s3-construct.ts","../../../src/aws/cdk/constructs/s3-deployment-construct.ts","../../../src/aws/cdk/constructs/sns-construct.ts","../../../src/aws/cdk/constructs/sqs-construct.ts","../../../src/aws/cdk/constructs/vpc-construct.ts"],"names":["Construct","RemovalPolicy","CfnOutput","printLog","Duration","Code","Architecture","Runtime","CustomException"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA4DO,IAAM,uBAAA,GAAN,MAAM,wBAAA,SAAgC,SAAA,CAAoC;AAAA,EA5DjF;AA4DiF,IAAA,MAAA,CAAA,IAAA,EAAA,yBAAA,CAAA;AAAA;AAAA;AAAA,EAEvE,GAAA;AAAA;AAAA,EAGT,WAAA,GAAc,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOd,WAAA,CAAY,KAAA,EAAkB,EAAA,EAAY,KAAA,EAAkC;AAC3E,IAAA,KAAA,CAAM,OAAO,EAAE,CAAA;AAEf,IAAA,IAAA,CAAK,cAAc,KAAA,CAAM,WAAA;AAEzB,IAAA,IAAA,CAAK,GAAA,GAAM,I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Method } from 'aws-cdk-lib/aws-apigatewayv2';\nimport { CfnOutput, RemovalPolicy, Size } from 'aws-cdk-lib';\nimport { Cors, IResource, LambdaIntegration, RestApi, RestApiProps } from 'aws-cdk-lib/aws-apigateway';\n\nimport { printLog } from '@incloodsolutions/toolkit';\n\nimport { IBaseCdkConstructProps, IBaseConstruct } from '../../types';\n\n\n/**\n * Route definition for API Gateway resources\n *\n * Supports hierarchical route structures using `children`\n */\ninterface IRouteOption {\n\t/** Path segment (e.g. 'users', 'orders') */\n\tname: string;\n\n\t/** HTTP method for the route */\n\tmethod: `${HttpMethod}`;\n\n\t/** Nested routes under this path */\n\tchildren?: IRouteOption[];\n}\n\n/**\n * Props for BaseApiGatewayConstruct\n *\n * Provides configuration for:\n * - REST API (API Gateway v1)\n * - Route definitions\n * - Lambda handler\n */\ninterface IApiGatewayConstructProps extends Omit<IBaseCdkConstructProps<{\n\t/** REST API configuration options */\n\treadonly gatewayOptions: RestApiProps;\n\n\t/** Route definitions used to build API resources */\n\treadonly routeOptions: IRouteOption[];\n}>, 'appName' | 'stage' | 'stackName'> {\n\t/**\n\t * Lambda function handling all API routes\n\t *\n\t * Note:\n\t * A single Lambda integration is reused across all routes\n\t */\n\treadonly handlerFunction: Function;\n}\n\n/**\n * CDK construct for REST API Gateway with Lambda integration\n *\n * Responsibilities:\n * - Creates a REST API with configurable options\n * - Applies default CORS and compression settings when not provided\n * - Recursively builds API resources from route definitions\n * - Exposes API base URL as a CloudFormation output\n */\nexport class BaseApiGatewayConstruct extends Construct implements IBaseConstruct {\n\t/** The created REST API instance */\n\treadonly api: RestApi;\n\n\t/** Enables debug logging for route creation */\n\tenableDebug = false;\n\n\t/**\n\t * @param scope Parent construct\n\t * @param id Unique construct identifier\n\t * @param props Configuration for API, routes, and Lambda handler\n\t */\n\tconstructor(scope: Construct, id: string, props: IApiGatewayConstructProps) {\n\t\tsuper(scope, id);\n\n\t\tthis.enableDebug = props.enableDebug;\n\n\t\tthis.api = new RestApi(this, id, {\n\t\t\t...props?.options?.gatewayOptions,\n\n\t\t\t/** Default API description if not provided */\n\t\t\tdescription: props?.options?.gatewayOptions?.description || 'This is a REST API using CDK',\n\n\t\t\t/**\n\t\t\t * CORS configuration\n\t\t\t * Falls back to allowing all origins, methods, and standard headers\n\t\t\t */\n\t\t\tdefaultCorsPreflightOptions: {\n\t\t\t\t...props?.options?.gatewayOptions?.defaultCorsPreflightOptions,\n\n\t\t\t\t/** Allow all origins by default */\n\t\t\t\tallowOrigins: props?.options?.gatewayOptions?.defaultCorsPreflightOptions?.allowOrigins || Cors.ALL_ORIGINS,\n\n\t\t\t\t/** Allow all HTTP methods by default */\n\t\t\t\tallowMethods: props?.options?.gatewayOptions?.defaultCorsPreflightOptions?.allowMethods || Cors.ALL_METHODS,\n\n\t\t\t\t/** Merge default headers with user-defined headers */\n\t\t\t\tallowHeaders: [\n\t\t\t\t\t...props.options?.gatewayOptions?.defaultCorsPreflightOptions?.allowHeaders,\n\t\t\t\t\t'Content-Type',\n\t\t\t\t\t'Accept',\n\t\t\t\t\t'X-Amz-Date',\n\t\t\t\t\t'Authorization',\n\t\t\t\t\t'X-Api-Key',\n\t\t\t\t\t'X-Amz-Security-Token',\n\t\t\t\t\t'X-Amz-User-Agent'\n\t\t\t\t]\n\t\t\t},\n\n\t\t\t/** Minimum payload size (in bytes) before compression is applied */\n\t\t\tminCompressionSize: props?.options?.gatewayOptions?.minCompressionSize || Size.bytes(1),\n\t\t});\n\n\t\t/**\n\t\t * Register routes if provided\n\t\t */\n\t\tif (props?.options?.routeOptions?.length && props?.handlerFunction) {\n\t\t\tconst integration = new LambdaIntegration(props.handlerFunction);\n\n\t\t\t/**\n\t\t\t * Attach routes recursively starting from API root\n\t\t\t */\n\t\t\tthis.addRoutes(this.api.root, props.options.routeOptions, integration);\n\t\t}\n\n\t\t/**\n\t\t * Apply removal policy (useful for non-production environments)\n\t\t */\n\t\tthis.api.applyRemovalPolicy(RemovalPolicy.DESTROY);\n\n\t\t/**\n\t\t * CloudFormation output exposing API base URL\n\t\t */\n\t\tnew CfnOutput(this, 'ApiGateway', {\n\t\t\tvalue: this.api.url\n\t\t});\n\t}\n\n\t/**\n\t * Recursively attaches routes to the API Gateway\n\t *\n\t * Behaviour:\n\t * - Creates a resource for each route segment\n\t * - Attaches method + Lambda integration\n\t * - Traverses child routes for nested paths\n\t *\n\t * @param parent Parent API resource\n\t * @param routes Route definitions\n\t * @param integration Lambda integration applied to each route\n\t * @param previousPath Accumulated path (used for debug logging)\n\t * @private\n\t */\n\tprivate addRoutes(\n\t\tparent: IResource,\n\t\troutes: IRouteOption[],\n\t\tintegration: LambdaIntegration,\n\t\tpreviousPath?: string\n\t) {\n\t\troutes.forEach(route => {\n\t\t\tconst currentPath = `${previousPath || ''}/${route.name}`;\n\n\t\t\tconst resource = parent.addResource(route.name);\n\n\t\t\t/** Attach HTTP method with Lambda integration */\n\t\t\tresource.addMethod(route.method, integration);\n\n\t\t\t/** Recursively process child routes */\n\t\t\tif (route?.children.length) {\n\t\t\t\tthis.addRoutes(resource, route.children, integration, currentPath);\n\t\t\t}\n\n\t\t\t/** Optional debug logging */\n\t\t\tif (this.enableDebug) {\n\t\t\t\tprintLog(BaseApiGatewayConstruct.name, `Route created: ${route.method} ${currentPath}`);\n\t\t\t}\n\t\t});\n\t}\n}","import { Construct } from 'constructs';\nimport { Function } from 'aws-cdk-lib/aws-lambda';\nimport { CfnOutput, RemovalPolicy } from 'aws-cdk-lib';\nimport { HttpLambdaIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations';\nimport { AddRoutesOptions, CorsHttpMethod, HttpApi, HttpApiProps } from 'aws-cdk-lib/aws-apigatewayv2';\n\nimport { CustomException } from '@incloodsolutions/toolkit';\nimport { IBaseCdkConstructProps, IBaseConstruct } from '../../types';\n\n/**\n * Properties for configuring the API Gateway v2 construct\n *\n * Extends base CDK construct props and provides configuration for:\n * - HTTP API (Api Gateway v2)\n * - Route definitions\n * - Lambda handlers\n */\ninterface IApiGatewayV2ConstructProps extends Omit<IBaseCdkConstructProps<{\n\t/** HTTP API configuration options */\n\treadonly gatewayOptions: HttpApiProps;\n\n\t/** Route definitions passed directly to `addRoutes` */\n\treadonly routeOptions: Partial<AddRoutesOptions>[];\n}>, 'appName' | 'stage' | 'stackName'> {\n\t/**\n\t * Lambda functions used as route handlers\n\t *\n\t * Note:\n\t * Each handler is paired with each route during route creation\n\t */\n\treadonly handlerFunctions: Function[];\n}\n\n\n/**\n * CDK construct for creating an API Gateway v2 (HTTP API)\n *\n * Responsibilities:\n * - Creates an HTTP API with optional custom configuration\n * - Applies default CORS configuration when not provided\n * - Attaches routes with Lambda integrations\n * - Exposes API URL as a CloudFormation output\n *\n * Behaviour:\n * - Each route is registered for every provided handler function\n * - Throws if no handler functions are supplied\n */\nexport class BaseApiGatewayV2Construct extends Construct implements IBaseConstruct {\n\t/** The created HTTP API instance */\n\treadonly api: HttpApi;\n\n\t/** Enables debug logging (if used externally) */\n\tenableDebug = false;\n\n\t/**\n\t * @param scope Parent construct\n\t * @param id Unique construct identifier\n\t * @param props Configuration for API, routes, and handlers\n\t */\n\tconstructor(scope: Construct, id: string, props: IApiGatewayV2ConstructProps) {\n\t\tsuper(scope, id);\n\n\t\tthis.enableDebug = props.enableDebug;\n\n\t\tthis.api = new HttpApi(this, id, {\n\t\t\t...props?.options?.gatewayOptions,\n\n\t\t\t/** Default API description if not provided */\n\t\t\tdescription: props?.options?.gatewayOptions?.description || 'This is an Http API using CDK',\n\n\t\t\t/**\n\t\t\t * CORS configuration\n\t\t\t * Falls back to allowing all methods and standard headers if not explicitly defined\n\t\t\t */\n\t\t\tcorsPreflight: {\n\t\t\t\t...props.options?.gatewayOptions?.corsPreflight,\n\n\t\t\t\t/** Allow all HTTP methods by default */\n\t\t\t\tallowMethods: props.options?.gatewayOptions?.corsPreflight?.allowMethods || Object.values(CorsHttpMethod),\n\n\t\t\t\t/** Merge default headers with user-defined headers */\n\t\t\t\tallowHeaders: [\n\t\t\t\t\t'Content-Type',\n\t\t\t\t\t'Accept',\n\t\t\t\t\t'X-Amz-Date',\n\t\t\t\t\t'Authorization',\n\t\t\t\t\t'X-Api-Key',\n\t\t\t\t\t'X-Amz-Security-Token',\n\t\t\t\t\t'X-Amz-User-Agent',\n\t\t\t\t\t...props.options?.gatewayOptions?.corsPreflight?.allowHeaders || []\n\t\t\t\t]\n\t\t\t}\n\t\t});\n\n\t\t/**\n\t\t * Ensure at least one handler function is provided\n\t\t */\n\t\tif (!props?.handlerFunctions?.length) {\n\t\t\tthrow new CustomException('Construct requires atleast one function');\n\t\t}\n\n\t\t/**\n\t\t * Register routes with Lambda integrations\n\t\t */\n\t\tif (props?.options?.routeOptions?.length) {\n\t\t\tprops.handlerFunctions.forEach(handlerFunc => {\n\t\t\t\tprops?.options?.routeOptions.forEach(route => {\n\t\t\t\t\tthis.api.addRoutes({\n\t\t\t\t\t\t...route,\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Lambda integration for each route\n\t\t\t\t\t\t */\n\t\t\t\t\t\tintegration: new HttpLambdaIntegration('routes', handlerFunc)\n\t\t\t\t\t} as AddRoutesOptions);\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\t/**\n\t\t * Apply removal policy (useful for non-production environments)\n\t\t */\n\t\tthis.api.applyRemovalPolicy(RemovalPolicy.DESTROY);\n\n\t\t/**\n\t\t * CloudFormation output exposing the API base URL\n\t\t */\n\t\tnew CfnOutput(this, 'ApiGatewayV2', {\n\t\t\tvalue: this.api.url,\n\t\t});\n\t}\n}","import { Construct } from 'constructs';\nimport { CfnOutput } from 'aws-cdk-lib';\nimport { Function } from 'aws-cdk-lib/aws-lambda';\nimport { WebSocketLambdaIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations';\nimport { WebSocketApi, WebSocketApiProps, WebSocketRouteOptions, WebSocketStage, WebSocketStageProps } from 'aws-cdk-lib/aws-apigatewayv2';\n\nimport { IBaseCdkConstructProps } from '../../types';\n\n/**\n * Props for BaseApiGatewayWebSocketConstruct\n *\n * Provides configuration for:\n * - WebSocket API (API Gateway v2)\n * - WebSocket stage\n * - Route handlers for lifecycle events\n */\ninterface IApiGatewayWebsocketConstructProps extends Omit<IBaseCdkConstructProps<{\n\t/** WebSocket API configuration options */\n\treadonly webSocketApiOptions: WebSocketApiProps;\n\n\t/** WebSocket stage configuration options */\n\treadonly webSocketStageOptions: WebSocketStageProps;\n}>, 'appName' | 'stage' | 'stackName'> {\n\t/**\n\t * Lambda handlers mapped to WebSocket lifecycle routes\n\t *\n\t * Includes:\n\t * - $connect\n\t * - $disconnect\n\t * - $default\n\t * - custom message route\n\t */\n\treadonly handlers: {\n\t\t/** Handler for connection establishment ($connect) */\n\t\treadonly connect: {\n\t\t\toption: WebSocketRouteOptions;\n\t\t\tfunction: Function;\n\t\t};\n\n\t\t/** Handler for unmatched routes ($default) */\n\t\treadonly default: {\n\t\t\toption: WebSocketRouteOptions;\n\t\t\tfunction: Function;\n\t\t};\n\n\t\t/** Handler for custom message route (e.g. 'notifications') */\n\t\treadonly message: {\n\t\t\toption: WebSocketRouteOptions;\n\t\t\tfunction: Function;\n\t\t};\n\n\t\t/** Handler for disconnection events ($disconnect) */\n\t\treadonly disconnect: {\n\t\t\toption: WebSocketRouteOptions;\n\t\t\tfunction: Function;\n\t\t};\n\t}\n}\n\n/**\n * CDK construct for WebSocket API Gateway\n *\n * Responsibilities:\n * - Creates a WebSocket API with lifecycle route integrations\n * - Registers a custom message route\n * - Deploys a stage with auto-deploy enabled\n * - Exposes WebSocket endpoint URL as a CloudFormation output\n */\nexport class BaseApiGatewayWebSocketConstruct extends Construct {\n\t/** The created WebSocket API instance */\n\treadonly socketApi: WebSocketApi;\n\n\t/**\n\t * @param scope Parent construct\n\t * @param id Unique construct identifier\n\t * @param props Configuration for API, stage, and route handlers\n\t */\n\tconstructor(scope: Construct, id: string, props: IApiGatewayWebsocketConstructProps) {\n\t\tsuper(scope, id);\n\n\t\tthis.socketApi = new WebSocketApi(this, id, {\n\t\t\t...props.options.webSocketApiOptions,\n\n\t\t\t/**\n\t\t\t * Route for connection establishment ($connect)\n\t\t\t */\n\t\t\tconnectRouteOptions: {\n\t\t\t\t...props.handlers.connect?.option,\n\t\t\t\tintegration: new WebSocketLambdaIntegration('connectIntegration', props.handlers.connect.function),\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Route for disconnection events ($disconnect)\n\t\t\t */\n\t\t\tdisconnectRouteOptions: {\n\t\t\t\t...props.handlers.disconnect?.option,\n\t\t\t\tintegration: new WebSocketLambdaIntegration('disconnectIntegration', props.handlers.disconnect.function)\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Default route for unmatched messages ($default)\n\t\t\t */\n\t\t\tdefaultRouteOptions: {\n\t\t\t\t...props.handlers.default?.option,\n\t\t\t\tintegration: new WebSocketLambdaIntegration('defaultIntegration', props.handlers.default.function)\n\t\t\t},\n\t\t});\n\n\t\t/**\n\t\t * Custom message route (e.g. \"notifications\")\n\t\t */\n\t\tthis.socketApi.addRoute(\"notifications\", {\n\t\t\t...props.handlers.message?.option,\n\n\t\t\t/** Lambda integration for message handling */\n\t\t\tintegration: new WebSocketLambdaIntegration('routes', props.handlers.message.function),\n\t\t});\n\n\t\t/**\n\t\t * WebSocket stage deployment\n\t\t * Auto-deploy ensures changes are immediately available\n\t\t */\n\t\tconst webSocketStage = new WebSocketStage(this, `${id}_stage`, {\n\t\t\t...props.options?.webSocketStageOptions,\n\t\t\twebSocketApi: this.socketApi,\n\t\t\tautoDeploy: true\n\t\t});\n\n\t\t/**\n\t\t * CloudFormation output exposing WebSocket endpoint URL\n\t\t */\n\t\tnew CfnOutput(this, 'WebSocketURL', {\n\t\t\tvalue: webSocketStage.url,\n\t\t});\n\t}\n}","import { Construct } from 'constructs';\nimport { Duration } from 'aws-cdk-lib';\nimport { Distribution, DistributionProps, ViewerProtocolPolicy } from 'aws-cdk-lib/aws-cloudfront';\n\nimport { IBaseCdkConstructProps } from '../../types';\n\n/**\n * Props for BaseCloudfrontConstruct\n *\n * Provides configuration for creating a CloudFront distribution\n * with optional overrides for default behaviour and error handling.\n */\ninterface ICloudfrontConstructProps extends Omit<IBaseCdkConstructProps<{\n\t/** Partial configuration for the CloudFront distribution */\n\treadonly cloudfrontOptions: Partial<DistributionProps>;\n}>, 'appName' | 'stage' | 'stackName'> { }\n\n/**\n * CDK construct for CloudFront distribution\n *\n * Responsibilities:\n * - Creates a CloudFront distribution with configurable options\n * - Enforces HTTPS redirection by default\n * - Adds fallback error responses for SPA routing (400, 403, 404 → index.html)\n */\nexport class BaseCloudfrontConstruct extends Construct {\n\t/** The created CloudFront distribution instance */\n\treadonly distribution: Distribution;\n\n\t/**\n\t * @param scope Parent construct\n\t * @param id Unique construct identifier\n\t * @param props Configuration for CloudFront distribution\n\t */\n\tconstructor(scope: Construct, id: string, props: ICloudfrontConstructProps) {\n\t\tsuper(scope, id);\n\n\t\tthis.distribution = new Distribution(this, id, {\n\t\t\t...props.options?.cloudfrontOptions,\n\n\t\t\t/**\n\t\t\t * Default behaviour configuration\n\t\t\t * Enforces HTTPS if not explicitly defined\n\t\t\t */\n\t\t\tdefaultBehavior: {\n\t\t\t\t...props.options?.cloudfrontOptions?.defaultBehavior,\n\t\t\t\tviewerProtocolPolicy:\n\t\t\t\t\tprops.options?.cloudfrontOptions?.defaultBehavior?.viewerProtocolPolicy\n\t\t\t\t\t|| ViewerProtocolPolicy.REDIRECT_TO_HTTPS\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Error response configuration\n\t\t\t *\n\t\t\t * Adds SPA-friendly fallbacks:\n\t\t\t * - 400, 403, 404 responses are redirected to index.html\n\t\t\t */\n\t\t\terrorResponses: [\n\t\t\t\t...props.options?.cloudfrontOptions?.errorResponses || [],\n\n\t\t\t\t/** Handle 400 errors */\n\t\t\t\t{\n\t\t\t\t\thttpStatus: 400,\n\t\t\t\t\tresponseHttpStatus: 200,\n\t\t\t\t\tresponsePagePath: '/index.html',\n\t\t\t\t\tttl: Duration.days(1)\n\t\t\t\t},\n\n\t\t\t\t/** Handle 403 errors */\n\t\t\t\t{\n\t\t\t\t\thttpStatus: 403,\n\t\t\t\t\tresponseHttpStatus: 200,\n\t\t\t\t\tresponsePagePath: '/index.html',\n\t\t\t\t\tttl: Duration.days(1)\n\t\t\t\t},\n\n\t\t\t\t/** Handle 404 errors */\n\t\t\t\t{\n\t\t\t\t\thttpStatus: 404,\n\t\t\t\t\tresponseHttpStatus: 200,\n\t\t\t\t\tresponsePagePath: '/index.html',\n\t\t\t\t\tttl: Duration.days(1)\n\t\t\t\t},\n\t\t\t],\n\t\t});\n\t}\n}","import { Construct } from 'constructs';\nimport { CfnOutput, RemovalPolicy } from 'aws-cdk-lib';\nimport { LogGroup, LogGroupProps, RetentionDays } from 'aws-cdk-lib/aws-logs';\n\nimport { IBaseCdkConstructProps } from '../../types';\n\n/**\n * Props for BaseCloudwatchLogGroupConstruct\n *\n * Provides configuration for creating a CloudWatch Log Group\n * with optional overrides for retention and removal policy.\n */\ninterface ILogGroupConstructProps extends Omit<IBaseCdkConstructProps<{\n\t/** Log Group configuration options */\n\treadonly logGroupOptions: LogGroupProps\n}>, 'appName' | 'stage' | 'stackName'> { }\n\n/**\n * CDK construct for CloudWatch Log Group\n *\n * Responsibilities:\n * - Creates a log group with configurable options\n * - Applies default removal policy and retention if not provided\n * - Exposes the log group ARN as a CloudFormation output\n */\nexport class BaseCloudwatchLogGroupConstruct extends Construct {\n\t/** The created CloudWatch Log Group instance */\n\treadonly logGroup: LogGroup;\n\n\t/**\n\t * @param scope Parent construct\n\t * @param id Unique construct identifier\n\t * @param props Configuration for the log group\n\t */\n\tconstructor(scope: Construct, id: string, props: ILogGroupConstructProps) {\n\t\tsuper(scope, id);\n\n\t\tthis.logGroup = new LogGroup(this, id, {\n\t\t\t...props.options?.logGroupOptions,\n\n\t\t\t/**\n\t\t\t * Removal policy applied to the log group\n\t\t\t * Defaults to DESTROY when not explicitly defined\n\t\t\t */\n\t\t\tremovalPolicy:\n\t\t\t\tprops?.options?.logGroupOptions?.removalPolicy\n\t\t\t\t|| RemovalPolicy.DESTROY,\n\n\t\t\t/**\n\t\t\t * Log retention period\n\t\t\t * Defaults to INFINITE when not explicitly defined\n\t\t\t */\n\t\t\tretention:\n\t\t\t\tprops?.options?.logGroupOptions?.retention\n\t\t\t\t|| RetentionDays.INFINITE,\n\t\t});\n\n\t\t/**\n\t\t * CloudFormation output exposing the Log Group ARN\n\t\t */\n\t\tnew CfnOutput(this, 'CloudwatchArn', {\n\t\t\tvalue: this.logGroup.logGroupArn\n\t\t});\n\t}\n}","import { Construct } from 'constructs';\nimport { CfnOutput } from 'aws-cdk-lib';\nimport { BillingMode, GlobalSecondaryIndexProps, ITable, LocalSecondaryIndexProps, Table, TableAttributes, TableProps } from 'aws-cdk-lib/aws-dynamodb';\n\nimport { printLog } from '@incloodsolutions/toolkit';\n\nimport { IBaseCdkConstructProps, IBaseConstruct } from '../../types';\n\n/**\n * Props for BaseDynamoDBConstruct\n *\n * Provides configuration for:\n * - Creating a new DynamoDB table\n * - Importing an existing table (by name, ARN, or attributes)\n * - Defining Global Secondary Indexes (GSI) and Local Secondary Indexes (LSI)\n */\ninterface IDynamoDBConstructProps extends Omit<IBaseCdkConstructProps<{\n\t/** Configuration for creating a new table */\n\treadonly tableOptions?: TableProps;\n\n\t/** Import an existing table by ARN */\n\treadonly fromExistingTableArn?: string;\n\n\t/** Import an existing table by name */\n\treadonly fromExistingTableName?: string;\n\n\t/** Import an existing table using attributes */\n\treadonly fromExistingTableAttributes?: TableAttributes;\n\n\t/** Global Secondary Index definitions */\n\treadonly globalSecondaryIndexes?: GlobalSecondaryIndexProps[];\n\n\t/** Local Secondary Index definitions */\n\treadonly localSecondaryIndexes?: LocalSecondaryIndexProps[];\n}>, 'appName' | 'stackName'> { }\n\n/**\n * CDK construct for DynamoDB table management\n *\n * Responsibilities:\n * - Creates a new DynamoDB table or imports an existing one\n * - Applies default billing mode and deletion protection\n * - Attaches optional GSIs and LSIs\n * - Exposes table ARN as a CloudFormation output\n */\nexport class BaseDynamoDBConstruct extends Construct implements IBaseConstruct {\n\t/** Newly created DynamoDB table (null if importing existing table) */\n\treadonly table: Table;\n\n\t/** Imported DynamoDB table reference (null if creating new table) */\n\treadonly existingTable: ITable;\n\n\t/** Enables debug logging */\n\tenableDebug = false;\n\n\t/**\n\t * @param scope Parent construct\n\t * @param id Unique construct identifier\n\t * @param props Configuration for table creation or import\n\t */\n\tconstructor(scope: Construct, id: string, props: IDynamoDBConstructProps) {\n\t\tsuper(scope, id);\n\n\t\tthis.enableDebug = props?.enableDebug;\n\n\t\t/**\n\t\t * Import table by name\n\t\t */\n\t\tif (props.options?.fromExistingTableName) {\n\t\t\tthis.table = null;\n\n\t\t\tthis.existingTable = Table.fromTableName(\n\t\t\t\tthis,\n\t\t\t\t`${id}-RefName`,\n\t\t\t\tprops.options.fromExistingTableName\n\t\t\t);\n\n\t\t\tif (this.enableDebug) {\n\t\t\t\tprintLog(\n\t\t\t\t\tBaseDynamoDBConstruct.name,\n\t\t\t\t\t`Created Dynamo-DB table from existing using name ${props.options?.fromExistingTableName}`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Import table by ARN\n\t\t\t */\n\t\t} else if (props.options?.fromExistingTableArn) {\n\t\t\tthis.table = null;\n\n\t\t\tthis.existingTable = Table.fromTableArn(\n\t\t\t\tthis,\n\t\t\t\t`${id}-RefArn`,\n\t\t\t\tprops.options.fromExistingTableArn\n\t\t\t);\n\n\t\t\tif (this.enableDebug) {\n\t\t\t\tprintLog(\n\t\t\t\t\tBaseDynamoDBConstruct.name,\n\t\t\t\t\t`Created Dynamo-DB table from existing using ARN`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Import table using attributes\n\t\t\t */\n\t\t} else if (props.options?.fromExistingTableAttributes) {\n\t\t\tthis.table = null;\n\n\t\t\tthis.existingTable = Table.fromTableAttributes(\n\t\t\t\tthis,\n\t\t\t\t`${id}-RefAttributes`,\n\t\t\t\tprops.options.fromExistingTableAttributes\n\t\t\t);\n\n\t\t\tif (this.enableDebug) {\n\t\t\t\tprintLog(\n\t\t\t\t\tBaseDynamoDBConstruct.name,\n\t\t\t\t\t`Created Dynamo-DB table from existing attributes`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Create new table\n\t\t\t */\n\t\t} else {\n\t\t\tthis.existingTable = null;\n\n\t\t\tthis.table = new Table(this, id, {\n\t\t\t\t...props.options?.tableOptions,\n\n\t\t\t\t/**\n\t\t\t\t * Billing mode defaults to PAY_PER_REQUEST if not provided\n\t\t\t\t */\n\t\t\t\tbillingMode:\n\t\t\t\t\tprops.options?.tableOptions?.billingMode\n\t\t\t\t\t|| BillingMode.PAY_PER_REQUEST,\n\n\t\t\t\t/**\n\t\t\t\t * Deletion protection:\n\t\t\t\t * - Uses explicit value if provided\n\t\t\t\t * - Defaults to true in production stage\n\t\t\t\t */\n\t\t\t\tdeletionProtection:\n\t\t\t\t\t(props.options?.tableOptions?.deletionProtection === true ||\n\t\t\t\t\t\tprops.options?.tableOptions?.deletionProtection === false)\n\t\t\t\t\t\t? props.options.tableOptions.deletionProtection\n\t\t\t\t\t\t: props.stage === 'production',\n\t\t\t});\n\n\t\t\t/**\n\t\t\t * Attach Global Secondary Indexes (GSI)\n\t\t\t */\n\t\t\tif (props.options?.globalSecondaryIndexes?.length) {\n\t\t\t\tprops.options.globalSecondaryIndexes.forEach(globalIndex => {\n\t\t\t\t\tthis.table.addGlobalSecondaryIndex(globalIndex);\n\n\t\t\t\t\tif (this.enableDebug) {\n\t\t\t\t\t\tprintLog(\n\t\t\t\t\t\t\tBaseDynamoDBConstruct.name,\n\t\t\t\t\t\t\t`Added GSI: ${globalIndex.indexName}`\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Attach Local Secondary Indexes (LSI)\n\t\t\t */\n\t\t\tif (props.options?.localSecondaryIndexes?.length) {\n\t\t\t\tprops.options.localSecondaryIndexes.forEach(localIndex => {\n\t\t\t\t\tthis.table.addLocalSecondaryIndex(localIndex);\n\n\t\t\t\t\tif (this.enableDebug) {\n\t\t\t\t\t\tprintLog(\n\t\t\t\t\t\t\tBaseDynamoDBConstruct.name,\n\t\t\t\t\t\t\t`Added LSI: ${localIndex.indexName}`\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * CloudFormation output exposing the table ARN\n\t\t * Resolves to either created or imported table\n\t\t */\n\t\tnew CfnOutput(this, 'DynamoDbArn', {\n\t\t\tvalue:\n\t\t\t\t(props.options?.fromExistingTableName || props.options?.fromExistingTableArn)\n\t\t\t\t\t? this.existingTable.tableArn\n\t\t\t\t\t: this.table.tableArn\n\t\t});\n\t}\n}","import { Construct } from 'constructs';\nimport { Function } from 'aws-cdk-lib/aws-lambda';\nimport { CfnOutput, RemovalPolicy } from 'aws-cdk-lib';\nimport { Rule, RuleProps } from 'aws-cdk-lib/aws-events';\nimport { LambdaFunction } from 'aws-cdk-lib/aws-events-targets';\n\nimport { IBaseCdkConstructProps } from '../../types';\n\n/**\n * Props for BaseEventBridgeConstruct\n *\n * Provides configuration for:\n * - EventBridge rule creation\n * - Target Lambda functions\n */\ninterface IEventBridgeConstructProps extends Omit<IBaseCdkConstructProps<{\n\t/** Lambda functions to be triggered by the rule */\n\treadonly targetFunctions: Function[];\n\n\t/** EventBridge rule configuration */\n\treadonly eventBridgeOptions: RuleProps;\n}>, 'appName' | 'stage' | 'stackName'> { }\n\n/**\n * CDK construct for EventBridge rule\n *\n * Responsibilities:\n * - Creates an EventBridge rule with configurable options\n * - Attaches one or more Lambda targets\n * - Applies a removal policy\n * - Exposes the rule ARN as a CloudFormation output\n */\nexport class BaseEventBridgeConstruct extends Construct {\n\t/** The created EventBridge rule instance */\n\treadonly eventSchedule: Rule;\n\n\t/**\n\t * @param scope Parent construct\n\t * @param id Unique construct identifier\n\t * @param props Configuration for rule and target functions\n\t */\n\tconstructor(scope: Construct, id: string, props: IEventBridgeConstructProps) {\n\t\tsuper(scope, id);\n\n\t\tthis.eventSchedule = new Rule(this, id, {\n\t\t\t...props.options?.eventBridgeOptions,\n\n\t\t\t/** Default description if not explicitly provided */\n\t\t\tdescription:\n\t\t\t\tprops?.options?.eventBridgeOptions?.description\n\t\t\t\t|| 'An Event-bridge rule'\n\t\t});\n\n\t\t/**\n\t\t * Attach Lambda targets to the rule\n\t\t */\n\t\tif (props.options?.targetFunctions?.length) {\n\t\t\tprops.options.targetFunctions.forEach((targetFunction) => {\n\t\t\t\tthis.eventSchedule.addTarget(\n\t\t\t\t\t/**\n\t\t\t\t\t * Lambda target integration\n\t\t\t\t\t */\n\t\t\t\t\tnew LambdaFunction(targetFunction)\n\t\t\t\t);\n\t\t\t});\n\t\t}\n\n\t\t/**\n\t\t * Apply removal policy (useful for non-production environments)\n\t\t */\n\t\tthis.eventSchedule.applyRemovalPolicy(RemovalPolicy.DESTROY);\n\n\t\t/**\n\t\t * CloudFormation output exposing the rule ARN\n\t\t */\n\t\tnew CfnOutput(this, 'EventBridgeArn', {\n\t\t\tvalue: this.eventSchedule.ruleArn\n\t\t});\n\t}\n}","import { Construct } from 'constructs';\nimport { CfnOutput } from 'aws-cdk-lib';\nimport { Function } from 'aws-cdk-lib/aws-lambda';\nimport { TokenAuthorizer, TokenAuthorizerProps } from 'aws-cdk-lib/aws-apigateway';\n\nimport { IBaseCdkConstructProps } from '../../types';\n\n/**\n * Props for BaseLambdaAuthoriserConstruct\n *\n * Provides configuration for:\n * - Lambda token authorizer\n * - Authorizer behaviour and settings\n */\ninterface ILambdaAuthoriserConstructProps extends Omit<IBaseCdkConstructProps<{\n\t/** Token authorizer configuration options */\n\treadonly authorizerOptions: TokenAuthorizerProps\n}>, 'appName' | 'stage' | 'stackName'> {\n\t/**\n\t * Lambda function used as the authorizer handler\n\t *\n\t * This function is invoked to validate incoming requests\n\t */\n\treadonly handlerFunction: Function;\n}\n\n/**\n * CDK construct for Lambda Token Authorizer (API Gateway v1)\n *\n * Responsibilities:\n * - Creates a Token Authorizer backed by a Lambda function\n * - Applies optional configuration overrides\n * - Exposes the authorizer ARN as a CloudFormation output\n */\nexport class BaseLambdaAuthoriserConstruct extends Construct {\n\t/** The created Token Authorizer instance */\n\treadonly authoriser: TokenAuthorizer;\n\n\t/**\n\t * @param scope Parent construct\n\t * @param id Unique construct identifier\n\t * @param props Configuration for authorizer and handler function\n\t */\n\tconstructor(scope: Construct, id: string, props: ILambdaAuthoriserConstructProps) {\n\t\tsuper(scope, id);\n\n\t\tthis.authoriser = new TokenAuthorizer(this, id, {\n\t\t\t...props.options?.authorizerOptions,\n\n\t\t\t/**\n\t\t\t * Lambda handler responsible for request authorization\n\t\t\t */\n\t\t\thandler: props.handlerFunction,\n\t\t});\n\n\t\t/**\n\t\t * CloudFormation output exposing the authorizer ARN\n\t\t */\n\t\tnew CfnOutput(this, 'LambdaAuthorizerArn', {\n\t\t\tvalue: this.authoriser.authorizerArn\n\t\t});\n\t}\n}","import { Construct } from 'constructs';\nimport { CfnOutput } from 'aws-cdk-lib';\nimport { Function } from 'aws-cdk-lib/aws-lambda';\nimport { HttpLambdaAuthorizer, HttpLambdaAuthorizerProps, HttpLambdaResponseType } from 'aws-cdk-lib/aws-apigatewayv2-authorizers';\n\nimport { IBaseCdkConstructProps } from '../../types';\n\n/**\n * Props for BaseLambdaAuthoriserV2Construct\n *\n * Provides configuration for:\n * - HTTP API Lambda authorizer (API Gateway v2)\n * - Authorizer behaviour and identity sources\n */\ninterface ILambdaAuthoriserV2ConstructProps extends Omit<IBaseCdkConstructProps<{\n\t/** HTTP Lambda authorizer configuration options */\n\treadonly authorizerOptions: HttpLambdaAuthorizerProps\n}>, 'appName' | 'stage' | 'stackName'> {\n\t/**\n\t * Lambda function used as the authorizer handler\n\t *\n\t * This function is invoked to validate incoming HTTP requests\n\t */\n\treadonly handlerFunction: Function;\n}\n\n/**\n * CDK construct for Lambda Authorizer (API Gateway v2 - HTTP API)\n *\n * Responsibilities:\n * - Creates an HTTP Lambda authorizer\n * - Applies default identity sources (Cookie and Authorization headers)\n * - Supports multiple response types (IAM and SIMPLE by default)\n * - Exposes the authorizer ID as a CloudFormation output\n */\nexport class BaseLambdaAuthoriserV2Construct extends Construct {\n\t/** The created HTTP Lambda Authorizer instance */\n\treadonly authoriser: HttpLambdaAuthorizer;\n\n\t/**\n\t * @param scope Parent construct\n\t * @param id Unique construct identifier\n\t * @param props Configuration for authorizer and handler function\n\t */\n\tconstructor(scope: Construct, id: string, props: ILambdaAuthoriserV2ConstructProps) {\n\t\tsuper(scope, id);\n\n\t\tthis.authoriser = new HttpLambdaAuthorizer(id, props.handlerFunction, {\n\t\t\t...props?.options?.authorizerOptions,\n\n\t\t\t/**\n\t\t\t * Identity sources used to extract credentials from incoming requests\n\t\t\t * Defaults to Cookie and Authorization headers\n\t\t\t */\n\t\t\tidentitySource: [\n\t\t\t\t'$request.header.Cookie',\n\t\t\t\t'$request.header.Authorization',\n\t\t\t\t...props?.options?.authorizerOptions?.identitySource\n\t\t\t],\n\n\t\t\t/**\n\t\t\t * Supported response types for the authorizer\n\t\t\t * Defaults to IAM and SIMPLE responses\n\t\t\t */\n\t\t\tresponseTypes:\n\t\t\t\tprops?.options?.authorizerOptions?.responseTypes\n\t\t\t\t|| [HttpLambdaResponseType.IAM, HttpLambdaResponseType.SIMPLE]\n\t\t});\n\n\t\t/**\n\t\t * CloudFormation output exposing the authorizer ID\n\t\t */\n\t\tnew CfnOutput(this, 'LambdaAuthorizerV2_ID', {\n\t\t\tvalue: this.authoriser.authorizerId\n\t\t});\n\t}\n}","import { Construct } from 'constructs';\nimport { CfnOutput, Duration } from 'aws-cdk-lib';\nimport { Architecture, Code, Function, FunctionProps, Runtime } from 'aws-cdk-lib/aws-lambda';\n\nimport { detectDuplicateProperties, AppEnvironmentEnum } from '@incloodsolutions/toolkit';\n\nimport { IBaseCdkConstructProps } from '../../types';\n\n/**\n * Props for BaseLambdaConstruct\n *\n * Provides configuration for creating a Lambda function\n * with optional overrides for runtime, memory, timeout, and environment.\n */\ninterface ILambdaConstructProps extends Omit<IBaseCdkConstructProps<{\n\t/** Partial Lambda configuration options */\n\treadonly lambdaOptions: Partial<FunctionProps>;\n}>, 'appName'> { }\n\n/**\n * CDK construct for AWS Lambda function\n *\n * Responsibilities:\n * - Creates a Lambda function with sensible defaults\n * - Merges and validates environment variables\n * - Applies stage-based configuration (e.g. timeout)\n * - Exposes the function ARN as a CloudFormation output\n */\nexport class BaseLambdaConstruct extends Construct {\n\t/** The created Lambda function instance */\n\treadonly function: Function;\n\n\t/**\n\t * @param scope Parent construct\n\t * @param id Unique construct identifier\n\t * @param props Configuration for Lambda function\n\t */\n\tconstructor(scope: Construct, id: string, props: ILambdaConstructProps) {\n\t\tsuper(scope, id);\n\n\t\t/**\n\t\t * Environment variables for the Lambda function\n\t\t *\n\t\t * Includes:\n\t\t * - User-defined variables\n\t\t * - NODE_ENV derived from stage\n\t\t * - Node.js runtime optimisations\n\t\t */\n\t\tconst environment = {\n\t\t\t...props.options?.lambdaOptions?.environment,\n\t\t\tNODE_ENV: props.stage,\n\t\t\tNODE_OPTIONS: '--enable-source-maps',\n\t\t\tAWS_NODEJS_CONNECTION_REUSE_ENABLED: '1'\n\t\t};\n\n\t\t/**\n\t\t * Validate environment variables for duplicate keys\n\t\t */\n\t\tdetectDuplicateProperties({ data: environment });\n\n\t\tthis.function = new Function(this, id, {\n\t\t\t...props?.options?.lambdaOptions,\n\n\t\t\t/**\n\t\t\t * Lambda function name\n\t\t\t * Defaults to \"<stackName>-handler\" if not provided\n\t\t\t */\n\t\t\tfunctionName:\n\t\t\t\t`${props?.options?.lambdaOptions?.functionName || props?.stackName}-handler`,\n\n\t\t\t/**\n\t\t\t * Function description\n\t\t\t */\n\t\t\tdescription:\n\t\t\t\tprops?.options?.lambdaOptions?.description\n\t\t\t\t|| 'A lambda function',\n\n\t\t\t/**\n\t\t\t * Entry handler for the Lambda function\n\t\t\t */\n\t\t\thandler:\n\t\t\t\tprops?.options?.lambdaOptions?.handler\n\t\t\t\t|| 'lambda.handler',\n\n\t\t\t/**\n\t\t\t * Runtime environment\n\t\t\t */\n\t\t\truntime:\n\t\t\t\tprops?.options?.lambdaOptions?.runtime\n\t\t\t\t|| Runtime.NODEJS_24_X,\n\n\t\t\t/**\n\t\t\t * Execution timeout\n\t\t\t * - 30 seconds in production\n\t\t\t * - 15 seconds otherwise\n\t\t\t */\n\t\t\ttimeout:\n\t\t\t\tprops?.options?.lambdaOptions?.timeout\n\t\t\t\t|| Duration.seconds(\n\t\t\t\t\tprops.stage === AppEnvironmentEnum.PRODUCTION ? 30 : 15\n\t\t\t\t),\n\n\t\t\t/**\n\t\t\t * Memory allocation (in MB)\n\t\t\t */\n\t\t\tmemorySize:\n\t\t\t\tprops?.options?.lambdaOptions?.memorySize\n\t\t\t\t|| 1024,\n\n\t\t\t/**\n\t\t\t * CPU architecture\n\t\t\t */\n\t\t\tarchitecture:\n\t\t\t\tprops?.options?.lambdaOptions?.architecture\n\t\t\t\t|| Architecture.ARM_64,\n\n\t\t\t/**\n\t\t\t * Lambda deployment package source\n\t\t\t */\n\t\t\tcode:\n\t\t\t\tprops?.options?.lambdaOptions?.code\n\t\t\t\t|| Code.fromAsset('dist'),\n\n\t\t\t/**\n\t\t\t * Final merged environment variables\n\t\t\t */\n\t\t\tenvironment\n\t\t});\n\n\t\t/**\n\t\t * CloudFormation output exposing the Lambda function ARN\n\t\t */\n\t\tnew CfnOutput(this, 'LambdaFunctionArn', {\n\t\t\tvalue: this.function.functionArn\n\t\t});\n\t}\n}","import { Construct } from 'constructs';\nimport { CfnOutput } from 'aws-cdk-lib';\nimport { Architecture, Code, ILayerVersion, LayerVersion, LayerVersionProps, Runtime } from 'aws-cdk-lib/aws-lambda';\n\nimport { IBaseCdkConstructProps } from '../../types';\n\n/**\n * Props for BaseLambdaLayerConstruct\n *\n * Provides configuration for:\n * - Creating a new Lambda Layer\n * - Importing an existing layer by ARN or attributes\n */\ninterface ILambdaLayerConstructProps extends Omit<IBaseCdkConstructProps<{\n\t/**\n\t * Configuration for creating a new Lambda layer\n\t *\n\t * Note:\n\t * - `layerVersionName` is required\n\t * - `compatibleArchitectures` is managed internally\n\t */\n\treadonly layerOptions?: Partial<Omit<LayerVersionProps, 'layerVersionName' | 'compatibleArchitectures'>>\n\t& Required<Pick<LayerVersionProps, 'layerVersionName'>>;\n\n\t/** Import an existing layer by ARN */\n\treadonly fromExistingLayerArn?: string;\n\n\t/** Import an existing layer using attributes */\n\treadonly fromExistingLayerAttribute?: {\n\t\treadonly layerVersionArn: string;\n\t\treadonly compatibleRuntimes?: Runtime[];\n\t};\n}>, 'appName' | 'stage' | 'stackName'> { }\n\n/**\n * CDK construct for Lambda Layer\n *\n * Responsibilities:\n * - Creates a new Lambda layer or imports an existing one\n * - Applies default runtime and architecture compatibility\n * - Exposes the layer ARN as a CloudFormation output\n */\nexport class BaseLambdaLayerConstruct extends Construct {\n\t/** Newly created Lambda Layer (null if importing existing layer) */\n\treadonly layer: LayerVersion;\n\n\t/** Imported Lambda Layer reference (null if creating new layer) */\n\treadonly existingLayer: ILayerVersion;\n\n\t/**\n\t * @param scope Parent construct\n\t * @param id Unique construct identifier\n\t * @param props Configuration for layer creation or import\n\t */\n\tconstructor(scope: Construct, id: string, props?: ILambdaLayerConstructProps) {\n\t\tsuper(scope, id);\n\n\t\t/**\n\t\t * Import layer by ARN\n\t\t */\n\t\tif (props?.options?.fromExistingLayerArn) {\n\t\t\tthis.existingLayer = LayerVersion.fromLayerVersionArn(\n\t\t\t\tthis,\n\t\t\t\t`${id}-Arn`,\n\t\t\t\tprops?.options?.fromExistingLayerArn\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Import layer using attributes\n\t\t\t */\n\t\t} else if (props?.options?.fromExistingLayerAttribute) {\n\t\t\tthis.existingLayer = LayerVersion.fromLayerVersionAttributes(\n\t\t\t\tthis,\n\t\t\t\t`${id}-Attribute`,\n\t\t\t\tprops?.options?.fromExistingLayerAttribute\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Create new Lambda layer\n\t\t\t */\n\t\t} else {\n\t\t\tthis.layer = new LayerVersion(this, id, {\n\t\t\t\t...props.options?.layerOptions,\n\n\t\t\t\t/**\n\t\t\t\t * Default layer code asset\n\t\t\t\t */\n\t\t\t\tcode:\n\t\t\t\t\tprops?.options?.layerOptions?.code\n\t\t\t\t\t|| Code.fromAsset('./dist-layer'),\n\n\t\t\t\t/**\n\t\t\t\t * Layer description\n\t\t\t\t */\n\t\t\t\tdescription:\n\t\t\t\t\tprops?.options?.layerOptions?.description\n\t\t\t\t\t|| 'Lambda Layer written in NodeJS, NestJS, NodeJS-express, serverless-express',\n\n\t\t\t\t/**\n\t\t\t\t * Supported CPU architectures\n\t\t\t\t */\n\t\t\t\tcompatibleArchitectures: [\n\t\t\t\t\tArchitecture.ARM_64,\n\t\t\t\t\tArchitecture.X86_64\n\t\t\t\t],\n\n\t\t\t\t/**\n\t\t\t\t * Supported runtimes\n\t\t\t\t */\n\t\t\t\tcompatibleRuntimes: [\n\t\t\t\t\tRuntime.NODEJS_22_X,\n\t\t\t\t\tRuntime.NODEJS_24_X,\n\t\t\t\t\tRuntime.NODEJS_LATEST\n\t\t\t\t]\n\t\t\t} as LayerVersionProps);\n\t\t}\n\n\t\t/**\n\t\t * CloudFormation output exposing the layer ARN\n\t\t * Resolves to either created or imported layer\n\t\t */\n\t\tnew CfnOutput(this, 'LambdaLayerArn', {\n\t\t\tvalue:\n\t\t\t\t(props.options?.fromExistingLayerArn || props.options?.fromExistingLayerAttribute)\n\t\t\t\t\t? this.existingLayer.layerVersionArn\n\t\t\t\t\t: this.layer.layerVersionArn\n\t\t});\n\t}\n}","import { Construct } from 'constructs';\nimport { CfnOutput, RemovalPolicy } from 'aws-cdk-lib';\nimport { ManagedPolicy, PolicyStatement, PolicyStatementProps, Role, RoleProps } from 'aws-cdk-lib/aws-iam';\n\nimport { IBaseCdkConstructProps } from '../../types';\n\n/**\n * Props for BaseRolePolicyConstruct\n *\n * Provides configuration for:\n * - IAM role creation\n * - Inline policy statements\n */\ninterface IDynamoDBConstructProps extends Omit<IBaseCdkConstructProps<{\n\t/** IAM Role configuration options */\n\treadonly roleOptions: RoleProps\n}>, 'appName' | 'stage' | 'stackName'> {\n\t/**\n\t * Additional inline policies to attach to the role\n\t *\n\t * Each entry is converted into a PolicyStatement\n\t */\n\treadonly policies?: PolicyStatementProps[];\n}\n\n/**\n * CDK construct for IAM Role with policies\n *\n * Responsibilities:\n * - Creates an IAM role with configurable options\n * - Applies a default AWS managed policy if none is provided\n * - Attaches optional inline policy statements\n * - Exposes the role ARN as a CloudFormation output\n */\nexport class BaseRolePolicyConstruct extends Construct {\n\t/** The created IAM Role instance */\n\treadonly role: Role;\n\n\t/**\n\t * @param scope Parent construct\n\t * @param id Unique construct identifier\n\t * @param props Configuration for role and policies\n\t */\n\tconstructor(scope: Construct, id: string, props: IDynamoDBConstructProps) {\n\t\tsuper(scope, id);\n\n\t\tthis.role = new Role(this, id, {\n\t\t\t...props.options?.roleOptions,\n\n\t\t\t/**\n\t\t\t * Managed policies attached to the role\n\t\t\t * Defaults to AWSLambdaBasicExecutionRole if not provided\n\t\t\t */\n\t\t\tmanagedPolicies:\n\t\t\t\tprops.options?.roleOptions?.managedPolicies\n\t\t\t\t\t? props.options.roleOptions.managedPolicies\n\t\t\t\t\t: [\n\t\t\t\t\t\tManagedPolicy.fromAwsManagedPolicyName(\n\t\t\t\t\t\t\t'service-role/AWSLambdaBasicExecutionRole'\n\t\t\t\t\t\t)\n\t\t\t\t\t]\n\t\t});\n\n\t\t/**\n\t\t * Attach inline policy statements to the role\n\t\t */\n\t\tif (props?.policies?.length) {\n\t\t\tprops.policies.forEach((policy) => {\n\t\t\t\tthis.role.addToPolicy(\n\t\t\t\t\t/**\n\t\t\t\t\t * Inline policy statement\n\t\t\t\t\t */\n\t\t\t\t\tnew PolicyStatement(policy)\n\t\t\t\t);\n\t\t\t});\n\t\t}\n\n\t\t/**\n\t\t * Apply removal policy (useful for non-production environments)\n\t\t */\n\t\tthis.role.applyRemovalPolicy(RemovalPolicy.DESTROY);\n\n\t\t/**\n\t\t * CloudFormation output exposing the role ARN\n\t\t */\n\t\tnew CfnOutput(this, 'RolePolicyArn', {\n\t\t\tvalue: this.role.roleArn\n\t\t});\n\t}\n}","import { Construct } from 'constructs';\nimport { CfnOutput, RemovalPolicy } from 'aws-cdk-lib';\nimport { Bucket, BucketProps } from 'aws-cdk-lib/aws-s3';\n\nimport { IBaseCdkConstructProps } from '../../types';\n\n/**\n * Props for BaseS3Construct\n *\n * Provides configuration for creating an S3 bucket\n * with optional overrides for bucket properties.\n */\ninterface IS3DeploymentConstructProps extends Omit<IBaseCdkConstructProps<{\n\t/** Configuration options for the S3 bucket */\n\treadonly bucketOptions?: BucketProps;\n}>, 'appName' | 'stackName'> { }\n\n/**\n * CDK construct for S3 bucket\n *\n * Responsibilities:\n * - Creates an S3 bucket with configurable options\n * - Applies a default removal policy if not provided\n * - Exposes the bucket ARN as a CloudFormation output\n */\nexport class BaseS3Construct extends Construct {\n\t/** The created S3 bucket instance */\n\treadonly bucket: Bucket;\n\n\t/**\n\t * @param scope Parent construct\n\t * @param id Unique construct identifier\n\t * @param props Configuration for S3 bucket\n\t */\n\tconstructor(scope: Construct, id: string, props: IS3DeploymentConstructProps) {\n\t\tsuper(scope, id);\n\n\t\tthis.bucket = new Bucket(this, id, {\n\t\t\t...props.options?.bucketOptions,\n\n\t\t\t/**\n\t\t\t * Removal policy applied to the bucket\n\t\t\t * Defaults to DESTROY if not explicitly defined\n\t\t\t */\n\t\t\tremovalPolicy:\n\t\t\t\tprops.options?.bucketOptions?.removalPolicy\n\t\t\t\t|| RemovalPolicy.DESTROY\n\t\t});\n\n\t\t/**\n\t\t * CloudFormation output exposing the S3 bucket ARN\n\t\t */\n\t\tnew CfnOutput(this, 'S3BucketArn', {\n\t\t\tvalue: this.bucket.bucketArn\n\t\t});\n\t}\n}","import { Construct } from 'constructs';\nimport { Bucket, BucketProps } from 'aws-cdk-lib/aws-s3';\nimport { S3BucketOrigin } from 'aws-cdk-lib/aws-cloudfront-origins';\nimport { BucketDeployment, BucketDeploymentProps } from 'aws-cdk-lib/aws-s3-deployment';\nimport { BehaviorOptions, Distribution, DistributionProps } from 'aws-cdk-lib/aws-cloudfront';\n\nimport { ObjectType, CustomException } from '@incloodsolutions/toolkit';\n\nimport { BaseS3Construct } from './s3-construct';\nimport { BaseCloudfrontConstruct } from './cloudfront-construct';\n\nimport { IBaseCdkConstructProps } from '../../types';\n\n/**\n * Props for BaseS3DeploymentConstruct\n *\n * Provides configuration for:\n * - Optional S3 bucket creation\n * - Optional CloudFront distribution\n * - S3 bucket deployment\n */\ninterface IS3DeploymentConstructProps extends Omit<IBaseCdkConstructProps<{\n\t/** Configuration options for S3 bucket */\n\treadonly bucketOptions?: BucketProps;\n\n\t/**\n\t * Configuration options for CloudFront distribution\n\t *\n\t * Note:\n\t * - `additionalBehaviors` supports dynamic route mappings\n\t * - Origins are automatically resolved if not provided\n\t */\n\treadonly cloudfrontOptions?: Partial<Omit<DistributionProps, 'additionalBehaviors'>> & {\n\t\treadonly additionalBehaviors?: ObjectType<Partial<BehaviorOptions>, string>;\n\t};\n\n\t/**\n\t * Configuration for S3 bucket deployment\n\t *\n\t * Note:\n\t * - `sources` is required\n\t * - `destinationBucket` can be auto-resolved\n\t */\n\treadonly bucketDeploymentOptions: Omit<Partial<BucketDeploymentProps>, 'sources'> & Pick<BucketDeploymentProps, 'sources'>;\n}>, 'appName' | 'stackName'> {\n\t/** Whether to create a new S3 bucket */\n\treadonly withS3Bucket?: boolean;\n\n\t/** Whether to create a CloudFront distribution */\n\treadonly withCloudfront?: boolean;\n}\n\n/**\n * CDK construct for S3 deployment with optional CloudFront integration\n *\n * Responsibilities:\n * - Optionally creates an S3 bucket\n * - Optionally creates a CloudFront distribution with S3 origin\n * - Deploys assets to S3 bucket\n * - Configures CloudFront invalidation paths\n *\n * Behaviour:\n * - Automatically links S3 bucket as CloudFront origin when enabled\n * - Resolves destination bucket and distribution if not explicitly provided\n * - Throws when required dependencies are missing\n */\nexport class BaseS3DeploymentConstruct extends Construct {\n\t/** The created or provided S3 bucket */\n\treadonly bucket: Bucket;\n\n\t/** The created CloudFront distribution */\n\treadonly distribution: Distribution;\n\n\t/** S3 bucket deployment instance */\n\treadonly bucketDeployment: BucketDeployment;\n\n\t/**\n\t * @param scope Parent construct\n\t * @param id Unique construct identifier\n\t * @param props Configuration for bucket, distribution, and deployment\n\t */\n\tconstructor(scope: Construct, id: string, props: IS3DeploymentConstructProps) {\n\t\tsuper(scope, id);\n\n\t\t/**\n\t\t * Validate CloudFront origin requirements\n\t\t */\n\t\tif ((!props.options?.cloudfrontOptions?.defaultBehavior?.origin && !props?.withS3Bucket) && props.withCloudfront) {\n\t\t\tthrow new CustomException('Cloudfront distribution S3_Bucket origins must be defined!');\n\t\t}\n\n\t\t/**\n\t\t * Validate deployment destination requirements\n\t\t */\n\t\tif (!props.options?.bucketDeploymentOptions?.destinationBucket && !props?.withS3Bucket) {\n\t\t\tthrow new CustomException('Deployment S3_Bucket destination must be defined!');\n\t\t}\n\n\t\t/**\n\t\t * Create S3 bucket if enabled\n\t\t */\n\t\tif (props?.withS3Bucket) {\n\t\t\tthis.bucket = new BaseS3Construct(this, 'bucket', {\n\t\t\t\tenableDebug: props.enableDebug,\n\t\t\t\toptions: { bucketOptions: props.options?.bucketOptions }\n\t\t\t}).bucket;\n\t\t}\n\n\t\t/**\n\t\t * Create CloudFront distribution if enabled\n\t\t */\n\t\tif (props?.withCloudfront) {\n\n\t\t\t/**\n\t\t\t * Resolve S3 origin for distribution\n\t\t\t */\n\t\t\tconst s3Origin =\n\t\t\t\tprops.options?.cloudfrontOptions?.defaultBehavior?.origin\n\t\t\t\t|| S3BucketOrigin.withOriginAccessControl(this.bucket);\n\n\t\t\tthis.distribution = new BaseCloudfrontConstruct(this, 'distribution', {\n\t\t\t\tenableDebug: props.enableDebug,\n\t\t\t\toptions: {\n\t\t\t\t\tcloudfrontOptions: {\n\t\t\t\t\t\t...props.options?.cloudfrontOptions,\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Map additional behaviors and ensure origin is assigned\n\t\t\t\t\t\t */\n\t\t\t\t\t\tadditionalBehaviors: Object.entries(props.options?.cloudfrontOptions?.additionalBehaviors || {})\n\t\t\t\t\t\t\t.reduce((behavior, [pattern, behaviorOptions]) => {\n\t\t\t\t\t\t\t\tbehavior[pattern] = {\n\t\t\t\t\t\t\t\t\t...behaviorOptions,\n\t\t\t\t\t\t\t\t\torigin: behaviorOptions.origin || s3Origin\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\treturn behavior;\n\t\t\t\t\t\t\t}, {} as typeof props.options.cloudfrontOptions.additionalBehaviors) as ObjectType<BehaviorOptions>,\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Default behavior configuration\n\t\t\t\t\t\t */\n\t\t\t\t\t\tdefaultBehavior: {\n\t\t\t\t\t\t\t...props.options?.cloudfrontOptions?.defaultBehavior,\n\t\t\t\t\t\t\torigin: s3Origin\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t}).distribution;\n\t\t}\n\n\t\t/**\n\t\t * Deploy assets to S3 bucket\n\t\t *\n\t\t * Automatically resolves:\n\t\t * - Destination bucket\n\t\t * - CloudFront distribution\n\t\t * - Invalidation paths\n\t\t */\n\t\tthis.bucketDeployment = new BucketDeployment(this, 'deployment', {\n\t\t\t...props.options?.bucketDeploymentOptions,\n\n\t\t\t/** Target distribution for cache invalidation */\n\t\t\tdistribution:\n\t\t\t\tprops.options?.bucketDeploymentOptions?.distribution\n\t\t\t\t|| this.distribution,\n\n\t\t\t/** Paths to invalidate after deployment */\n\t\t\tdistributionPaths:\n\t\t\t\tprops.options?.bucketDeploymentOptions?.distributionPaths\n\t\t\t\t|| ['/*'],\n\n\t\t\t/** Destination S3 bucket */\n\t\t\tdestinationBucket:\n\t\t\t\tprops.options?.bucketDeploymentOptions?.destinationBucket\n\t\t\t\t|| this.bucket\n\t\t} as BucketDeploymentProps);\n\t}\n}","import { Construct } from 'constructs';\nimport { Function } from 'aws-cdk-lib/aws-lambda';\nimport { CfnOutput, RemovalPolicy } from 'aws-cdk-lib';\nimport { Topic, TopicProps } from 'aws-cdk-lib/aws-sns';\nimport { LambdaSubscription } from 'aws-cdk-lib/aws-sns-subscriptions';\n\nimport { IBaseCdkConstructProps } from '../../types';\n\n/**\n * Props for BaseSnsConstruct\n *\n * Provides configuration for:\n * - SNS topic creation\n * - Lambda subscriptions\n */\ninterface ISnsConstructProps extends Omit<IBaseCdkConstructProps<{\n\t/** SNS topic configuration options */\n\treadonly topicOptions: TopicProps;\n\n\t/**\n\t * Lambda functions to subscribe to the topic\n\t *\n\t * Each function will receive messages published to the topic\n\t */\n\treadonly targetFunctions: Function[];\n}>, 'appName' | 'stage' | 'stackName'> { }\n\n/**\n * CDK construct for SNS topic with Lambda subscriptions\n *\n * Responsibilities:\n * - Creates an SNS topic with configurable options\n * - Subscribes one or more Lambda functions to the topic\n * - Applies a removal policy\n * - Exposes the topic ARN as a CloudFormation output\n */\nexport class BaseSnsConstruct extends Construct {\n\t/** The created SNS topic instance */\n\treadonly topic: Topic;\n\n\t/**\n\t * @param scope Parent construct\n\t * @param id Unique construct identifier\n\t * @param props Configuration for topic and subscriptions\n\t */\n\tconstructor(scope: Construct, id: string, props: ISnsConstructProps) {\n\t\tsuper(scope, id);\n\n\t\tthis.topic = new Topic(this, id, props.options?.topicOptions);\n\n\t\t/**\n\t\t * Attach Lambda subscriptions to the topic\n\t\t */\n\t\tif (props.options?.targetFunctions?.length) {\n\t\t\tprops.options.targetFunctions.forEach((targetFunction) => {\n\t\t\t\tthis.topic.addSubscription(\n\t\t\t\t\t/**\n\t\t\t\t\t * Lambda subscription target\n\t\t\t\t\t */\n\t\t\t\t\tnew LambdaSubscription(targetFunction)\n\t\t\t\t);\n\t\t\t});\n\t\t}\n\n\t\t/**\n\t\t * Apply removal policy (useful for non-production environments)\n\t\t */\n\t\tthis.topic.applyRemovalPolicy(RemovalPolicy.DESTROY);\n\n\t\t/**\n\t\t * CloudFormation output exposing the topic ARN\n\t\t */\n\t\tnew CfnOutput(this, 'SnsTopicArn', {\n\t\t\tvalue: this.topic.topicArn,\n\t\t});\n\t}\n}","import { Construct } from 'constructs';\nimport { CfnOutput, RemovalPolicy } from 'aws-cdk-lib';\nimport { Queue, QueueProps } from 'aws-cdk-lib/aws-sqs';\nimport { EventSourceMapping, EventSourceMappingProps, Function } from 'aws-cdk-lib/aws-lambda';\n\nimport { IBaseCdkConstructProps } from '../../types';\n\n/**\n * Props for BaseSqsConstruct\n *\n * Provides configuration for:\n * - SQS queue creation\n * - Lambda event source mappings\n */\ninterface ISqsConstructProps extends Omit<IBaseCdkConstructProps<{\n\t/** Configuration options for the SQS queue */\n\treadonly queueOptions?: QueueProps;\n\n\t/**\n\t * Configuration for Lambda event source mapping\n\t *\n\t * Note:\n\t * `eventSourceArn` and `target` are managed internally\n\t */\n\treadonly eventSourceMappingOptions?: Omit<EventSourceMappingProps, 'eventSourceArn' | 'target'>;\n}>, 'appName' | 'stage' | 'stackName'> {\n\t/**\n\t * Lambda functions to be triggered by SQS messages\n\t *\n\t * Each function will be connected via an event source mapping\n\t */\n\treadonly targetFunctions?: Function[];\n}\n\n/**\n * CDK construct for SQS queue with Lambda integration\n *\n * Responsibilities:\n * - Creates an SQS queue with configurable options\n * - Attaches one or more Lambda consumers via event source mappings\n * - Applies default retry behaviour\n * - Exposes the queue ARN as a CloudFormation output\n */\nexport class BaseSqsConstruct extends Construct {\n\t/** The created SQS queue instance */\n\treadonly queue: Queue;\n\n\t/**\n\t * @param scope Parent construct\n\t * @param id Unique construct identifier\n\t * @param props Configuration for queue and Lambda consumers\n\t */\n\tconstructor(scope: Construct, id: string, props: ISqsConstructProps) {\n\t\tsuper(scope, id);\n\n\t\tthis.queue = new Queue(this, id, {\n\t\t\t...props?.options?.queueOptions,\n\n\t\t\t/**\n\t\t\t * Removal policy applied to the queue\n\t\t\t * Defaults to DESTROY if not explicitly defined\n\t\t\t */\n\t\t\tremovalPolicy:\n\t\t\t\tprops?.options?.queueOptions?.removalPolicy\n\t\t\t\t|| RemovalPolicy.DESTROY\n\t\t});\n\n\t\t/**\n\t\t * Attach Lambda event source mappings for queue consumption\n\t\t */\n\t\tif (props?.targetFunctions?.length) {\n\t\t\tprops.targetFunctions.forEach((targetFunction, index) => {\n\t\t\t\tnew EventSourceMapping(this, `${id}-eventSourceMap${index + 1}`, {\n\t\t\t\t\t...props?.options?.eventSourceMappingOptions,\n\n\t\t\t\t\t/** Target Lambda function */\n\t\t\t\t\ttarget: targetFunction,\n\n\t\t\t\t\t/** Source SQS queue ARN */\n\t\t\t\t\teventSourceArn: this.queue.queueArn,\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Retry attempts for failed batch processing\n\t\t\t\t\t * Defaults to 3 if not explicitly defined\n\t\t\t\t\t */\n\t\t\t\t\tretryAttempts:\n\t\t\t\t\t\tprops?.options?.eventSourceMappingOptions?.retryAttempts\n\t\t\t\t\t\t|| 3\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\t/**\n\t\t * CloudFormation output exposing the SQS queue ARN\n\t\t */\n\t\tnew CfnOutput(this, 'SqsQueueArn', {\n\t\t\tvalue: this.queue.queueArn\n\t\t});\n\t}\n}","import { Construct } from 'constructs';\nimport { CfnOutput } from 'aws-cdk-lib';\nimport { Vpc, VpcProps } from 'aws-cdk-lib/aws-ec2';\n\nimport { IBaseCdkConstructProps } from '../../types';\n\n\n/**\n * Props for BaseVpcConstruct\n *\n * Provides configuration for creating a VPC.\n */\ninterface IVpcConstructProps extends Omit<IBaseCdkConstructProps<{\n\t/** VPC configuration options */\n\treadonly vpcOptions: VpcProps;\n}>, 'appName' | 'stage' | 'stackName'> { }\n\n/**\n * CDK construct for Virtual Private Cloud (VPC)\n *\n * Responsibilities:\n * - Creates a VPC with configurable options\n * - Exposes the VPC ARN as a CloudFormation output\n */\nexport class BaseVpcConstruct extends Construct {\n\t/** The created VPC instance */\n\treadonly vpc: Vpc;\n\n\t/**\n\t * @param scope Parent construct\n\t * @param id Unique construct identifier\n\t * @param props Configuration for VPC\n\t */\n\tconstructor(scope: Construct, id: string, props: IVpcConstructProps) {\n\t\tsuper(scope, id);\n\n\t\tthis.vpc = new Vpc(this, id, {\n\t\t\t...props.options.vpcOptions\n\t\t});\n\n\t\t/**\n\t\t * CloudFormation output exposing the VPC ARN\n\t\t */\n\t\tnew CfnOutput(this, 'VpcArn', {\n\t\t\tvalue: this.vpc.vpcArn\n\t\t});\n\t}\n}"]}
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+
3
+ //# sourceMappingURL=index.cjs.map
4
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,3 @@
1
+
2
+ //# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}