@incloodsolutions/devkit 0.0.3 → 0.0.5

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 (226) hide show
  1. package/README.md +180 -41
  2. package/dist/{aws/cdk/constructs/api-gateway-v2-construct.cjs → aws-cdk/constructs/api-gateway-v2.cjs} +2 -2
  3. package/dist/aws-cdk/constructs/api-gateway-v2.cjs.map +1 -0
  4. package/dist/{aws/cdk/constructs/api-gateway-v2-construct.d.ts → aws-cdk/constructs/api-gateway-v2.d.cts} +2 -1
  5. package/dist/{aws/cdk/constructs/api-gateway-v2-construct.d.cts → aws-cdk/constructs/api-gateway-v2.d.ts} +2 -1
  6. package/dist/{aws/cdk/constructs/api-gateway-v2-construct.js → aws-cdk/constructs/api-gateway-v2.js} +2 -2
  7. package/dist/aws-cdk/constructs/api-gateway-v2.js.map +1 -0
  8. package/dist/{aws/cdk/constructs/api-gateway-websocket-construct.cjs → aws-cdk/constructs/api-gateway-websocket.cjs} +18 -6
  9. package/dist/aws-cdk/constructs/api-gateway-websocket.cjs.map +1 -0
  10. package/dist/{aws/cdk/constructs/api-gateway-websocket-construct.d.ts → aws-cdk/constructs/api-gateway-websocket.d.cts} +2 -1
  11. package/dist/{aws/cdk/constructs/api-gateway-websocket-construct.d.cts → aws-cdk/constructs/api-gateway-websocket.d.ts} +2 -1
  12. package/dist/{aws/cdk/constructs/api-gateway-websocket-construct.js → aws-cdk/constructs/api-gateway-websocket.js} +18 -6
  13. package/dist/aws-cdk/constructs/api-gateway-websocket.js.map +1 -0
  14. package/dist/{aws/cdk/constructs/api-gateway-construct.cjs → aws-cdk/constructs/api-gateway.cjs} +6 -3
  15. package/dist/aws-cdk/constructs/api-gateway.cjs.map +1 -0
  16. package/dist/{aws/cdk/constructs/api-gateway-construct.d.ts → aws-cdk/constructs/api-gateway.d.cts} +2 -1
  17. package/dist/{aws/cdk/constructs/api-gateway-construct.d.cts → aws-cdk/constructs/api-gateway.d.ts} +2 -1
  18. package/dist/{aws/cdk/constructs/api-gateway-construct.js → aws-cdk/constructs/api-gateway.js} +6 -3
  19. package/dist/aws-cdk/constructs/api-gateway.js.map +1 -0
  20. package/dist/{aws/cdk/constructs/cloudfront-construct.cjs → aws-cdk/constructs/cloudfront.cjs} +2 -2
  21. package/dist/aws-cdk/constructs/cloudfront.cjs.map +1 -0
  22. package/dist/{aws/cdk/constructs/cloudfront-construct.d.ts → aws-cdk/constructs/cloudfront.d.cts} +2 -1
  23. package/dist/{aws/cdk/constructs/cloudfront-construct.d.cts → aws-cdk/constructs/cloudfront.d.ts} +2 -1
  24. package/dist/{aws/cdk/constructs/cloudfront-construct.js → aws-cdk/constructs/cloudfront.js} +2 -2
  25. package/dist/aws-cdk/constructs/cloudfront.js.map +1 -0
  26. package/dist/{aws/cdk/constructs/cloudwatch-construct.cjs → aws-cdk/constructs/cloudwatch.cjs} +2 -2
  27. package/dist/aws-cdk/constructs/cloudwatch.cjs.map +1 -0
  28. package/dist/{aws/cdk/constructs/cloudwatch-construct.d.ts → aws-cdk/constructs/cloudwatch.d.cts} +2 -1
  29. package/dist/{aws/cdk/constructs/cloudwatch-construct.d.cts → aws-cdk/constructs/cloudwatch.d.ts} +2 -1
  30. package/dist/{aws/cdk/constructs/cloudwatch-construct.js → aws-cdk/constructs/cloudwatch.js} +2 -2
  31. package/dist/aws-cdk/constructs/cloudwatch.js.map +1 -0
  32. package/dist/{aws/cdk/constructs/dynamo-db-construct.cjs → aws-cdk/constructs/dynamo-db.cjs} +2 -2
  33. package/dist/aws-cdk/constructs/dynamo-db.cjs.map +1 -0
  34. package/dist/{aws/cdk/constructs/dynamo-db-construct.d.ts → aws-cdk/constructs/dynamo-db.d.cts} +2 -1
  35. package/dist/{aws/cdk/constructs/dynamo-db-construct.d.cts → aws-cdk/constructs/dynamo-db.d.ts} +2 -1
  36. package/dist/{aws/cdk/constructs/dynamo-db-construct.js → aws-cdk/constructs/dynamo-db.js} +2 -2
  37. package/dist/aws-cdk/constructs/dynamo-db.js.map +1 -0
  38. package/dist/{aws/cdk/constructs/event-bridge-construct.cjs → aws-cdk/constructs/event-bridge.cjs} +2 -2
  39. package/dist/aws-cdk/constructs/event-bridge.cjs.map +1 -0
  40. package/dist/{aws/cdk/constructs/event-bridge-construct.d.ts → aws-cdk/constructs/event-bridge.d.cts} +2 -1
  41. package/dist/{aws/cdk/constructs/event-bridge-construct.d.cts → aws-cdk/constructs/event-bridge.d.ts} +2 -1
  42. package/dist/{aws/cdk/constructs/event-bridge-construct.js → aws-cdk/constructs/event-bridge.js} +2 -2
  43. package/dist/aws-cdk/constructs/event-bridge.js.map +1 -0
  44. package/dist/{aws/cdk/constructs/lambda-authorizer-v2-construct.cjs → aws-cdk/constructs/lambda-authorizer-v2.cjs} +6 -3
  45. package/dist/aws-cdk/constructs/lambda-authorizer-v2.cjs.map +1 -0
  46. package/dist/{aws/cdk/constructs/lambda-authorizer-v2-construct.d.ts → aws-cdk/constructs/lambda-authorizer-v2.d.cts} +2 -1
  47. package/dist/{aws/cdk/constructs/lambda-authorizer-v2-construct.d.cts → aws-cdk/constructs/lambda-authorizer-v2.d.ts} +2 -1
  48. package/dist/{aws/cdk/constructs/lambda-authorizer-v2-construct.js → aws-cdk/constructs/lambda-authorizer-v2.js} +6 -3
  49. package/dist/aws-cdk/constructs/lambda-authorizer-v2.js.map +1 -0
  50. package/dist/{aws/cdk/constructs/lambda-authorizer-construct.cjs → aws-cdk/constructs/lambda-authorizer.cjs} +2 -2
  51. package/dist/aws-cdk/constructs/lambda-authorizer.cjs.map +1 -0
  52. package/dist/{aws/cdk/constructs/lambda-authorizer-construct.d.cts → aws-cdk/constructs/lambda-authorizer.d.cts} +2 -1
  53. package/dist/{aws/cdk/constructs/lambda-authorizer-construct.d.ts → aws-cdk/constructs/lambda-authorizer.d.ts} +2 -1
  54. package/dist/{aws/cdk/constructs/lambda-authorizer-construct.js → aws-cdk/constructs/lambda-authorizer.js} +2 -2
  55. package/dist/aws-cdk/constructs/lambda-authorizer.js.map +1 -0
  56. package/dist/{aws/cdk/constructs/lambda-layer-construct.cjs → aws-cdk/constructs/lambda-layer.cjs} +3 -6
  57. package/dist/aws-cdk/constructs/lambda-layer.cjs.map +1 -0
  58. package/dist/{aws/cdk/constructs/lambda-layer-construct.d.ts → aws-cdk/constructs/lambda-layer.d.cts} +2 -1
  59. package/dist/{aws/cdk/constructs/lambda-layer-construct.d.cts → aws-cdk/constructs/lambda-layer.d.ts} +2 -1
  60. package/dist/{aws/cdk/constructs/lambda-layer-construct.js → aws-cdk/constructs/lambda-layer.js} +3 -6
  61. package/dist/aws-cdk/constructs/lambda-layer.js.map +1 -0
  62. package/dist/{aws/cdk/constructs/lambda-construct.cjs → aws-cdk/constructs/lambda.cjs} +4 -4
  63. package/dist/aws-cdk/constructs/lambda.cjs.map +1 -0
  64. package/dist/{aws/cdk/constructs/lambda-construct.d.ts → aws-cdk/constructs/lambda.d.cts} +2 -1
  65. package/dist/{aws/cdk/constructs/lambda-construct.d.cts → aws-cdk/constructs/lambda.d.ts} +2 -1
  66. package/dist/{aws/cdk/constructs/lambda-construct.js → aws-cdk/constructs/lambda.js} +4 -4
  67. package/dist/aws-cdk/constructs/lambda.js.map +1 -0
  68. package/dist/{aws/cdk/constructs/role-policy-construct.cjs → aws-cdk/constructs/role-policy.cjs} +2 -2
  69. package/dist/aws-cdk/constructs/role-policy.cjs.map +1 -0
  70. package/dist/{aws/cdk/constructs/role-policy-construct.d.ts → aws-cdk/constructs/role-policy.d.cts} +2 -1
  71. package/dist/{aws/cdk/constructs/role-policy-construct.d.cts → aws-cdk/constructs/role-policy.d.ts} +2 -1
  72. package/dist/{aws/cdk/constructs/role-policy-construct.js → aws-cdk/constructs/role-policy.js} +2 -2
  73. package/dist/aws-cdk/constructs/role-policy.js.map +1 -0
  74. package/dist/aws-cdk/constructs/route53.cjs +79 -0
  75. package/dist/aws-cdk/constructs/route53.cjs.map +1 -0
  76. package/dist/aws-cdk/constructs/route53.d.cts +95 -0
  77. package/dist/aws-cdk/constructs/route53.d.ts +95 -0
  78. package/dist/aws-cdk/constructs/route53.js +77 -0
  79. package/dist/aws-cdk/constructs/route53.js.map +1 -0
  80. package/dist/{aws/cdk/constructs/s3-deployment-construct.cjs → aws-cdk/constructs/s3-deployment.cjs} +20 -11
  81. package/dist/aws-cdk/constructs/s3-deployment.cjs.map +1 -0
  82. package/dist/{aws/cdk/constructs/s3-deployment-construct.d.ts → aws-cdk/constructs/s3-deployment.d.cts} +2 -1
  83. package/dist/{aws/cdk/constructs/s3-deployment-construct.d.cts → aws-cdk/constructs/s3-deployment.d.ts} +2 -1
  84. package/dist/{aws/cdk/constructs/s3-deployment-construct.js → aws-cdk/constructs/s3-deployment.js} +20 -11
  85. package/dist/aws-cdk/constructs/s3-deployment.js.map +1 -0
  86. package/dist/{aws/cdk/constructs/s3-construct.cjs → aws-cdk/constructs/s3.cjs} +2 -2
  87. package/dist/aws-cdk/constructs/s3.cjs.map +1 -0
  88. package/dist/{aws/cdk/constructs/s3-construct.d.ts → aws-cdk/constructs/s3.d.cts} +2 -1
  89. package/dist/{aws/cdk/constructs/s3-construct.d.cts → aws-cdk/constructs/s3.d.ts} +2 -1
  90. package/dist/{aws/cdk/constructs/s3-construct.js → aws-cdk/constructs/s3.js} +2 -2
  91. package/dist/aws-cdk/constructs/s3.js.map +1 -0
  92. package/dist/{aws/cdk/constructs/sns-construct.cjs → aws-cdk/constructs/sns.cjs} +2 -2
  93. package/dist/aws-cdk/constructs/sns.cjs.map +1 -0
  94. package/dist/{aws/cdk/constructs/sns-construct.d.ts → aws-cdk/constructs/sns.d.cts} +2 -1
  95. package/dist/{aws/cdk/constructs/sns-construct.d.cts → aws-cdk/constructs/sns.d.ts} +2 -1
  96. package/dist/{aws/cdk/constructs/sns-construct.js → aws-cdk/constructs/sns.js} +2 -2
  97. package/dist/aws-cdk/constructs/sns.js.map +1 -0
  98. package/dist/{aws/cdk/constructs/sqs-construct.cjs → aws-cdk/constructs/sqs.cjs} +2 -2
  99. package/dist/aws-cdk/constructs/sqs.cjs.map +1 -0
  100. package/dist/{aws/cdk/constructs/sqs-construct.d.ts → aws-cdk/constructs/sqs.d.cts} +2 -1
  101. package/dist/{aws/cdk/constructs/sqs-construct.d.cts → aws-cdk/constructs/sqs.d.ts} +2 -1
  102. package/dist/{aws/cdk/constructs/sqs-construct.js → aws-cdk/constructs/sqs.js} +2 -2
  103. package/dist/aws-cdk/constructs/sqs.js.map +1 -0
  104. package/dist/{aws/cdk/constructs/vpc-construct.cjs → aws-cdk/constructs/vpc.cjs} +2 -2
  105. package/dist/aws-cdk/constructs/vpc.cjs.map +1 -0
  106. package/dist/{aws/cdk/constructs/vpc-construct.d.ts → aws-cdk/constructs/vpc.d.cts} +2 -1
  107. package/dist/{aws/cdk/constructs/vpc-construct.d.cts → aws-cdk/constructs/vpc.d.ts} +2 -1
  108. package/dist/{aws/cdk/constructs/vpc-construct.js → aws-cdk/constructs/vpc.js} +2 -2
  109. package/dist/aws-cdk/constructs/vpc.js.map +1 -0
  110. package/dist/aws-cdk/stacks/lambda-api.cjs +252 -0
  111. package/dist/aws-cdk/stacks/lambda-api.cjs.map +1 -0
  112. package/dist/aws-cdk/stacks/lambda-api.d.cts +16 -0
  113. package/dist/aws-cdk/stacks/lambda-api.d.ts +16 -0
  114. package/dist/aws-cdk/stacks/lambda-api.js +250 -0
  115. package/dist/aws-cdk/stacks/lambda-api.js.map +1 -0
  116. package/dist/aws-cdk/stacks/lambda-sns.cjs +211 -0
  117. package/dist/aws-cdk/stacks/lambda-sns.cjs.map +1 -0
  118. package/dist/aws-cdk/stacks/lambda-sns.d.cts +17 -0
  119. package/dist/aws-cdk/stacks/lambda-sns.d.ts +17 -0
  120. package/dist/aws-cdk/stacks/lambda-sns.js +209 -0
  121. package/dist/aws-cdk/stacks/lambda-sns.js.map +1 -0
  122. package/dist/aws-cdk/stacks/lambda-sqs.cjs +220 -0
  123. package/dist/aws-cdk/stacks/lambda-sqs.cjs.map +1 -0
  124. package/dist/aws-cdk/stacks/lambda-sqs.d.cts +18 -0
  125. package/dist/aws-cdk/stacks/lambda-sqs.d.ts +18 -0
  126. package/dist/aws-cdk/stacks/lambda-sqs.js +218 -0
  127. package/dist/aws-cdk/stacks/lambda-sqs.js.map +1 -0
  128. package/dist/aws-types.cjs +4 -0
  129. package/dist/aws-types.cjs.map +1 -0
  130. package/dist/aws-types.d.cts +55 -0
  131. package/dist/aws-types.d.ts +55 -0
  132. package/dist/aws-types.js +3 -0
  133. package/dist/aws-types.js.map +1 -0
  134. package/dist/{aws/cdk/constructs/index.cjs → aws.cjs} +244 -23
  135. package/dist/aws.cjs.map +1 -0
  136. package/dist/aws.d.cts +40 -0
  137. package/dist/aws.d.ts +40 -0
  138. package/dist/{aws/index.js → aws.js} +243 -26
  139. package/dist/aws.js.map +1 -0
  140. package/dist/index.cjs +242 -21
  141. package/dist/index.cjs.map +1 -1
  142. package/dist/index.d.cts +24 -18
  143. package/dist/index.d.ts +24 -18
  144. package/dist/index.js +241 -24
  145. package/dist/index.js.map +1 -1
  146. package/package.json +160 -25
  147. package/dist/aws/cdk/constructs/api-gateway-construct.cjs.map +0 -1
  148. package/dist/aws/cdk/constructs/api-gateway-construct.js.map +0 -1
  149. package/dist/aws/cdk/constructs/api-gateway-v2-construct.cjs.map +0 -1
  150. package/dist/aws/cdk/constructs/api-gateway-v2-construct.js.map +0 -1
  151. package/dist/aws/cdk/constructs/api-gateway-websocket-construct.cjs.map +0 -1
  152. package/dist/aws/cdk/constructs/api-gateway-websocket-construct.js.map +0 -1
  153. package/dist/aws/cdk/constructs/cloudfront-construct.cjs.map +0 -1
  154. package/dist/aws/cdk/constructs/cloudfront-construct.js.map +0 -1
  155. package/dist/aws/cdk/constructs/cloudwatch-construct.cjs.map +0 -1
  156. package/dist/aws/cdk/constructs/cloudwatch-construct.js.map +0 -1
  157. package/dist/aws/cdk/constructs/dynamo-db-construct.cjs.map +0 -1
  158. package/dist/aws/cdk/constructs/dynamo-db-construct.js.map +0 -1
  159. package/dist/aws/cdk/constructs/event-bridge-construct.cjs.map +0 -1
  160. package/dist/aws/cdk/constructs/event-bridge-construct.js.map +0 -1
  161. package/dist/aws/cdk/constructs/index.cjs.map +0 -1
  162. package/dist/aws/cdk/constructs/index.d.cts +0 -34
  163. package/dist/aws/cdk/constructs/index.d.ts +0 -34
  164. package/dist/aws/cdk/constructs/index.js +0 -863
  165. package/dist/aws/cdk/constructs/index.js.map +0 -1
  166. package/dist/aws/cdk/constructs/lambda-authorizer-construct.cjs.map +0 -1
  167. package/dist/aws/cdk/constructs/lambda-authorizer-construct.js.map +0 -1
  168. package/dist/aws/cdk/constructs/lambda-authorizer-v2-construct.cjs.map +0 -1
  169. package/dist/aws/cdk/constructs/lambda-authorizer-v2-construct.js.map +0 -1
  170. package/dist/aws/cdk/constructs/lambda-construct.cjs.map +0 -1
  171. package/dist/aws/cdk/constructs/lambda-construct.js.map +0 -1
  172. package/dist/aws/cdk/constructs/lambda-layer-construct.cjs.map +0 -1
  173. package/dist/aws/cdk/constructs/lambda-layer-construct.js.map +0 -1
  174. package/dist/aws/cdk/constructs/role-policy-construct.cjs.map +0 -1
  175. package/dist/aws/cdk/constructs/role-policy-construct.js.map +0 -1
  176. package/dist/aws/cdk/constructs/s3-construct.cjs.map +0 -1
  177. package/dist/aws/cdk/constructs/s3-construct.js.map +0 -1
  178. package/dist/aws/cdk/constructs/s3-deployment-construct.cjs.map +0 -1
  179. package/dist/aws/cdk/constructs/s3-deployment-construct.js.map +0 -1
  180. package/dist/aws/cdk/constructs/sns-construct.cjs.map +0 -1
  181. package/dist/aws/cdk/constructs/sns-construct.js.map +0 -1
  182. package/dist/aws/cdk/constructs/sqs-construct.cjs.map +0 -1
  183. package/dist/aws/cdk/constructs/sqs-construct.js.map +0 -1
  184. package/dist/aws/cdk/constructs/vpc-construct.cjs.map +0 -1
  185. package/dist/aws/cdk/constructs/vpc-construct.js.map +0 -1
  186. package/dist/aws/cdk/index.cjs +0 -881
  187. package/dist/aws/cdk/index.cjs.map +0 -1
  188. package/dist/aws/cdk/index.d.cts +0 -34
  189. package/dist/aws/cdk/index.d.ts +0 -34
  190. package/dist/aws/cdk/index.js +0 -863
  191. package/dist/aws/cdk/index.js.map +0 -1
  192. package/dist/aws/cli/index.cjs +0 -4
  193. package/dist/aws/cli/index.cjs.map +0 -1
  194. package/dist/aws/cli/index.d.cts +0 -2
  195. package/dist/aws/cli/index.d.ts +0 -2
  196. package/dist/aws/cli/index.js +0 -3
  197. package/dist/aws/cli/index.js.map +0 -1
  198. package/dist/aws/index.cjs +0 -881
  199. package/dist/aws/index.cjs.map +0 -1
  200. package/dist/aws/index.d.cts +0 -34
  201. package/dist/aws/index.d.ts +0 -34
  202. package/dist/aws/index.js.map +0 -1
  203. package/dist/aws/types/index.cjs +0 -4
  204. package/dist/aws/types/index.cjs.map +0 -1
  205. package/dist/aws/types/index.d.cts +0 -18
  206. package/dist/aws/types/index.d.ts +0 -18
  207. package/dist/aws/types/index.js +0 -3
  208. package/dist/aws/types/index.js.map +0 -1
  209. package/dist/lint/index.cjs +0 -4
  210. package/dist/lint/index.cjs.map +0 -1
  211. package/dist/lint/index.d.cts +0 -2
  212. package/dist/lint/index.d.ts +0 -2
  213. package/dist/lint/index.js +0 -3
  214. package/dist/lint/index.js.map +0 -1
  215. package/dist/prettier/index.cjs +0 -4
  216. package/dist/prettier/index.cjs.map +0 -1
  217. package/dist/prettier/index.d.cts +0 -2
  218. package/dist/prettier/index.d.ts +0 -2
  219. package/dist/prettier/index.js +0 -3
  220. package/dist/prettier/index.js.map +0 -1
  221. package/dist/utility/index.cjs +0 -4
  222. package/dist/utility/index.cjs.map +0 -1
  223. package/dist/utility/index.d.cts +0 -2
  224. package/dist/utility/index.d.ts +0 -2
  225. package/dist/utility/index.js +0 -3
  226. package/dist/utility/index.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/aws/cdk/constructs/lambda-construct.ts"],"names":[],"mappings":";;;;;;;AAwCO,IA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mB,UAAA,GAAa,EAAA,GAAK;AAAA,OACtD;AAAA;AAAA;AAAA;AAAA,MAKD,UAAA,EAAY,KAAA,EAAO,OAAA,EAAS,aAAA,EAAe,UAAA,IAAc,IAAA;AAAA;AAAA;AAAA;AAAA,MAKzD,YAAA,EACC,KAAA,EAAO,OAAA,EAAS,aAAA,EAAe,gBAAgB,YAAA,CAAa,MAAA;AAAA;AAAA;AAAA;AAAA,MAK7D,MAAM,KAAA,EAAO,OAAA,EAAS,eAAe,IAAA,IAAQ,IAAA,CAAK,UAAU,MAAM,CAAA;AAAA;AAAA;AAAA;AAAA,MAKlE;AAAA,KACA,CAAA;AAKD,IAAA,IAAI,SAAA,CAAU,MAAM,mBAAA,EAAqB;AAAA,MACxC,KAAA,EAAO,KAAK,QAAA,CAAS;AAAA,KACrB,CAAA;AAAA,EACF;AACD","file":"lambda.js","sourcesContent":["import { Construct } from 'constructs';\nimport { CfnOutput, Duration } from 'aws-cdk-lib';\nimport {\n\tArchitecture,\n\tCode,\n\tFunction,\n\tFunctionProps,\n\tRuntime,\n} from 'aws-cdk-lib/aws-lambda';\n\nimport {\n\tdetectDuplicateProperties,\n\tAppEnvironmentEnum,\n} 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<\n\tIBaseCdkConstructProps<{\n\t\t/** Partial Lambda configuration options */\n\t\treadonly lambdaOptions: Partial<FunctionProps>;\n\t}>,\n\t'appName'\n> {}\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>\" if not provided\n\t\t\t */\n\t\t\tfunctionName: `${props?.options?.lambdaOptions?.functionName || props?.stackName}`,\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 || '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: props?.options?.lambdaOptions?.handler || 'lambda.handler',\n\n\t\t\t/**\n\t\t\t * Runtime environment\n\t\t\t */\n\t\t\truntime: props?.options?.lambdaOptions?.runtime || 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\tDuration.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: props?.options?.lambdaOptions?.memorySize || 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 || Architecture.ARM_64,\n\n\t\t\t/**\n\t\t\t * Lambda deployment package source\n\t\t\t */\n\t\t\tcode: props?.options?.lambdaOptions?.code || 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}\n"]}
@@ -49,5 +49,5 @@ var BaseRolePolicyConstruct = class extends constructs.Construct {
49
49
  };
50
50
 
51
51
  exports.BaseRolePolicyConstruct = BaseRolePolicyConstruct;
52
- //# sourceMappingURL=role-policy-construct.cjs.map
53
- //# sourceMappingURL=role-policy-construct.cjs.map
52
+ //# sourceMappingURL=role-policy.cjs.map
53
+ //# sourceMappingURL=role-policy.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/aws/cdk/constructs/role-policy-construct.ts"],"names":["Construct","Role","ManagedPolicy","PolicyStatement","RemovalPolicy","CfnOutput"],"mappings":";;;;;;;;AA2CO,IAAM,uBAAA,GAAN,cAAsCA,oBAAA,CAAU;AAAA,EA3CvD;AA2CuD,IAAA,MAAA,CAAA,IAAA,EAAA,yBAAA,CAAA;AAAA;AAAA;AAAA,EAE7C,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOT,WAAA,CAAY,KAAA,EAAkB,EAAA,EAAY,KAAA,EAAgC;AACzE,IAAA,KAAA,CAAM,OAAO,EAAE,CAAA;AAEf,IAAA,IAAA,CAAK,IAAA,GAAO,IAAIC,WAAA,CAAK,IAAA,EAAM,EAAA,EAAI;AAAA,MAC9B,GAAG,MAAM,OAAA,EAAS,WAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAMlB,eAAA,EAAiB,MAAM,OAAA,EAAS,WAAA,EAAa,kBAC1C,KAAA,CAAM,OAAA,CAAQ,YAAY,eAAA,GAC1B;AAAA,QACAC,oBAAA,CAAc,wBAAA;AAAA,UACb;AAAA;AACD;AACD,KACF,CAAA;AAKD,IAAA,IAAI,KAAA,EAAO,UAAU,MAAA,EAAQ;AAC5B,MAAA,KAAA,CAAM,QAAA,CAAS,OAAA,CAAQ,CAAC,MAAA,KAAW;AAClC,QAAA,IAAA,CAAK,IAAA,CAAK,WAAA;AAAA;AAAA;AAAA;AAAA,UAIT,IAAIC,uBAAgB,MAAM;AAAA,SAC3B;AAAA,MACD,CAAC,CAAA;AAAA,IACF;AAKA,IAAA,IAAA,CAAK,IAAA,CAAK,kBAAA,CAAmBC,uBAAA,CAAc,OAAO,CAAA;AAKlD,IAAA,IAAIC,mBAAA,CAAU,MAAM,eAAA,EAAiB;AAAA,MACpC,KAAA,EAAO,KAAK,IAAA,CAAK;AAAA,KACjB,CAAA;AAAA,EACF;AACD","file":"role-policy.cjs","sourcesContent":["import { Construct } from 'constructs';\nimport { CfnOutput, RemovalPolicy } from 'aws-cdk-lib';\nimport {\n\tManagedPolicy,\n\tPolicyStatement,\n\tPolicyStatementProps,\n\tRole,\n\tRoleProps,\n} 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<\n\tIBaseCdkConstructProps<{\n\t\t/** IAM Role configuration options */\n\t\treadonly roleOptions: RoleProps;\n\t}>,\n\t'appName' | 'stage' | 'stackName'\n> {\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: props.options?.roleOptions?.managedPolicies\n\t\t\t\t? props.options.roleOptions.managedPolicies\n\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}\n"]}
@@ -1,7 +1,8 @@
1
1
  import { Construct } from 'constructs';
2
2
  import { Role, RoleProps, PolicyStatementProps } from 'aws-cdk-lib/aws-iam';
3
- import { IBaseCdkConstructProps } from '../../types/index.js';
3
+ import { IBaseCdkConstructProps } from '../../aws-types.cjs';
4
4
  import '@incloodsolutions/toolkit';
5
+ import 'aws-cdk-lib';
5
6
 
6
7
  /**
7
8
  * Props for BaseRolePolicyConstruct
@@ -1,7 +1,8 @@
1
1
  import { Construct } from 'constructs';
2
2
  import { Role, RoleProps, PolicyStatementProps } from 'aws-cdk-lib/aws-iam';
3
- import { IBaseCdkConstructProps } from '../../types/index.cjs';
3
+ import { IBaseCdkConstructProps } from '../../aws-types.js';
4
4
  import '@incloodsolutions/toolkit';
5
+ import 'aws-cdk-lib';
5
6
 
6
7
  /**
7
8
  * Props for BaseRolePolicyConstruct
@@ -47,5 +47,5 @@ var BaseRolePolicyConstruct = class extends Construct {
47
47
  };
48
48
 
49
49
  export { BaseRolePolicyConstruct };
50
- //# sourceMappingURL=role-policy-construct.js.map
51
- //# sourceMappingURL=role-policy-construct.js.map
50
+ //# sourceMappingURL=role-policy.js.map
51
+ //# sourceMappingURL=role-policy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/aws/cdk/constructs/role-policy-construct.ts"],"names":[],"mappings":";;;;;;AA2CO,IAAM,uBAAA,GAAN,cAAsC,SAAA,CAAU;AAAA,EA3CvD;AA2CuD,IAAA,MAAA,CAAA,IAAA,EAAA,yBAAA,CAAA;AAAA;AAAA;AAAA,EAE7C,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOT,WAAA,CAAY,KAAA,EAAkB,EAAA,EAAY,KAAA,EAAgC;AACzE,IAAA,KAAA,CAAM,OAAO,EAAE,CAAA;AAEf,IAAA,IAAA,CAAK,IAAA,GAAO,IAAI,IAAA,CAAK,IAAA,EAAM,EAAA,EAAI;AAAA,MAC9B,GAAG,MAAM,OAAA,EAAS,WAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAMlB,eAAA,EAAiB,MAAM,OAAA,EAAS,WAAA,EAAa,kBAC1C,KAAA,CAAM,OAAA,CAAQ,YAAY,eAAA,GAC1B;AAAA,QACA,aAAA,CAAc,wBAAA;AAAA,UACb;AAAA;AACD;AACD,KACF,CAAA;AAKD,IAAA,IAAI,KAAA,EAAO,UAAU,MAAA,EAAQ;AAC5B,MAAA,KAAA,CAAM,QAAA,CAAS,OAAA,CAAQ,CAAC,MAAA,KAAW;AAClC,QAAA,IAAA,CAAK,IAAA,CAAK,WAAA;AAAA;AAAA;AAAA;AAAA,UAIT,IAAI,gBAAgB,MAAM;AAAA,SAC3B;AAAA,MACD,CAAC,CAAA;AAAA,IACF;AAKA,IAAA,IAAA,CAAK,IAAA,CAAK,kBAAA,CAAmB,aAAA,CAAc,OAAO,CAAA;AAKlD,IAAA,IAAI,SAAA,CAAU,MAAM,eAAA,EAAiB;AAAA,MACpC,KAAA,EAAO,KAAK,IAAA,CAAK;AAAA,KACjB,CAAA;AAAA,EACF;AACD","file":"role-policy.js","sourcesContent":["import { Construct } from 'constructs';\nimport { CfnOutput, RemovalPolicy } from 'aws-cdk-lib';\nimport {\n\tManagedPolicy,\n\tPolicyStatement,\n\tPolicyStatementProps,\n\tRole,\n\tRoleProps,\n} 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<\n\tIBaseCdkConstructProps<{\n\t\t/** IAM Role configuration options */\n\t\treadonly roleOptions: RoleProps;\n\t}>,\n\t'appName' | 'stage' | 'stackName'\n> {\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: props.options?.roleOptions?.managedPolicies\n\t\t\t\t? props.options.roleOptions.managedPolicies\n\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}\n"]}
@@ -0,0 +1,79 @@
1
+ 'use strict';
2
+
3
+ var constructs = require('constructs');
4
+ var awsCdkLib = require('aws-cdk-lib');
5
+ var awsRoute53 = require('aws-cdk-lib/aws-route53');
6
+ var toolkit = require('@incloodsolutions/toolkit');
7
+
8
+ var __defProp = Object.defineProperty;
9
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
10
+ var BaseRoute53Construct = class extends constructs.Construct {
11
+ static {
12
+ __name(this, "BaseRoute53Construct");
13
+ }
14
+ /** The hosted zone this construct created, imported, or looked up */
15
+ hostedZone;
16
+ /**
17
+ * @param scope Parent construct
18
+ * @param id Unique construct identifier
19
+ * @param props Configuration for the hosted zone and its records
20
+ */
21
+ constructor(scope, id, props) {
22
+ super(scope, id);
23
+ const options = props?.options ?? {};
24
+ if (options.hostedZoneOptions) {
25
+ this.hostedZone = new awsRoute53.HostedZone(
26
+ this,
27
+ `${id}-HostedZone`,
28
+ options.hostedZoneOptions
29
+ );
30
+ } else if (options.fromExistingHostedZoneAttributes) {
31
+ this.hostedZone = awsRoute53.HostedZone.fromHostedZoneAttributes(
32
+ this,
33
+ `${id}-HostedZone`,
34
+ options.fromExistingHostedZoneAttributes
35
+ );
36
+ } else if (options.fromLookupOptions) {
37
+ this.hostedZone = awsRoute53.HostedZone.fromLookup(
38
+ this,
39
+ `${id}-HostedZone`,
40
+ options.fromLookupOptions
41
+ );
42
+ } else {
43
+ throw new toolkit.CustomException(
44
+ "BaseRoute53Construct requires one of hostedZoneOptions, fromExistingHostedZoneAttributes, or fromLookupOptions"
45
+ );
46
+ }
47
+ options.aRecords?.forEach((record, index) => {
48
+ new awsRoute53.ARecord(this, `${id}-ARecord-${index}`, {
49
+ ...record,
50
+ zone: this.hostedZone
51
+ });
52
+ });
53
+ options.aaaaRecords?.forEach((record, index) => {
54
+ new awsRoute53.AaaaRecord(this, `${id}-AaaaRecord-${index}`, {
55
+ ...record,
56
+ zone: this.hostedZone
57
+ });
58
+ });
59
+ options.cnameRecords?.forEach((record, index) => {
60
+ new awsRoute53.CnameRecord(this, `${id}-CnameRecord-${index}`, {
61
+ ...record,
62
+ zone: this.hostedZone
63
+ });
64
+ });
65
+ options.txtRecords?.forEach((record, index) => {
66
+ new awsRoute53.TxtRecord(this, `${id}-TxtRecord-${index}`, {
67
+ ...record,
68
+ zone: this.hostedZone
69
+ });
70
+ });
71
+ new awsCdkLib.CfnOutput(this, "Route53HostedZoneId", {
72
+ value: this.hostedZone.hostedZoneId
73
+ });
74
+ }
75
+ };
76
+
77
+ exports.BaseRoute53Construct = BaseRoute53Construct;
78
+ //# sourceMappingURL=route53.cjs.map
79
+ //# sourceMappingURL=route53.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/aws/cdk/constructs/route53-construct.ts"],"names":["Construct","HostedZone","CustomException","ARecord","AaaaRecord","CnameRecord","TxtRecord","CfnOutput"],"mappings":";;;;;;;;;AA4GO,IAAM,oBAAA,GAAN,cAAmCA,oBAAA,CAAU;AAAA,EA5GpD;AA4GoD,IAAA,MAAA,CAAA,IAAA,EAAA,sBAAA,CAAA;AAAA;AAAA;AAAA,EAE1C,UAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOT,WAAA,CAAY,KAAA,EAAkB,EAAA,EAAY,KAAA,EAA+B;AACxE,IAAA,KAAA,CAAM,OAAO,EAAE,CAAA;AAEf,IAAA,MAAM,OAAA,GAAU,KAAA,EAAO,OAAA,IAAW,EAAC;AAEnC,IAAA,IAAI,QAAQ,iBAAA,EAAmB;AAC9B,MAAA,IAAA,CAAK,aAAa,IAAIC,qBAAA;AAAA,QACrB,IAAA;AAAA,QACA,GAAG,EAAE,CAAA,WAAA,CAAA;AAAA,QACL,OAAA,CAAQ;AAAA,OACT;AAAA,IACD,CAAA,MAAA,IAAW,QAAQ,gCAAA,EAAkC;AACpD,MAAA,IAAA,CAAK,aAAaA,qBAAA,CAAW,wBAAA;AAAA,QAC5B,IAAA;AAAA,QACA,GAAG,EAAE,CAAA,WAAA,CAAA;AAAA,QACL,OAAA,CAAQ;AAAA,OACT;AAAA,IACD,CAAA,MAAA,IAAW,QAAQ,iBAAA,EAAmB;AACrC,MAAA,IAAA,CAAK,aAAaA,qBAAA,CAAW,UAAA;AAAA,QAC5B,IAAA;AAAA,QACA,GAAG,EAAE,CAAA,WAAA,CAAA;AAAA,QACL,OAAA,CAAQ;AAAA,OACT;AAAA,IACD,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MAC1C,KAAA,EAAO,KAAK,UAAA,CAAW;AAAA,KACvB,CAAA;AAAA,EACF;AACD","file":"route53.cjs","sourcesContent":["import { Construct } from 'constructs';\nimport { CfnOutput } from 'aws-cdk-lib';\nimport {\n\tARecord,\n\tARecordProps,\n\tAaaaRecord,\n\tAaaaRecordProps,\n\tCnameRecord,\n\tCnameRecordProps,\n\tHostedZone,\n\tHostedZoneAttributes,\n\tHostedZoneProps,\n\tHostedZoneProviderProps,\n\tIHostedZone,\n\tTxtRecord,\n\tTxtRecordProps,\n} from 'aws-cdk-lib/aws-route53';\n\nimport { CustomException } from '@incloodsolutions/toolkit';\n\nimport { IBaseCdkConstructProps } from '../../types';\n\n/**\n * Props for BaseRoute53Construct\n *\n * Exactly one of `hostedZoneOptions`, `fromExistingHostedZoneAttributes`, or\n * `fromLookupOptions` must be provided to obtain the hosted zone — a hosted\n * zone is the container Route53 uses to hold every DNS record for one domain.\n * Records are then added to that zone via `aRecords` / `aaaaRecords` /\n * `cnameRecords` / `txtRecords`.\n */\ninterface IRoute53ConstructProps extends Omit<\n\tIBaseCdkConstructProps<{\n\t\t/**\n\t\t * Create a brand-new public hosted zone for `zoneName`. Use this when\n\t\t * Route53 has not yet been given authority over the domain — CDK also\n\t\t * prints the four NS records you must set as the domain's nameservers at\n\t\t * the registrar to actually delegate DNS to this zone.\n\t\t */\n\t\treadonly hostedZoneOptions?: HostedZoneProps;\n\n\t\t/**\n\t\t * Reference an existing hosted zone by its ID and zone name, without\n\t\t * creating a new one. Cheapest and most predictable option — no synth-time\n\t\t * AWS API call, no risk of creating a duplicate zone — but you must already\n\t\t * know the hosted zone ID (from the console, another stack's output, etc.).\n\t\t */\n\t\treadonly fromExistingHostedZoneAttributes?: HostedZoneAttributes;\n\n\t\t/**\n\t\t * Resolve an existing public hosted zone by domain name via an AWS API\n\t\t * call made while CDK synthesises the stack (not at deploy time). Convenient\n\t\t * when you only know the domain name, but requires AWS credentials at synth\n\t\t * and re-runs that lookup (and may cache stale results) on every synth.\n\t\t */\n\t\treadonly fromLookupOptions?: HostedZoneProviderProps;\n\n\t\t/**\n\t\t * `A` records — map this zone (or a subdomain) to one or more IPv4\n\t\t * addresses, or, via `target: RecordTarget.fromAlias(...)`, \"alias\" the\n\t\t * record directly to an AWS resource (CloudFront, API Gateway custom\n\t\t * domain, ALB, another Route53 record, …). Alias `A` records are free,\n\t\t * auto-update if the target's IP changes, and — unlike `CNAME` — are the\n\t\t * only way to point the zone apex (`example.com` itself, not a subdomain)\n\t\t * at an AWS resource. Use this for \"point my (sub)domain at this AWS\n\t\t * service\" or \"point it at a fixed IPv4 address\".\n\t\t */\n\t\treadonly aRecords?: Omit<ARecordProps, 'zone'>[];\n\n\t\t/**\n\t\t * `AAAA` records — the IPv6 counterpart to `A` records: map this zone or a\n\t\t * subdomain to IPv6 addresses, or alias to an AWS resource, the same way\n\t\t * `aRecords` does for IPv4. Add these alongside `aRecords` (not instead of)\n\t\t * when the target also needs to be reachable over IPv6.\n\t\t */\n\t\treadonly aaaaRecords?: Omit<AaaaRecordProps, 'zone'>[];\n\n\t\t/**\n\t\t * `CNAME` records — alias a subdomain to another DNS name (not an IP\n\t\t * address), e.g. `www.example.com` → `example.com`, or a subdomain to a\n\t\t * third-party service's domain (a SaaS custom-domain setup). DNS rules\n\t\t * forbid a `CNAME` at the zone apex and forbid mixing it with any other\n\t\t * record type on the same name — use an alias `A`/`AAAA` record instead\n\t\t * for the apex or for AWS-resource targets.\n\t\t */\n\t\treadonly cnameRecords?: Omit<CnameRecordProps, 'zone'>[];\n\n\t\t/**\n\t\t * `TXT` records — arbitrary text attached to a name, not used for routing\n\t\t * traffic at all. The standard way to prove domain ownership (ACM\n\t\t * certificate DNS validation, Google/Microsoft/other SaaS site\n\t\t * verification) and to publish email-authentication policy (SPF, DKIM,\n\t\t * DMARC). Each string in `values` becomes one quoted TXT value.\n\t\t */\n\t\treadonly txtRecords?: Omit<TxtRecordProps, 'zone'>[];\n\t}>,\n\t'appName' | 'stackName'\n> {}\n\n/**\n * CDK construct for Route53\n *\n * Responsibilities:\n * - Creates a new public hosted zone, imports one by attributes, or looks one\n * up by domain name (exactly one of the three is required)\n * - Optionally attaches `A`, `AAAA`, `CNAME`, and `TXT` records to that zone\n * - Exposes the hosted zone as `.hostedZone` and its ID as a CloudFormation output\n */\nexport class BaseRoute53Construct extends Construct {\n\t/** The hosted zone this construct created, imported, or looked up */\n\treadonly hostedZone: IHostedZone;\n\n\t/**\n\t * @param scope Parent construct\n\t * @param id Unique construct identifier\n\t * @param props Configuration for the hosted zone and its records\n\t */\n\tconstructor(scope: Construct, id: string, props: IRoute53ConstructProps) {\n\t\tsuper(scope, id);\n\n\t\tconst options = props?.options ?? {};\n\n\t\tif (options.hostedZoneOptions) {\n\t\t\tthis.hostedZone = new HostedZone(\n\t\t\t\tthis,\n\t\t\t\t`${id}-HostedZone`,\n\t\t\t\toptions.hostedZoneOptions,\n\t\t\t);\n\t\t} else if (options.fromExistingHostedZoneAttributes) {\n\t\t\tthis.hostedZone = HostedZone.fromHostedZoneAttributes(\n\t\t\t\tthis,\n\t\t\t\t`${id}-HostedZone`,\n\t\t\t\toptions.fromExistingHostedZoneAttributes,\n\t\t\t);\n\t\t} else if (options.fromLookupOptions) {\n\t\t\tthis.hostedZone = HostedZone.fromLookup(\n\t\t\t\tthis,\n\t\t\t\t`${id}-HostedZone`,\n\t\t\t\toptions.fromLookupOptions,\n\t\t\t);\n\t\t} else {\n\t\t\tthrow new CustomException(\n\t\t\t\t'BaseRoute53Construct requires one of hostedZoneOptions, fromExistingHostedZoneAttributes, or fromLookupOptions',\n\t\t\t);\n\t\t}\n\n\t\toptions.aRecords?.forEach((record, index) => {\n\t\t\tnew ARecord(this, `${id}-ARecord-${index}`, {\n\t\t\t\t...record,\n\t\t\t\tzone: this.hostedZone,\n\t\t\t});\n\t\t});\n\n\t\toptions.aaaaRecords?.forEach((record, index) => {\n\t\t\tnew AaaaRecord(this, `${id}-AaaaRecord-${index}`, {\n\t\t\t\t...record,\n\t\t\t\tzone: this.hostedZone,\n\t\t\t});\n\t\t});\n\n\t\toptions.cnameRecords?.forEach((record, index) => {\n\t\t\tnew CnameRecord(this, `${id}-CnameRecord-${index}`, {\n\t\t\t\t...record,\n\t\t\t\tzone: this.hostedZone,\n\t\t\t});\n\t\t});\n\n\t\toptions.txtRecords?.forEach((record, index) => {\n\t\t\tnew TxtRecord(this, `${id}-TxtRecord-${index}`, {\n\t\t\t\t...record,\n\t\t\t\tzone: this.hostedZone,\n\t\t\t});\n\t\t});\n\n\t\t/**\n\t\t * CloudFormation output exposing the Route53 hosted zone ID\n\t\t */\n\t\tnew CfnOutput(this, 'Route53HostedZoneId', {\n\t\t\tvalue: this.hostedZone.hostedZoneId,\n\t\t});\n\t}\n}\n"]}
@@ -0,0 +1,95 @@
1
+ import { Construct } from 'constructs';
2
+ import { IHostedZone, HostedZoneProps, HostedZoneAttributes, HostedZoneProviderProps, ARecordProps, AaaaRecordProps, CnameRecordProps, TxtRecordProps } from 'aws-cdk-lib/aws-route53';
3
+ import { IBaseCdkConstructProps } from '../../aws-types.cjs';
4
+ import '@incloodsolutions/toolkit';
5
+ import 'aws-cdk-lib';
6
+
7
+ /**
8
+ * Props for BaseRoute53Construct
9
+ *
10
+ * Exactly one of `hostedZoneOptions`, `fromExistingHostedZoneAttributes`, or
11
+ * `fromLookupOptions` must be provided to obtain the hosted zone — a hosted
12
+ * zone is the container Route53 uses to hold every DNS record for one domain.
13
+ * Records are then added to that zone via `aRecords` / `aaaaRecords` /
14
+ * `cnameRecords` / `txtRecords`.
15
+ */
16
+ interface IRoute53ConstructProps extends Omit<IBaseCdkConstructProps<{
17
+ /**
18
+ * Create a brand-new public hosted zone for `zoneName`. Use this when
19
+ * Route53 has not yet been given authority over the domain — CDK also
20
+ * prints the four NS records you must set as the domain's nameservers at
21
+ * the registrar to actually delegate DNS to this zone.
22
+ */
23
+ readonly hostedZoneOptions?: HostedZoneProps;
24
+ /**
25
+ * Reference an existing hosted zone by its ID and zone name, without
26
+ * creating a new one. Cheapest and most predictable option — no synth-time
27
+ * AWS API call, no risk of creating a duplicate zone — but you must already
28
+ * know the hosted zone ID (from the console, another stack's output, etc.).
29
+ */
30
+ readonly fromExistingHostedZoneAttributes?: HostedZoneAttributes;
31
+ /**
32
+ * Resolve an existing public hosted zone by domain name via an AWS API
33
+ * call made while CDK synthesises the stack (not at deploy time). Convenient
34
+ * when you only know the domain name, but requires AWS credentials at synth
35
+ * and re-runs that lookup (and may cache stale results) on every synth.
36
+ */
37
+ readonly fromLookupOptions?: HostedZoneProviderProps;
38
+ /**
39
+ * `A` records — map this zone (or a subdomain) to one or more IPv4
40
+ * addresses, or, via `target: RecordTarget.fromAlias(...)`, "alias" the
41
+ * record directly to an AWS resource (CloudFront, API Gateway custom
42
+ * domain, ALB, another Route53 record, …). Alias `A` records are free,
43
+ * auto-update if the target's IP changes, and — unlike `CNAME` — are the
44
+ * only way to point the zone apex (`example.com` itself, not a subdomain)
45
+ * at an AWS resource. Use this for "point my (sub)domain at this AWS
46
+ * service" or "point it at a fixed IPv4 address".
47
+ */
48
+ readonly aRecords?: Omit<ARecordProps, 'zone'>[];
49
+ /**
50
+ * `AAAA` records — the IPv6 counterpart to `A` records: map this zone or a
51
+ * subdomain to IPv6 addresses, or alias to an AWS resource, the same way
52
+ * `aRecords` does for IPv4. Add these alongside `aRecords` (not instead of)
53
+ * when the target also needs to be reachable over IPv6.
54
+ */
55
+ readonly aaaaRecords?: Omit<AaaaRecordProps, 'zone'>[];
56
+ /**
57
+ * `CNAME` records — alias a subdomain to another DNS name (not an IP
58
+ * address), e.g. `www.example.com` → `example.com`, or a subdomain to a
59
+ * third-party service's domain (a SaaS custom-domain setup). DNS rules
60
+ * forbid a `CNAME` at the zone apex and forbid mixing it with any other
61
+ * record type on the same name — use an alias `A`/`AAAA` record instead
62
+ * for the apex or for AWS-resource targets.
63
+ */
64
+ readonly cnameRecords?: Omit<CnameRecordProps, 'zone'>[];
65
+ /**
66
+ * `TXT` records — arbitrary text attached to a name, not used for routing
67
+ * traffic at all. The standard way to prove domain ownership (ACM
68
+ * certificate DNS validation, Google/Microsoft/other SaaS site
69
+ * verification) and to publish email-authentication policy (SPF, DKIM,
70
+ * DMARC). Each string in `values` becomes one quoted TXT value.
71
+ */
72
+ readonly txtRecords?: Omit<TxtRecordProps, 'zone'>[];
73
+ }>, 'appName' | 'stackName'> {
74
+ }
75
+ /**
76
+ * CDK construct for Route53
77
+ *
78
+ * Responsibilities:
79
+ * - Creates a new public hosted zone, imports one by attributes, or looks one
80
+ * up by domain name (exactly one of the three is required)
81
+ * - Optionally attaches `A`, `AAAA`, `CNAME`, and `TXT` records to that zone
82
+ * - Exposes the hosted zone as `.hostedZone` and its ID as a CloudFormation output
83
+ */
84
+ declare class BaseRoute53Construct extends Construct {
85
+ /** The hosted zone this construct created, imported, or looked up */
86
+ readonly hostedZone: IHostedZone;
87
+ /**
88
+ * @param scope Parent construct
89
+ * @param id Unique construct identifier
90
+ * @param props Configuration for the hosted zone and its records
91
+ */
92
+ constructor(scope: Construct, id: string, props: IRoute53ConstructProps);
93
+ }
94
+
95
+ export { BaseRoute53Construct };
@@ -0,0 +1,95 @@
1
+ import { Construct } from 'constructs';
2
+ import { IHostedZone, HostedZoneProps, HostedZoneAttributes, HostedZoneProviderProps, ARecordProps, AaaaRecordProps, CnameRecordProps, TxtRecordProps } from 'aws-cdk-lib/aws-route53';
3
+ import { IBaseCdkConstructProps } from '../../aws-types.js';
4
+ import '@incloodsolutions/toolkit';
5
+ import 'aws-cdk-lib';
6
+
7
+ /**
8
+ * Props for BaseRoute53Construct
9
+ *
10
+ * Exactly one of `hostedZoneOptions`, `fromExistingHostedZoneAttributes`, or
11
+ * `fromLookupOptions` must be provided to obtain the hosted zone — a hosted
12
+ * zone is the container Route53 uses to hold every DNS record for one domain.
13
+ * Records are then added to that zone via `aRecords` / `aaaaRecords` /
14
+ * `cnameRecords` / `txtRecords`.
15
+ */
16
+ interface IRoute53ConstructProps extends Omit<IBaseCdkConstructProps<{
17
+ /**
18
+ * Create a brand-new public hosted zone for `zoneName`. Use this when
19
+ * Route53 has not yet been given authority over the domain — CDK also
20
+ * prints the four NS records you must set as the domain's nameservers at
21
+ * the registrar to actually delegate DNS to this zone.
22
+ */
23
+ readonly hostedZoneOptions?: HostedZoneProps;
24
+ /**
25
+ * Reference an existing hosted zone by its ID and zone name, without
26
+ * creating a new one. Cheapest and most predictable option — no synth-time
27
+ * AWS API call, no risk of creating a duplicate zone — but you must already
28
+ * know the hosted zone ID (from the console, another stack's output, etc.).
29
+ */
30
+ readonly fromExistingHostedZoneAttributes?: HostedZoneAttributes;
31
+ /**
32
+ * Resolve an existing public hosted zone by domain name via an AWS API
33
+ * call made while CDK synthesises the stack (not at deploy time). Convenient
34
+ * when you only know the domain name, but requires AWS credentials at synth
35
+ * and re-runs that lookup (and may cache stale results) on every synth.
36
+ */
37
+ readonly fromLookupOptions?: HostedZoneProviderProps;
38
+ /**
39
+ * `A` records — map this zone (or a subdomain) to one or more IPv4
40
+ * addresses, or, via `target: RecordTarget.fromAlias(...)`, "alias" the
41
+ * record directly to an AWS resource (CloudFront, API Gateway custom
42
+ * domain, ALB, another Route53 record, …). Alias `A` records are free,
43
+ * auto-update if the target's IP changes, and — unlike `CNAME` — are the
44
+ * only way to point the zone apex (`example.com` itself, not a subdomain)
45
+ * at an AWS resource. Use this for "point my (sub)domain at this AWS
46
+ * service" or "point it at a fixed IPv4 address".
47
+ */
48
+ readonly aRecords?: Omit<ARecordProps, 'zone'>[];
49
+ /**
50
+ * `AAAA` records — the IPv6 counterpart to `A` records: map this zone or a
51
+ * subdomain to IPv6 addresses, or alias to an AWS resource, the same way
52
+ * `aRecords` does for IPv4. Add these alongside `aRecords` (not instead of)
53
+ * when the target also needs to be reachable over IPv6.
54
+ */
55
+ readonly aaaaRecords?: Omit<AaaaRecordProps, 'zone'>[];
56
+ /**
57
+ * `CNAME` records — alias a subdomain to another DNS name (not an IP
58
+ * address), e.g. `www.example.com` → `example.com`, or a subdomain to a
59
+ * third-party service's domain (a SaaS custom-domain setup). DNS rules
60
+ * forbid a `CNAME` at the zone apex and forbid mixing it with any other
61
+ * record type on the same name — use an alias `A`/`AAAA` record instead
62
+ * for the apex or for AWS-resource targets.
63
+ */
64
+ readonly cnameRecords?: Omit<CnameRecordProps, 'zone'>[];
65
+ /**
66
+ * `TXT` records — arbitrary text attached to a name, not used for routing
67
+ * traffic at all. The standard way to prove domain ownership (ACM
68
+ * certificate DNS validation, Google/Microsoft/other SaaS site
69
+ * verification) and to publish email-authentication policy (SPF, DKIM,
70
+ * DMARC). Each string in `values` becomes one quoted TXT value.
71
+ */
72
+ readonly txtRecords?: Omit<TxtRecordProps, 'zone'>[];
73
+ }>, 'appName' | 'stackName'> {
74
+ }
75
+ /**
76
+ * CDK construct for Route53
77
+ *
78
+ * Responsibilities:
79
+ * - Creates a new public hosted zone, imports one by attributes, or looks one
80
+ * up by domain name (exactly one of the three is required)
81
+ * - Optionally attaches `A`, `AAAA`, `CNAME`, and `TXT` records to that zone
82
+ * - Exposes the hosted zone as `.hostedZone` and its ID as a CloudFormation output
83
+ */
84
+ declare class BaseRoute53Construct extends Construct {
85
+ /** The hosted zone this construct created, imported, or looked up */
86
+ readonly hostedZone: IHostedZone;
87
+ /**
88
+ * @param scope Parent construct
89
+ * @param id Unique construct identifier
90
+ * @param props Configuration for the hosted zone and its records
91
+ */
92
+ constructor(scope: Construct, id: string, props: IRoute53ConstructProps);
93
+ }
94
+
95
+ export { BaseRoute53Construct };
@@ -0,0 +1,77 @@
1
+ import { Construct } from 'constructs';
2
+ import { CfnOutput } from 'aws-cdk-lib';
3
+ import { HostedZone, ARecord, AaaaRecord, CnameRecord, TxtRecord } from 'aws-cdk-lib/aws-route53';
4
+ import { CustomException } from '@incloodsolutions/toolkit';
5
+
6
+ var __defProp = Object.defineProperty;
7
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
8
+ var BaseRoute53Construct = class extends Construct {
9
+ static {
10
+ __name(this, "BaseRoute53Construct");
11
+ }
12
+ /** The hosted zone this construct created, imported, or looked up */
13
+ hostedZone;
14
+ /**
15
+ * @param scope Parent construct
16
+ * @param id Unique construct identifier
17
+ * @param props Configuration for the hosted zone and its records
18
+ */
19
+ constructor(scope, id, props) {
20
+ super(scope, id);
21
+ const options = props?.options ?? {};
22
+ if (options.hostedZoneOptions) {
23
+ this.hostedZone = new HostedZone(
24
+ this,
25
+ `${id}-HostedZone`,
26
+ options.hostedZoneOptions
27
+ );
28
+ } else if (options.fromExistingHostedZoneAttributes) {
29
+ this.hostedZone = HostedZone.fromHostedZoneAttributes(
30
+ this,
31
+ `${id}-HostedZone`,
32
+ options.fromExistingHostedZoneAttributes
33
+ );
34
+ } else if (options.fromLookupOptions) {
35
+ this.hostedZone = HostedZone.fromLookup(
36
+ this,
37
+ `${id}-HostedZone`,
38
+ options.fromLookupOptions
39
+ );
40
+ } else {
41
+ throw new CustomException(
42
+ "BaseRoute53Construct requires one of hostedZoneOptions, fromExistingHostedZoneAttributes, or fromLookupOptions"
43
+ );
44
+ }
45
+ options.aRecords?.forEach((record, index) => {
46
+ new ARecord(this, `${id}-ARecord-${index}`, {
47
+ ...record,
48
+ zone: this.hostedZone
49
+ });
50
+ });
51
+ options.aaaaRecords?.forEach((record, index) => {
52
+ new AaaaRecord(this, `${id}-AaaaRecord-${index}`, {
53
+ ...record,
54
+ zone: this.hostedZone
55
+ });
56
+ });
57
+ options.cnameRecords?.forEach((record, index) => {
58
+ new CnameRecord(this, `${id}-CnameRecord-${index}`, {
59
+ ...record,
60
+ zone: this.hostedZone
61
+ });
62
+ });
63
+ options.txtRecords?.forEach((record, index) => {
64
+ new TxtRecord(this, `${id}-TxtRecord-${index}`, {
65
+ ...record,
66
+ zone: this.hostedZone
67
+ });
68
+ });
69
+ new CfnOutput(this, "Route53HostedZoneId", {
70
+ value: this.hostedZone.hostedZoneId
71
+ });
72
+ }
73
+ };
74
+
75
+ export { BaseRoute53Construct };
76
+ //# source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EAAM,CAAA,EAAG,EAAE,CAAA,SAAA,EAAY,KAAK,CAAA,CAAA,EAAI;AAAA,QAC3C,GAAG,MAAA;AAAA,QACH,MAAM,IAAA,CAAK;AAAA,OACX,CAAA;AAAA,IACF,CAAC,CAAA;AAED,IAAA,OAAA,CAAQ,WAAA,EAAa,OAAA,CAAQ,CAAC,MAAA,EAAQ,KAAA,KAAU;AAC/C,MAAA,IAAI,WAAW,IAAA,EAAM,CAAA,EAAG,EAAE,CAAA,YAAA,EAAe,KAAK,CAAA,CAAA,EAAI;AAAA,QACjD,GAAG,MAAA;AAAA,QACH,MAAM,IAAA,CAAK;AAAA,OACX,CAAA;AAAA,IACF,CAAC,CAAA;AAED,IAAA,OAAA,CAAQ,YAAA,EAAc,OAAA,CAAQ,CAAC,MAAA,EAAQ,KAAA,KAAU;AAChD,MAAA,IAAI,YAAY,IAAA,EAAM,CAAA,EAAG,EAAE,CAAA,aAAA,EAAgB,KAAK,CAAA,CAAA,EAAI;AAAA,QACnD,GAAG,MAAA;AAAA,QACH,MAAM,IAAA,CAAK;AAAA,OACX,CAAA;AAAA,IACF,CAAC,CAAA;AAED,IAAA,OAAA,CAAQ,UAAA,EAAY,OAAA,CAAQ,CAAC,MAAA,EAAQ,KAAA,KAAU;AAC9C,MAAA,IAAI,UAAU,IAAA,EAAM,CAAA,EAAG,EAAE,CAAA,WAAA,EAAc,KAAK,CAAA,CAAA,EAAI;AAAA,QAC/C,GAAG,MAAA;AAAA,QACH,MAAM,IAAA,CAAK;AAAA,OACX,CAAA;AAAA,IACF,CAAC,CAAA;AAKD,IAAA,IAAI,SAAA,CAAU,MAAM,qBAAA,EAAuB;AAAA,MAC1C,KAAA,EAAO,KAAK,UAAA,CAAW;AAAA,KACvB,CAAA;AAAA,EACF;AACD","file":"route53.js","sourcesContent":["import { Construct } from 'constructs';\nimport { CfnOutput } from 'aws-cdk-lib';\nimport {\n\tARecord,\n\tARecordProps,\n\tAaaaRecord,\n\tAaaaRecordProps,\n\tCnameRecord,\n\tCnameRecordProps,\n\tHostedZone,\n\tHostedZoneAttributes,\n\tHostedZoneProps,\n\tHostedZoneProviderProps,\n\tIHostedZone,\n\tTxtRecord,\n\tTxtRecordProps,\n} from 'aws-cdk-lib/aws-route53';\n\nimport { CustomException } from '@incloodsolutions/toolkit';\n\nimport { IBaseCdkConstructProps } from '../../types';\n\n/**\n * Props for BaseRoute53Construct\n *\n * Exactly one of `hostedZoneOptions`, `fromExistingHostedZoneAttributes`, or\n * `fromLookupOptions` must be provided to obtain the hosted zone — a hosted\n * zone is the container Route53 uses to hold every DNS record for one domain.\n * Records are then added to that zone via `aRecords` / `aaaaRecords` /\n * `cnameRecords` / `txtRecords`.\n */\ninterface IRoute53ConstructProps extends Omit<\n\tIBaseCdkConstructProps<{\n\t\t/**\n\t\t * Create a brand-new public hosted zone for `zoneName`. Use this when\n\t\t * Route53 has not yet been given authority over the domain — CDK also\n\t\t * prints the four NS records you must set as the domain's nameservers at\n\t\t * the registrar to actually delegate DNS to this zone.\n\t\t */\n\t\treadonly hostedZoneOptions?: HostedZoneProps;\n\n\t\t/**\n\t\t * Reference an existing hosted zone by its ID and zone name, without\n\t\t * creating a new one. Cheapest and most predictable option — no synth-time\n\t\t * AWS API call, no risk of creating a duplicate zone — but you must already\n\t\t * know the hosted zone ID (from the console, another stack's output, etc.).\n\t\t */\n\t\treadonly fromExistingHostedZoneAttributes?: HostedZoneAttributes;\n\n\t\t/**\n\t\t * Resolve an existing public hosted zone by domain name via an AWS API\n\t\t * call made while CDK synthesises the stack (not at deploy time). Convenient\n\t\t * when you only know the domain name, but requires AWS credentials at synth\n\t\t * and re-runs that lookup (and may cache stale results) on every synth.\n\t\t */\n\t\treadonly fromLookupOptions?: HostedZoneProviderProps;\n\n\t\t/**\n\t\t * `A` records — map this zone (or a subdomain) to one or more IPv4\n\t\t * addresses, or, via `target: RecordTarget.fromAlias(...)`, \"alias\" the\n\t\t * record directly to an AWS resource (CloudFront, API Gateway custom\n\t\t * domain, ALB, another Route53 record, …). Alias `A` records are free,\n\t\t * auto-update if the target's IP changes, and — unlike `CNAME` — are the\n\t\t * only way to point the zone apex (`example.com` itself, not a subdomain)\n\t\t * at an AWS resource. Use this for \"point my (sub)domain at this AWS\n\t\t * service\" or \"point it at a fixed IPv4 address\".\n\t\t */\n\t\treadonly aRecords?: Omit<ARecordProps, 'zone'>[];\n\n\t\t/**\n\t\t * `AAAA` records — the IPv6 counterpart to `A` records: map this zone or a\n\t\t * subdomain to IPv6 addresses, or alias to an AWS resource, the same way\n\t\t * `aRecords` does for IPv4. Add these alongside `aRecords` (not instead of)\n\t\t * when the target also needs to be reachable over IPv6.\n\t\t */\n\t\treadonly aaaaRecords?: Omit<AaaaRecordProps, 'zone'>[];\n\n\t\t/**\n\t\t * `CNAME` records — alias a subdomain to another DNS name (not an IP\n\t\t * address), e.g. `www.example.com` → `example.com`, or a subdomain to a\n\t\t * third-party service's domain (a SaaS custom-domain setup). DNS rules\n\t\t * forbid a `CNAME` at the zone apex and forbid mixing it with any other\n\t\t * record type on the same name — use an alias `A`/`AAAA` record instead\n\t\t * for the apex or for AWS-resource targets.\n\t\t */\n\t\treadonly cnameRecords?: Omit<CnameRecordProps, 'zone'>[];\n\n\t\t/**\n\t\t * `TXT` records — arbitrary text attached to a name, not used for routing\n\t\t * traffic at all. The standard way to prove domain ownership (ACM\n\t\t * certificate DNS validation, Google/Microsoft/other SaaS site\n\t\t * verification) and to publish email-authentication policy (SPF, DKIM,\n\t\t * DMARC). Each string in `values` becomes one quoted TXT value.\n\t\t */\n\t\treadonly txtRecords?: Omit<TxtRecordProps, 'zone'>[];\n\t}>,\n\t'appName' | 'stackName'\n> {}\n\n/**\n * CDK construct for Route53\n *\n * Responsibilities:\n * - Creates a new public hosted zone, imports one by attributes, or looks one\n * up by domain name (exactly one of the three is required)\n * - Optionally attaches `A`, `AAAA`, `CNAME`, and `TXT` records to that zone\n * - Exposes the hosted zone as `.hostedZone` and its ID as a CloudFormation output\n */\nexport class BaseRoute53Construct extends Construct {\n\t/** The hosted zone this construct created, imported, or looked up */\n\treadonly hostedZone: IHostedZone;\n\n\t/**\n\t * @param scope Parent construct\n\t * @param id Unique construct identifier\n\t * @param props Configuration for the hosted zone and its records\n\t */\n\tconstructor(scope: Construct, id: string, props: IRoute53ConstructProps) {\n\t\tsuper(scope, id);\n\n\t\tconst options = props?.options ?? {};\n\n\t\tif (options.hostedZoneOptions) {\n\t\t\tthis.hostedZone = new HostedZone(\n\t\t\t\tthis,\n\t\t\t\t`${id}-HostedZone`,\n\t\t\t\toptions.hostedZoneOptions,\n\t\t\t);\n\t\t} else if (options.fromExistingHostedZoneAttributes) {\n\t\t\tthis.hostedZone = HostedZone.fromHostedZoneAttributes(\n\t\t\t\tthis,\n\t\t\t\t`${id}-HostedZone`,\n\t\t\t\toptions.fromExistingHostedZoneAttributes,\n\t\t\t);\n\t\t} else if (options.fromLookupOptions) {\n\t\t\tthis.hostedZone = HostedZone.fromLookup(\n\t\t\t\tthis,\n\t\t\t\t`${id}-HostedZone`,\n\t\t\t\toptions.fromLookupOptions,\n\t\t\t);\n\t\t} else {\n\t\t\tthrow new CustomException(\n\t\t\t\t'BaseRoute53Construct requires one of hostedZoneOptions, fromExistingHostedZoneAttributes, or fromLookupOptions',\n\t\t\t);\n\t\t}\n\n\t\toptions.aRecords?.forEach((record, index) => {\n\t\t\tnew ARecord(this, `${id}-ARecord-${index}`, {\n\t\t\t\t...record,\n\t\t\t\tzone: this.hostedZone,\n\t\t\t});\n\t\t});\n\n\t\toptions.aaaaRecords?.forEach((record, index) => {\n\t\t\tnew AaaaRecord(this, `${id}-AaaaRecord-${index}`, {\n\t\t\t\t...record,\n\t\t\t\tzone: this.hostedZone,\n\t\t\t});\n\t\t});\n\n\t\toptions.cnameRecords?.forEach((record, index) => {\n\t\t\tnew CnameRecord(this, `${id}-CnameRecord-${index}`, {\n\t\t\t\t...record,\n\t\t\t\tzone: this.hostedZone,\n\t\t\t});\n\t\t});\n\n\t\toptions.txtRecords?.forEach((record, index) => {\n\t\t\tnew TxtRecord(this, `${id}-TxtRecord-${index}`, {\n\t\t\t\t...record,\n\t\t\t\tzone: this.hostedZone,\n\t\t\t});\n\t\t});\n\n\t\t/**\n\t\t * CloudFormation output exposing the Route53 hosted zone ID\n\t\t */\n\t\tnew CfnOutput(this, 'Route53HostedZoneId', {\n\t\t\tvalue: this.hostedZone.hostedZoneId,\n\t\t});\n\t}\n}\n"]}
@@ -112,10 +112,14 @@ var BaseS3DeploymentConstruct = class extends constructs.Construct {
112
112
  constructor(scope, id, props) {
113
113
  super(scope, id);
114
114
  if (!props.options?.cloudfrontOptions?.defaultBehavior?.origin && !props?.withS3Bucket && props.withCloudfront) {
115
- throw new toolkit.CustomException("Cloudfront distribution S3_Bucket origins must be defined!");
115
+ throw new toolkit.CustomException(
116
+ "Cloudfront distribution S3_Bucket origins must be defined!"
117
+ );
116
118
  }
117
119
  if (!props.options?.bucketDeploymentOptions?.destinationBucket && !props?.withS3Bucket) {
118
- throw new toolkit.CustomException("Deployment S3_Bucket destination must be defined!");
120
+ throw new toolkit.CustomException(
121
+ "Deployment S3_Bucket destination must be defined!"
122
+ );
119
123
  }
120
124
  if (props?.withS3Bucket) {
121
125
  this.bucket = new BaseS3Construct(this, "bucket", {
@@ -133,13 +137,18 @@ var BaseS3DeploymentConstruct = class extends constructs.Construct {
133
137
  /**
134
138
  * Map additional behaviors and ensure origin is assigned
135
139
  */
136
- additionalBehaviors: Object.entries(props.options?.cloudfrontOptions?.additionalBehaviors || {}).reduce((behavior, [pattern, behaviorOptions]) => {
137
- behavior[pattern] = {
138
- ...behaviorOptions,
139
- origin: behaviorOptions.origin || s3Origin
140
- };
141
- return behavior;
142
- }, {}),
140
+ additionalBehaviors: Object.entries(
141
+ props.options?.cloudfrontOptions?.additionalBehaviors || {}
142
+ ).reduce(
143
+ (behavior, [pattern, behaviorOptions]) => {
144
+ behavior[pattern] = {
145
+ ...behaviorOptions,
146
+ origin: behaviorOptions.origin || s3Origin
147
+ };
148
+ return behavior;
149
+ },
150
+ {}
151
+ ),
143
152
  /**
144
153
  * Default behavior configuration
145
154
  */
@@ -164,5 +173,5 @@ var BaseS3DeploymentConstruct = class extends constructs.Construct {
164
173
  };
165
174
 
166
175
  exports.BaseS3DeploymentConstruct = BaseS3DeploymentConstruct;
167
- //# sourceMappingURL=s3-deployment-construct.cjs.map
168
- //# sourceMappingURL=s3-deployment-construct.cjs.map
176
+ //# sourceMappingURL=s3-deployment.cjs.map
177
+ //# sourceMappingURL=s3-deployment.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/aws/cdk/constructs/s3-construct.ts","../../../src/aws/cdk/constructs/cloudfront-construct.ts","../../../src/aws/cdk/constructs/s3-deployment-construct.ts"],"names":["Construct","Bucket","RemovalPolicy","CfnOutput","Distribution","ViewerProtocolPolicy","Duration","CustomException","S3BucketOrigin","BucketDeployment"],"mappings":";;;;;;;;;;;;AA4BO,IAAM,eAAA,GAAN,cAA8BA,oBAAA,CAAU;AAAA,EA5B/C;AA4B+C,IAAA,MAAA,CAAA,IAAA,EAAA,iBAAA,CAAA;AAAA;AAAA;AAAA,EAErC,MAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOT,WAAA,CACC,KAAA,EACA,EAAA,EACA,KAAA,EACC;AACD,IAAA,KAAA,CAAM,OAAO,EAAE,CAAA;AAEf,IAAA,IAAA,CAAK,MAAA,GAAS,IAAIC,YAAA,CAAO,IAAA,EAAM,EAAA,EAAI;AAAA,MAClC,GAAG,MAAM,OAAA,EAAS,aAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAMlB,aAAA,EACC,KAAA,CAAM,OAAA,EAAS,aAAA,EAAe,iBAAiBC,uBAAA,CAAc;AAAA,KAC9D,CAAA;AAKD,IAAA,IAAIC,mBAAA,CAAU,MAAM,aAAA,EAAe;AAAA,MAClC,KAAA,EAAO,KAAK,MAAA,CAAO;AAAA,KACnB,CAAA;AAAA,EACF;AACD,CAAA;AC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ployment.cjs","sourcesContent":["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<\n\tIBaseCdkConstructProps<{\n\t\t/** Configuration options for the S3 bucket */\n\t\treadonly bucketOptions?: BucketProps;\n\t}>,\n\t'appName' | 'stackName'\n> {}\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(\n\t\tscope: Construct,\n\t\tid: string,\n\t\tprops: IS3DeploymentConstructProps,\n\t) {\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 || 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}\n","import { Construct } from 'constructs';\nimport { Duration } from 'aws-cdk-lib';\nimport {\n\tDistribution,\n\tDistributionProps,\n\tViewerProtocolPolicy,\n} 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<\n\tIBaseCdkConstructProps<{\n\t\t/** Partial configuration for the CloudFront distribution */\n\t\treadonly cloudfrontOptions: Partial<DistributionProps>;\n\t}>,\n\t'appName' | 'stage' | 'stackName'\n> {}\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\n\t\t\t\t\t\t?.viewerProtocolPolicy || 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}\n","import { Construct } from 'constructs';\nimport { Bucket, BucketProps } from 'aws-cdk-lib/aws-s3';\nimport { S3BucketOrigin } from 'aws-cdk-lib/aws-cloudfront-origins';\nimport {\n\tBucketDeployment,\n\tBucketDeploymentProps,\n} from 'aws-cdk-lib/aws-s3-deployment';\nimport {\n\tBehaviorOptions,\n\tDistribution,\n\tDistributionProps,\n} 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<\n\tIBaseCdkConstructProps<{\n\t\t/** Configuration options for S3 bucket */\n\t\treadonly bucketOptions?: BucketProps;\n\n\t\t/**\n\t\t * Configuration options for CloudFront distribution\n\t\t *\n\t\t * Note:\n\t\t * - `additionalBehaviors` supports dynamic route mappings\n\t\t * - Origins are automatically resolved if not provided\n\t\t */\n\t\treadonly cloudfrontOptions?: Partial<\n\t\t\tOmit<DistributionProps, 'additionalBehaviors'>\n\t\t> & {\n\t\t\treadonly additionalBehaviors?: ObjectType<\n\t\t\t\tPartial<BehaviorOptions>,\n\t\t\t\tstring\n\t\t\t>;\n\t\t};\n\n\t\t/**\n\t\t * Configuration for S3 bucket deployment\n\t\t *\n\t\t * Note:\n\t\t * - `sources` is required\n\t\t * - `destinationBucket` can be auto-resolved\n\t\t */\n\t\treadonly bucketDeploymentOptions: Omit<\n\t\t\tPartial<BucketDeploymentProps>,\n\t\t\t'sources'\n\t\t> &\n\t\t\tPick<BucketDeploymentProps, 'sources'>;\n\t}>,\n\t'appName' | 'stackName'\n> {\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(\n\t\tscope: Construct,\n\t\tid: string,\n\t\tprops: IS3DeploymentConstructProps,\n\t) {\n\t\tsuper(scope, id);\n\n\t\t/**\n\t\t * Validate CloudFront origin requirements\n\t\t */\n\t\tif (\n\t\t\t!props.options?.cloudfrontOptions?.defaultBehavior?.origin &&\n\t\t\t!props?.withS3Bucket &&\n\t\t\tprops.withCloudfront\n\t\t) {\n\t\t\tthrow new CustomException(\n\t\t\t\t'Cloudfront distribution S3_Bucket origins must be defined!',\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Validate deployment destination requirements\n\t\t */\n\t\tif (\n\t\t\t!props.options?.bucketDeploymentOptions?.destinationBucket &&\n\t\t\t!props?.withS3Bucket\n\t\t) {\n\t\t\tthrow new CustomException(\n\t\t\t\t'Deployment S3_Bucket destination must be defined!',\n\t\t\t);\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\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\tS3BucketOrigin.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(\n\t\t\t\t\t\t\tprops.options?.cloudfrontOptions?.additionalBehaviors || {},\n\t\t\t\t\t\t).reduce(\n\t\t\t\t\t\t\t(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},\n\t\t\t\t\t\t\t{} as typeof props.options.cloudfrontOptions.additionalBehaviors,\n\t\t\t\t\t\t) 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\tthis.distribution,\n\n\t\t\t/** Paths to invalidate after deployment */\n\t\t\tdistributionPaths: props.options?.bucketDeploymentOptions\n\t\t\t\t?.distributionPaths || ['/*'],\n\n\t\t\t/** Destination S3 bucket */\n\t\t\tdestinationBucket:\n\t\t\t\tprops.options?.bucketDeploymentOptions?.destinationBucket ||\n\t\t\t\tthis.bucket,\n\t\t} as BucketDeploymentProps);\n\t}\n}\n"]}
@@ -3,7 +3,8 @@ import { Bucket, BucketProps } from 'aws-cdk-lib/aws-s3';
3
3
  import { BucketDeployment, BucketDeploymentProps } from 'aws-cdk-lib/aws-s3-deployment';
4
4
  import { Distribution, DistributionProps, BehaviorOptions } from 'aws-cdk-lib/aws-cloudfront';
5
5
  import { ObjectType } from '@incloodsolutions/toolkit';
6
- import { IBaseCdkConstructProps } from '../../types/index.js';
6
+ import { IBaseCdkConstructProps } from '../../aws-types.cjs';
7
+ import 'aws-cdk-lib';
7
8
 
8
9
  /**
9
10
  * Props for BaseS3DeploymentConstruct
@@ -3,7 +3,8 @@ import { Bucket, BucketProps } from 'aws-cdk-lib/aws-s3';
3
3
  import { BucketDeployment, BucketDeploymentProps } from 'aws-cdk-lib/aws-s3-deployment';
4
4
  import { Distribution, DistributionProps, BehaviorOptions } from 'aws-cdk-lib/aws-cloudfront';
5
5
  import { ObjectType } from '@incloodsolutions/toolkit';
6
- import { IBaseCdkConstructProps } from '../../types/index.cjs';
6
+ import { IBaseCdkConstructProps } from '../../aws-types.js';
7
+ import 'aws-cdk-lib';
7
8
 
8
9
  /**
9
10
  * Props for BaseS3DeploymentConstruct
@@ -110,10 +110,14 @@ var BaseS3DeploymentConstruct = class extends Construct {
110
110
  constructor(scope, id, props) {
111
111
  super(scope, id);
112
112
  if (!props.options?.cloudfrontOptions?.defaultBehavior?.origin && !props?.withS3Bucket && props.withCloudfront) {
113
- throw new CustomException("Cloudfront distribution S3_Bucket origins must be defined!");
113
+ throw new CustomException(
114
+ "Cloudfront distribution S3_Bucket origins must be defined!"
115
+ );
114
116
  }
115
117
  if (!props.options?.bucketDeploymentOptions?.destinationBucket && !props?.withS3Bucket) {
116
- throw new CustomException("Deployment S3_Bucket destination must be defined!");
118
+ throw new CustomException(
119
+ "Deployment S3_Bucket destination must be defined!"
120
+ );
117
121
  }
118
122
  if (props?.withS3Bucket) {
119
123
  this.bucket = new BaseS3Construct(this, "bucket", {
@@ -131,13 +135,18 @@ var BaseS3DeploymentConstruct = class extends Construct {
131
135
  /**
132
136
  * Map additional behaviors and ensure origin is assigned
133
137
  */
134
- additionalBehaviors: Object.entries(props.options?.cloudfrontOptions?.additionalBehaviors || {}).reduce((behavior, [pattern, behaviorOptions]) => {
135
- behavior[pattern] = {
136
- ...behaviorOptions,
137
- origin: behaviorOptions.origin || s3Origin
138
- };
139
- return behavior;
140
- }, {}),
138
+ additionalBehaviors: Object.entries(
139
+ props.options?.cloudfrontOptions?.additionalBehaviors || {}
140
+ ).reduce(
141
+ (behavior, [pattern, behaviorOptions]) => {
142
+ behavior[pattern] = {
143
+ ...behaviorOptions,
144
+ origin: behaviorOptions.origin || s3Origin
145
+ };
146
+ return behavior;
147
+ },
148
+ {}
149
+ ),
141
150
  /**
142
151
  * Default behavior configuration
143
152
  */
@@ -162,5 +171,5 @@ var BaseS3DeploymentConstruct = class extends Construct {
162
171
  };
163
172
 
164
173
  export { BaseS3DeploymentConstruct };
165
- //# sourceMappingURL=s3-deployment-construct.js.map
166
- //# sourceMappingURL=s3-deployment-construct.js.map
174
+ //# sourceMappingURL=s3-deployment.js.map
175
+ //# sourceMappingURL=s3-deployment.js.map