@intentius/chant-lexicon-aws 0.7.0 → 0.8.1

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 (224) hide show
  1. package/dist/actions/dynamodb.d.ts +11 -0
  2. package/dist/actions/dynamodb.d.ts.map +1 -0
  3. package/dist/actions/ecr.d.ts +5 -0
  4. package/dist/actions/ecr.d.ts.map +1 -0
  5. package/dist/actions/ecs.d.ts +6 -0
  6. package/dist/actions/ecs.d.ts.map +1 -0
  7. package/dist/actions/iam.d.ts +4 -0
  8. package/dist/actions/iam.d.ts.map +1 -0
  9. package/dist/actions/index.d.ts +10 -0
  10. package/dist/actions/index.d.ts.map +1 -0
  11. package/dist/actions/lambda.d.ts +6 -0
  12. package/dist/actions/lambda.d.ts.map +1 -0
  13. package/dist/actions/logs.d.ts +5 -0
  14. package/dist/actions/logs.d.ts.map +1 -0
  15. package/dist/actions/s3.d.ts +11 -0
  16. package/dist/actions/s3.d.ts.map +1 -0
  17. package/dist/actions/sns.d.ts +6 -0
  18. package/dist/actions/sns.d.ts.map +1 -0
  19. package/dist/actions/sqs.d.ts +6 -0
  20. package/dist/actions/sqs.d.ts.map +1 -0
  21. package/dist/codegen/docs-cli.d.ts +2 -0
  22. package/dist/codegen/docs-cli.d.ts.map +1 -0
  23. package/dist/codegen/docs.d.ts +15 -0
  24. package/dist/codegen/docs.d.ts.map +1 -0
  25. package/dist/codegen/extensions.d.ts +25 -0
  26. package/dist/codegen/extensions.d.ts.map +1 -0
  27. package/dist/codegen/fallback.d.ts +8 -0
  28. package/dist/codegen/fallback.d.ts.map +1 -0
  29. package/dist/codegen/generate-cli.d.ts +3 -0
  30. package/dist/codegen/generate-cli.d.ts.map +1 -0
  31. package/dist/codegen/generate-lexicon.d.ts +38 -0
  32. package/dist/codegen/generate-lexicon.d.ts.map +1 -0
  33. package/dist/codegen/generate-typescript.d.ts +16 -0
  34. package/dist/codegen/generate-typescript.d.ts.map +1 -0
  35. package/dist/codegen/generate.d.ts +15 -0
  36. package/dist/codegen/generate.d.ts.map +1 -0
  37. package/dist/codegen/naming.d.ts +16 -0
  38. package/dist/codegen/naming.d.ts.map +1 -0
  39. package/dist/codegen/package.d.ts +11 -0
  40. package/dist/codegen/package.d.ts.map +1 -0
  41. package/dist/codegen/patches.d.ts +37 -0
  42. package/dist/codegen/patches.d.ts.map +1 -0
  43. package/dist/codegen/sam.d.ts +9 -0
  44. package/dist/codegen/sam.d.ts.map +1 -0
  45. package/dist/codegen/typecheck.d.ts +5 -0
  46. package/dist/codegen/typecheck.d.ts.map +1 -0
  47. package/dist/codegen/versions.d.ts +20 -0
  48. package/dist/codegen/versions.d.ts.map +1 -0
  49. package/dist/composites/alb-shared.d.ts +16 -0
  50. package/dist/composites/alb-shared.d.ts.map +1 -0
  51. package/dist/composites/ec2-instance-role.d.ts +11 -0
  52. package/dist/composites/ec2-instance-role.d.ts.map +1 -0
  53. package/dist/composites/ecs-trust-policy.d.ts +11 -0
  54. package/dist/composites/ecs-trust-policy.d.ts.map +1 -0
  55. package/dist/composites/efs-with-access-point.d.ts +18 -0
  56. package/dist/composites/efs-with-access-point.d.ts.map +1 -0
  57. package/dist/composites/fargate-alb.d.ts +43 -0
  58. package/dist/composites/fargate-alb.d.ts.map +1 -0
  59. package/dist/composites/fargate-service.d.ts +51 -0
  60. package/dist/composites/fargate-service.d.ts.map +1 -0
  61. package/dist/composites/index.d.ts +35 -0
  62. package/dist/composites/index.d.ts.map +1 -0
  63. package/dist/composites/lambda-api.d.ts +13 -0
  64. package/dist/composites/lambda-api.d.ts.map +1 -0
  65. package/dist/composites/lambda-dynamodb.d.ts +20 -0
  66. package/dist/composites/lambda-dynamodb.d.ts.map +1 -0
  67. package/dist/composites/lambda-eventbridge.d.ts +14 -0
  68. package/dist/composites/lambda-eventbridge.d.ts.map +1 -0
  69. package/dist/composites/lambda-function.d.ts +90 -0
  70. package/dist/composites/lambda-function.d.ts.map +1 -0
  71. package/dist/composites/lambda-s3.d.ts +23 -0
  72. package/dist/composites/lambda-s3.d.ts.map +1 -0
  73. package/dist/composites/lambda-sns.d.ts +12 -0
  74. package/dist/composites/lambda-sns.d.ts.map +1 -0
  75. package/dist/composites/lambda-sqs.d.ts +13 -0
  76. package/dist/composites/lambda-sqs.d.ts.map +1 -0
  77. package/dist/composites/minimal-vpc.d.ts +12 -0
  78. package/dist/composites/minimal-vpc.d.ts.map +1 -0
  79. package/dist/composites/rds-instance.d.ts +40 -0
  80. package/dist/composites/rds-instance.d.ts.map +1 -0
  81. package/dist/composites/scheduled-lambda.d.ts +15 -0
  82. package/dist/composites/scheduled-lambda.d.ts.map +1 -0
  83. package/dist/composites/solr-fargate-service.d.ts +15 -0
  84. package/dist/composites/solr-fargate-service.d.ts.map +1 -0
  85. package/dist/composites/vpc-default.d.ts +49 -0
  86. package/dist/composites/vpc-default.d.ts.map +1 -0
  87. package/dist/coverage.d.ts +5 -0
  88. package/dist/coverage.d.ts.map +1 -0
  89. package/dist/default-tags.d.ts +57 -0
  90. package/dist/default-tags.d.ts.map +1 -0
  91. package/dist/detect.d.ts +3 -0
  92. package/dist/detect.d.ts.map +1 -0
  93. package/dist/generated/index.d.ts +10456 -0
  94. package/dist/generated/index.d.ts.map +1 -0
  95. package/dist/generated/runtime.d.ts +5 -0
  96. package/dist/generated/runtime.d.ts.map +1 -0
  97. package/dist/import/generator.d.ts +72 -0
  98. package/dist/import/generator.d.ts.map +1 -0
  99. package/dist/import/live-export.d.ts +12 -0
  100. package/dist/import/live-export.d.ts.map +1 -0
  101. package/dist/import/parser.d.ts +30 -0
  102. package/dist/import/parser.d.ts.map +1 -0
  103. package/dist/index.d.ts +27 -0
  104. package/dist/index.d.ts.map +1 -0
  105. package/dist/integrity.json +4 -4
  106. package/dist/intrinsics.d.ts +158 -0
  107. package/dist/intrinsics.d.ts.map +1 -0
  108. package/dist/lint/post-synth/cf-refs.d.ts +54 -0
  109. package/dist/lint/post-synth/cf-refs.d.ts.map +1 -0
  110. package/dist/lint/post-synth/cor020.d.ts +10 -0
  111. package/dist/lint/post-synth/cor020.d.ts.map +1 -0
  112. package/dist/lint/post-synth/ext001.d.ts +25 -0
  113. package/dist/lint/post-synth/ext001.d.ts.map +1 -0
  114. package/dist/lint/post-synth/index.d.ts +3 -0
  115. package/dist/lint/post-synth/index.d.ts.map +1 -0
  116. package/dist/lint/post-synth/waw010.d.ts +10 -0
  117. package/dist/lint/post-synth/waw010.d.ts.map +1 -0
  118. package/dist/lint/post-synth/waw011.d.ts +9 -0
  119. package/dist/lint/post-synth/waw011.d.ts.map +1 -0
  120. package/dist/lint/post-synth/waw013.d.ts +10 -0
  121. package/dist/lint/post-synth/waw013.d.ts.map +1 -0
  122. package/dist/lint/post-synth/waw014.d.ts +9 -0
  123. package/dist/lint/post-synth/waw014.d.ts.map +1 -0
  124. package/dist/lint/post-synth/waw015.d.ts +13 -0
  125. package/dist/lint/post-synth/waw015.d.ts.map +1 -0
  126. package/dist/lint/post-synth/waw016.d.ts +13 -0
  127. package/dist/lint/post-synth/waw016.d.ts.map +1 -0
  128. package/dist/lint/post-synth/waw017.d.ts +13 -0
  129. package/dist/lint/post-synth/waw017.d.ts.map +1 -0
  130. package/dist/lint/post-synth/waw018.d.ts +9 -0
  131. package/dist/lint/post-synth/waw018.d.ts.map +1 -0
  132. package/dist/lint/post-synth/waw019.d.ts +10 -0
  133. package/dist/lint/post-synth/waw019.d.ts.map +1 -0
  134. package/dist/lint/post-synth/waw020.d.ts +10 -0
  135. package/dist/lint/post-synth/waw020.d.ts.map +1 -0
  136. package/dist/lint/post-synth/waw021.d.ts +9 -0
  137. package/dist/lint/post-synth/waw021.d.ts.map +1 -0
  138. package/dist/lint/post-synth/waw022.d.ts +9 -0
  139. package/dist/lint/post-synth/waw022.d.ts.map +1 -0
  140. package/dist/lint/post-synth/waw023.d.ts +9 -0
  141. package/dist/lint/post-synth/waw023.d.ts.map +1 -0
  142. package/dist/lint/post-synth/waw024.d.ts +9 -0
  143. package/dist/lint/post-synth/waw024.d.ts.map +1 -0
  144. package/dist/lint/post-synth/waw025.d.ts +9 -0
  145. package/dist/lint/post-synth/waw025.d.ts.map +1 -0
  146. package/dist/lint/post-synth/waw026.d.ts +9 -0
  147. package/dist/lint/post-synth/waw026.d.ts.map +1 -0
  148. package/dist/lint/post-synth/waw027.d.ts +9 -0
  149. package/dist/lint/post-synth/waw027.d.ts.map +1 -0
  150. package/dist/lint/post-synth/waw028.d.ts +9 -0
  151. package/dist/lint/post-synth/waw028.d.ts.map +1 -0
  152. package/dist/lint/post-synth/waw029.d.ts +11 -0
  153. package/dist/lint/post-synth/waw029.d.ts.map +1 -0
  154. package/dist/lint/post-synth/waw030.d.ts +19 -0
  155. package/dist/lint/post-synth/waw030.d.ts.map +1 -0
  156. package/dist/lint/post-synth/waw031.d.ts +17 -0
  157. package/dist/lint/post-synth/waw031.d.ts.map +1 -0
  158. package/dist/lint/post-synth/waw032.d.ts +11 -0
  159. package/dist/lint/post-synth/waw032.d.ts.map +1 -0
  160. package/dist/lint/post-synth/waw033.d.ts +12 -0
  161. package/dist/lint/post-synth/waw033.d.ts.map +1 -0
  162. package/dist/lint/post-synth/waw034.d.ts +11 -0
  163. package/dist/lint/post-synth/waw034.d.ts.map +1 -0
  164. package/dist/lint/post-synth/waw035.d.ts +12 -0
  165. package/dist/lint/post-synth/waw035.d.ts.map +1 -0
  166. package/dist/lint/post-synth/waw036.d.ts +21 -0
  167. package/dist/lint/post-synth/waw036.d.ts.map +1 -0
  168. package/dist/lint/post-synth/waw037.d.ts +21 -0
  169. package/dist/lint/post-synth/waw037.d.ts.map +1 -0
  170. package/dist/lint/rules/hardcoded-region.d.ts +9 -0
  171. package/dist/lint/rules/hardcoded-region.d.ts.map +1 -0
  172. package/dist/lint/rules/iam-wildcard.d.ts +9 -0
  173. package/dist/lint/rules/iam-wildcard.d.ts.map +1 -0
  174. package/dist/lint/rules/index.d.ts +7 -0
  175. package/dist/lint/rules/index.d.ts.map +1 -0
  176. package/dist/lint/rules/s3-encryption.d.ts +9 -0
  177. package/dist/lint/rules/s3-encryption.d.ts.map +1 -0
  178. package/dist/lsp/completions.d.ts +6 -0
  179. package/dist/lsp/completions.d.ts.map +1 -0
  180. package/dist/lsp/hover.d.ts +6 -0
  181. package/dist/lsp/hover.d.ts.map +1 -0
  182. package/dist/manifest.json +1 -1
  183. package/dist/meta.json +47226 -71473
  184. package/dist/nested-stack.d.ts +75 -0
  185. package/dist/nested-stack.d.ts.map +1 -0
  186. package/dist/package-cli.d.ts +3 -0
  187. package/dist/package-cli.d.ts.map +1 -0
  188. package/dist/parameter.d.ts +14 -0
  189. package/dist/parameter.d.ts.map +1 -0
  190. package/dist/plugin.d.ts +9 -0
  191. package/dist/plugin.d.ts.map +1 -0
  192. package/dist/pseudo.d.ts +17 -0
  193. package/dist/pseudo.d.ts.map +1 -0
  194. package/dist/serializer.d.ts +6 -0
  195. package/dist/serializer.d.ts.map +1 -0
  196. package/dist/spec/fetch.d.ts +74 -0
  197. package/dist/spec/fetch.d.ts.map +1 -0
  198. package/dist/spec/parse.d.ts +65 -0
  199. package/dist/spec/parse.d.ts.map +1 -0
  200. package/dist/taggable.d.ts +11 -0
  201. package/dist/taggable.d.ts.map +1 -0
  202. package/dist/types/index.d.ts +36468 -78177
  203. package/dist/validate-cli.d.ts +3 -0
  204. package/dist/validate-cli.d.ts.map +1 -0
  205. package/dist/validate.d.ts +17 -0
  206. package/dist/validate.d.ts.map +1 -0
  207. package/package.json +24 -5
  208. package/src/codegen/__snapshots__/snapshot.test.ts.snap +0 -1
  209. package/src/codegen/fallback.ts +2 -0
  210. package/src/codegen/package.ts +1 -1
  211. package/src/codegen/sam.ts +18 -0
  212. package/src/composites/efs-with-access-point.ts +1 -1
  213. package/src/composites/fargate-service.ts +1 -1
  214. package/src/composites/lambda-api.ts +6 -2
  215. package/src/composites/lambda-function.ts +6 -1
  216. package/src/composites/lambda-s3.ts +7 -2
  217. package/src/composites/vpc-default.ts +25 -1
  218. package/src/detect.ts +19 -0
  219. package/src/generated/index.d.ts +36468 -78177
  220. package/src/generated/index.ts +110 -4962
  221. package/src/generated/lexicon-aws.json +47226 -71473
  222. package/src/lint/post-synth/index.ts +63 -0
  223. package/src/plugin.ts +7 -26
  224. package/src/spec/parse.ts +21 -1
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env tsx
2
+ export {};
3
+ //# sourceMappingURL=validate-cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-cli.d.ts","sourceRoot":"","sources":["../src/validate-cli.ts"],"names":[],"mappings":""}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Validate generated lexicon-aws artifacts.
3
+ *
4
+ * Thin wrapper around the core validation framework
5
+ * with AWS-specific configuration.
6
+ */
7
+ import { type ValidateResult } from "@intentius/chant/codegen/validate";
8
+ export type { ValidateCheck, ValidateResult } from "@intentius/chant/codegen/validate";
9
+ /**
10
+ * Validate the generated lexicon-aws artifacts.
11
+ *
12
+ * @param opts.basePath - Override the package directory (defaults to lexicon-aws package root)
13
+ */
14
+ export declare function validate(opts?: {
15
+ basePath?: string;
16
+ }): Promise<ValidateResult>;
17
+ //# sourceMappingURL=validate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAA4B,KAAK,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAElG,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAIvF;;;;GAIG;AACH,wBAAsB,QAAQ,CAAC,IAAI,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,cAAc,CAAC,CAapF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentius/chant-lexicon-aws",
3
- "version": "0.7.0",
3
+ "version": "0.8.1",
4
4
  "description": "AWS CloudFormation lexicon for chant — declarative IaC in TypeScript",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://intentius.io/chant",
@@ -29,8 +29,26 @@
29
29
  "access": "public"
30
30
  },
31
31
  "exports": {
32
- ".": "./src/index.ts",
33
- "./*": "./src/*.ts",
32
+ ".": {
33
+ "development": "./src/index.ts",
34
+ "types": "./dist/index.d.ts",
35
+ "default": "./src/index.ts"
36
+ },
37
+ "./*": {
38
+ "development": "./src/*.ts",
39
+ "types": "./dist/*.d.ts",
40
+ "default": "./src/*.ts"
41
+ },
42
+ "./detect": {
43
+ "development": "./src/detect.ts",
44
+ "types": "./dist/detect.d.ts",
45
+ "default": "./src/detect.ts"
46
+ },
47
+ "./lint/post-synth": {
48
+ "development": "./src/lint/post-synth/index.ts",
49
+ "types": "./dist/lint/post-synth/index.d.ts",
50
+ "default": "./src/lint/post-synth/index.ts"
51
+ },
34
52
  "./manifest": "./dist/manifest.json",
35
53
  "./meta": "./dist/meta.json",
36
54
  "./types": "./dist/types/index.d.ts"
@@ -40,7 +58,8 @@
40
58
  "bundle": "tsx src/package-cli.ts",
41
59
  "validate": "tsx src/validate-cli.ts",
42
60
  "docs": "tsx src/codegen/docs-cli.ts",
43
- "prepack": "npm run generate && npm run bundle && npm run validate"
61
+ "prepack": "npm run generate && npm run bundle && npm run validate && npm run build",
62
+ "build": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json && find dist -type f \\( -name \"*.js\" -o -name \"*.js.map\" \\) -delete"
44
63
  },
45
64
  "dependencies": {
46
65
  "fflate": "^0.8.2",
@@ -51,6 +70,6 @@
51
70
  "typescript": "^5.9.3"
52
71
  },
53
72
  "peerDependencies": {
54
- "@intentius/chant": "^0.1.0"
73
+ "@intentius/chant": "^0.8.1"
55
74
  }
56
75
  }
@@ -158,7 +158,6 @@ exports[`snapshot tests > generated resource names 1`] = `
158
158
  "EventSource",
159
159
  "Function",
160
160
  "Function_Code",
161
- "Function_Tag",
162
161
  "GraphQLApi",
163
162
  "HttpApi",
164
163
  "HttpApi_CorsConfiguration",
@@ -26,6 +26,8 @@ function fallbackLogGroup(): SchemaParseResult {
26
26
  createOnly: [],
27
27
  writeOnly: [],
28
28
  primaryIdentifier: [],
29
+ deprecatedProperties: [],
30
+ conditionalCreateOnly: [],
29
31
  },
30
32
  propertyTypes: [],
31
33
  enums: [],
@@ -43,7 +43,7 @@ export async function packageLexicon(opts: PackageOptions = {}): Promise<Package
43
43
  buildManifest: (_genResult) => {
44
44
  // Lazy-import to avoid circular dependency
45
45
  const intrinsics: IntrinsicDef[] = (awsPlugin.intrinsics?.() ?? []).map(
46
- (i: { name: string; description: string }) => ({
46
+ (i: IntrinsicDef) => ({
47
47
  name: i.name,
48
48
  description: i.description,
49
49
  outputKey: intrinsicOutputKey(i.name),
@@ -58,6 +58,8 @@ function samFunction(): SchemaParseResult {
58
58
  createOnly: [],
59
59
  writeOnly: [],
60
60
  primaryIdentifier: [],
61
+ deprecatedProperties: [],
62
+ conditionalCreateOnly: [],
61
63
  },
62
64
  propertyTypes: [
63
65
  {
@@ -144,6 +146,8 @@ function samApi(): SchemaParseResult {
144
146
  createOnly: [],
145
147
  writeOnly: [],
146
148
  primaryIdentifier: [],
149
+ deprecatedProperties: [],
150
+ conditionalCreateOnly: [],
147
151
  },
148
152
  propertyTypes: [
149
153
  {
@@ -195,6 +199,8 @@ function samHttpApi(): SchemaParseResult {
195
199
  createOnly: [],
196
200
  writeOnly: [],
197
201
  primaryIdentifier: [],
202
+ deprecatedProperties: [],
203
+ conditionalCreateOnly: [],
198
204
  },
199
205
  propertyTypes: [
200
206
  {
@@ -229,6 +235,8 @@ function samSimpleTable(): SchemaParseResult {
229
235
  createOnly: [],
230
236
  writeOnly: [],
231
237
  primaryIdentifier: [],
238
+ deprecatedProperties: [],
239
+ conditionalCreateOnly: [],
232
240
  },
233
241
  propertyTypes: [
234
242
  {
@@ -264,6 +272,8 @@ function samLayerVersion(): SchemaParseResult {
264
272
  createOnly: [],
265
273
  writeOnly: [],
266
274
  primaryIdentifier: [],
275
+ deprecatedProperties: [],
276
+ conditionalCreateOnly: [],
267
277
  },
268
278
  propertyTypes: [],
269
279
  enums: [],
@@ -295,6 +305,8 @@ function samStateMachine(): SchemaParseResult {
295
305
  createOnly: [],
296
306
  writeOnly: [],
297
307
  primaryIdentifier: [],
308
+ deprecatedProperties: [],
309
+ conditionalCreateOnly: [],
298
310
  },
299
311
  propertyTypes: [
300
312
  {
@@ -326,6 +338,8 @@ function samApplication(): SchemaParseResult {
326
338
  createOnly: [],
327
339
  writeOnly: [],
328
340
  primaryIdentifier: [],
341
+ deprecatedProperties: [],
342
+ conditionalCreateOnly: [],
329
343
  },
330
344
  propertyTypes: [],
331
345
  enums: [],
@@ -345,6 +359,8 @@ function samConnector(): SchemaParseResult {
345
359
  createOnly: [],
346
360
  writeOnly: [],
347
361
  primaryIdentifier: [],
362
+ deprecatedProperties: [],
363
+ conditionalCreateOnly: [],
348
364
  },
349
365
  propertyTypes: [],
350
366
  enums: [],
@@ -380,6 +396,8 @@ function samGraphQLApi(): SchemaParseResult {
380
396
  createOnly: [],
381
397
  writeOnly: [],
382
398
  primaryIdentifier: [],
399
+ deprecatedProperties: [],
400
+ conditionalCreateOnly: [],
383
401
  },
384
402
  propertyTypes: [],
385
403
  enums: [],
@@ -29,7 +29,7 @@ export interface EfsWithAccessPointProps {
29
29
  }
30
30
 
31
31
  export const EfsWithAccessPoint = Composite<EfsWithAccessPointProps>((props) => {
32
- const ingressRules: SecurityGroup_Ingress[] = [];
32
+ const ingressRules: InstanceType<typeof SecurityGroup_Ingress>[] = [];
33
33
  if (props.sourceSecurityGroupId) {
34
34
  ingressRules.push(new SecurityGroup_Ingress({
35
35
  IpProtocol: "tcp",
@@ -61,7 +61,7 @@ export interface FargateServiceProps {
61
61
  };
62
62
  environment?: Record<string, string>;
63
63
  command?: string[];
64
- mountPoints?: TaskDefinition_MountPoint[];
64
+ mountPoints?: InstanceType<typeof TaskDefinition_MountPoint>[];
65
65
  efsMounts?: Array<{
66
66
  fileSystemId: string;
67
67
  accessPointId?: string;
@@ -1,6 +1,6 @@
1
1
  import { Composite, mergeDefaults } from "@intentius/chant";
2
2
  import { Permission } from "../generated";
3
- import { LambdaFunction, type LambdaFunctionProps } from "./lambda-function";
3
+ import { LambdaFunction, type LambdaFunctionProps, type LambdaFunctionResult } from "./lambda-function";
4
4
 
5
5
  export interface LambdaApiProps extends LambdaFunctionProps {
6
6
  sourceArn?: string;
@@ -9,7 +9,11 @@ export interface LambdaApiProps extends LambdaFunctionProps {
9
9
  };
10
10
  }
11
11
 
12
- export const LambdaApi = Composite<LambdaApiProps>((props) => {
12
+ export type LambdaApiResult = LambdaFunctionResult & {
13
+ permission: InstanceType<typeof Permission>;
14
+ };
15
+
16
+ export const LambdaApi = Composite<LambdaApiProps, LambdaApiResult>((props) => {
13
17
  const { defaults } = props;
14
18
  const { role, func } = LambdaFunction(props);
15
19
 
@@ -35,7 +35,12 @@ export interface LambdaFunctionProps {
35
35
  };
36
36
  }
37
37
 
38
- export const LambdaFunction = Composite<LambdaFunctionProps>((props) => {
38
+ export type LambdaFunctionResult = {
39
+ role: InstanceType<typeof Role>;
40
+ func: InstanceType<typeof Function>;
41
+ };
42
+
43
+ export const LambdaFunction = Composite<LambdaFunctionProps, LambdaFunctionResult>((props) => {
39
44
  const { defaults } = props;
40
45
  const managedPolicies = [BASIC_EXECUTION_ARN];
41
46
  if (props.VpcConfig) {
@@ -12,7 +12,7 @@ import {
12
12
  } from "../generated";
13
13
  import { Sub, Join } from "../intrinsics";
14
14
  import { S3Actions } from "../actions/s3";
15
- import { LambdaFunction, type LambdaFunctionProps } from "./lambda-function";
15
+ import { LambdaFunction, type LambdaFunctionProps, type LambdaFunctionResult } from "./lambda-function";
16
16
 
17
17
  export interface LambdaS3Props extends LambdaFunctionProps {
18
18
  bucketName?: string;
@@ -27,7 +27,12 @@ export interface LambdaS3Props extends LambdaFunctionProps {
27
27
  };
28
28
  }
29
29
 
30
- export const LambdaS3 = Composite<LambdaS3Props>((props) => {
30
+ export type LambdaS3Result = LambdaFunctionResult & {
31
+ bucket: InstanceType<typeof Bucket>;
32
+ permission: InstanceType<typeof Permission>;
33
+ };
34
+
35
+ export const LambdaS3 = Composite<LambdaS3Props, LambdaFunctionResult & { bucket: InstanceType<typeof Bucket>; permission?: InstanceType<typeof Permission> }>((props) => {
31
36
  const encryptionDefault = new Bucket_ServerSideEncryptionByDefault({ SSEAlgorithm: "AES256" });
32
37
  const encryptionRule = new Bucket_ServerSideEncryptionRule({
33
38
  ServerSideEncryptionByDefault: encryptionDefault,
@@ -36,7 +36,31 @@ export interface VpcDefaultProps {
36
36
  };
37
37
  }
38
38
 
39
- export const VpcDefault = Composite<VpcDefaultProps>((props) => {
39
+ export type VpcDefaultResult = {
40
+ vpc: InstanceType<typeof Vpc>;
41
+ igw: InstanceType<typeof InternetGateway>;
42
+ igwAttachment: InstanceType<typeof VPCGatewayAttachment>;
43
+ publicSubnet1: InstanceType<typeof Subnet>;
44
+ publicSubnet2: InstanceType<typeof Subnet>;
45
+ privateSubnet1: InstanceType<typeof Subnet>;
46
+ privateSubnet2: InstanceType<typeof Subnet>;
47
+ publicRouteTable: InstanceType<typeof RouteTable>;
48
+ publicRoute: InstanceType<typeof EC2Route>;
49
+ publicRta1: InstanceType<typeof SubnetRouteTableAssociation>;
50
+ publicRta2: InstanceType<typeof SubnetRouteTableAssociation>;
51
+ privateRouteTable: InstanceType<typeof RouteTable>;
52
+ privateRoute: InstanceType<typeof EC2Route>;
53
+ privateRta1: InstanceType<typeof SubnetRouteTableAssociation>;
54
+ privateRta2: InstanceType<typeof SubnetRouteTableAssociation>;
55
+ natEip: InstanceType<typeof EIP>;
56
+ natGateway: InstanceType<typeof NatGateway>;
57
+ publicSubnet3?: InstanceType<typeof Subnet>;
58
+ privateSubnet3?: InstanceType<typeof Subnet>;
59
+ publicRta3?: InstanceType<typeof SubnetRouteTableAssociation>;
60
+ privateRta3?: InstanceType<typeof SubnetRouteTableAssociation>;
61
+ };
62
+
63
+ export const VpcDefault = Composite<VpcDefaultProps, VpcDefaultResult>((props) => {
40
64
  const { defaults: defs } = props;
41
65
  const cidr = props.cidr ?? "10.0.0.0/16";
42
66
  const azCount = props.azCount ?? 2;
package/src/detect.ts ADDED
@@ -0,0 +1,19 @@
1
+ /** Edge-safe template detection for aws (CloudFormation) — see #426. */
2
+ export function detectTemplate(data: unknown): boolean {
3
+ if (typeof data !== "object" || data === null) return false;
4
+ const obj = data as Record<string, unknown>;
5
+ // CloudFormation has AWSTemplateFormatVersion
6
+ if (obj.AWSTemplateFormatVersion !== undefined) return true;
7
+ // Or Resources with AWS::* types
8
+ if (typeof obj.Resources === "object" && obj.Resources !== null) {
9
+ for (const resource of Object.values(obj.Resources as Record<string, unknown>)) {
10
+ if (typeof resource === "object" && resource !== null) {
11
+ const type = (resource as Record<string, unknown>).Type;
12
+ if (typeof type === "string" && type.startsWith("AWS::")) {
13
+ return true;
14
+ }
15
+ }
16
+ }
17
+ }
18
+ return false;
19
+ }