@intentius/chant-lexicon-aws 0.7.0 → 0.8.0
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.
- package/dist/actions/dynamodb.d.ts +11 -0
- package/dist/actions/dynamodb.d.ts.map +1 -0
- package/dist/actions/ecr.d.ts +5 -0
- package/dist/actions/ecr.d.ts.map +1 -0
- package/dist/actions/ecs.d.ts +6 -0
- package/dist/actions/ecs.d.ts.map +1 -0
- package/dist/actions/iam.d.ts +4 -0
- package/dist/actions/iam.d.ts.map +1 -0
- package/dist/actions/index.d.ts +10 -0
- package/dist/actions/index.d.ts.map +1 -0
- package/dist/actions/lambda.d.ts +6 -0
- package/dist/actions/lambda.d.ts.map +1 -0
- package/dist/actions/logs.d.ts +5 -0
- package/dist/actions/logs.d.ts.map +1 -0
- package/dist/actions/s3.d.ts +11 -0
- package/dist/actions/s3.d.ts.map +1 -0
- package/dist/actions/sns.d.ts +6 -0
- package/dist/actions/sns.d.ts.map +1 -0
- package/dist/actions/sqs.d.ts +6 -0
- package/dist/actions/sqs.d.ts.map +1 -0
- package/dist/codegen/docs-cli.d.ts +2 -0
- package/dist/codegen/docs-cli.d.ts.map +1 -0
- package/dist/codegen/docs.d.ts +15 -0
- package/dist/codegen/docs.d.ts.map +1 -0
- package/dist/codegen/extensions.d.ts +25 -0
- package/dist/codegen/extensions.d.ts.map +1 -0
- package/dist/codegen/fallback.d.ts +8 -0
- package/dist/codegen/fallback.d.ts.map +1 -0
- package/dist/codegen/generate-cli.d.ts +3 -0
- package/dist/codegen/generate-cli.d.ts.map +1 -0
- package/dist/codegen/generate-lexicon.d.ts +38 -0
- package/dist/codegen/generate-lexicon.d.ts.map +1 -0
- package/dist/codegen/generate-typescript.d.ts +16 -0
- package/dist/codegen/generate-typescript.d.ts.map +1 -0
- package/dist/codegen/generate.d.ts +15 -0
- package/dist/codegen/generate.d.ts.map +1 -0
- package/dist/codegen/naming.d.ts +16 -0
- package/dist/codegen/naming.d.ts.map +1 -0
- package/dist/codegen/package.d.ts +11 -0
- package/dist/codegen/package.d.ts.map +1 -0
- package/dist/codegen/patches.d.ts +37 -0
- package/dist/codegen/patches.d.ts.map +1 -0
- package/dist/codegen/sam.d.ts +9 -0
- package/dist/codegen/sam.d.ts.map +1 -0
- package/dist/codegen/typecheck.d.ts +5 -0
- package/dist/codegen/typecheck.d.ts.map +1 -0
- package/dist/codegen/versions.d.ts +20 -0
- package/dist/codegen/versions.d.ts.map +1 -0
- package/dist/composites/alb-shared.d.ts +16 -0
- package/dist/composites/alb-shared.d.ts.map +1 -0
- package/dist/composites/ec2-instance-role.d.ts +11 -0
- package/dist/composites/ec2-instance-role.d.ts.map +1 -0
- package/dist/composites/ecs-trust-policy.d.ts +11 -0
- package/dist/composites/ecs-trust-policy.d.ts.map +1 -0
- package/dist/composites/efs-with-access-point.d.ts +18 -0
- package/dist/composites/efs-with-access-point.d.ts.map +1 -0
- package/dist/composites/fargate-alb.d.ts +43 -0
- package/dist/composites/fargate-alb.d.ts.map +1 -0
- package/dist/composites/fargate-service.d.ts +51 -0
- package/dist/composites/fargate-service.d.ts.map +1 -0
- package/dist/composites/index.d.ts +35 -0
- package/dist/composites/index.d.ts.map +1 -0
- package/dist/composites/lambda-api.d.ts +13 -0
- package/dist/composites/lambda-api.d.ts.map +1 -0
- package/dist/composites/lambda-dynamodb.d.ts +20 -0
- package/dist/composites/lambda-dynamodb.d.ts.map +1 -0
- package/dist/composites/lambda-eventbridge.d.ts +14 -0
- package/dist/composites/lambda-eventbridge.d.ts.map +1 -0
- package/dist/composites/lambda-function.d.ts +90 -0
- package/dist/composites/lambda-function.d.ts.map +1 -0
- package/dist/composites/lambda-s3.d.ts +23 -0
- package/dist/composites/lambda-s3.d.ts.map +1 -0
- package/dist/composites/lambda-sns.d.ts +12 -0
- package/dist/composites/lambda-sns.d.ts.map +1 -0
- package/dist/composites/lambda-sqs.d.ts +13 -0
- package/dist/composites/lambda-sqs.d.ts.map +1 -0
- package/dist/composites/minimal-vpc.d.ts +12 -0
- package/dist/composites/minimal-vpc.d.ts.map +1 -0
- package/dist/composites/rds-instance.d.ts +40 -0
- package/dist/composites/rds-instance.d.ts.map +1 -0
- package/dist/composites/scheduled-lambda.d.ts +15 -0
- package/dist/composites/scheduled-lambda.d.ts.map +1 -0
- package/dist/composites/solr-fargate-service.d.ts +15 -0
- package/dist/composites/solr-fargate-service.d.ts.map +1 -0
- package/dist/composites/vpc-default.d.ts +49 -0
- package/dist/composites/vpc-default.d.ts.map +1 -0
- package/dist/coverage.d.ts +5 -0
- package/dist/coverage.d.ts.map +1 -0
- package/dist/default-tags.d.ts +57 -0
- package/dist/default-tags.d.ts.map +1 -0
- package/dist/detect.d.ts +3 -0
- package/dist/detect.d.ts.map +1 -0
- package/dist/generated/index.d.ts +10456 -0
- package/dist/generated/index.d.ts.map +1 -0
- package/dist/generated/runtime.d.ts +5 -0
- package/dist/generated/runtime.d.ts.map +1 -0
- package/dist/import/generator.d.ts +72 -0
- package/dist/import/generator.d.ts.map +1 -0
- package/dist/import/live-export.d.ts +12 -0
- package/dist/import/live-export.d.ts.map +1 -0
- package/dist/import/parser.d.ts +30 -0
- package/dist/import/parser.d.ts.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/integrity.json +4 -4
- package/dist/intrinsics.d.ts +158 -0
- package/dist/intrinsics.d.ts.map +1 -0
- package/dist/lint/post-synth/cf-refs.d.ts +54 -0
- package/dist/lint/post-synth/cf-refs.d.ts.map +1 -0
- package/dist/lint/post-synth/cor020.d.ts +10 -0
- package/dist/lint/post-synth/cor020.d.ts.map +1 -0
- package/dist/lint/post-synth/ext001.d.ts +25 -0
- package/dist/lint/post-synth/ext001.d.ts.map +1 -0
- package/dist/lint/post-synth/index.d.ts +3 -0
- package/dist/lint/post-synth/index.d.ts.map +1 -0
- package/dist/lint/post-synth/waw010.d.ts +10 -0
- package/dist/lint/post-synth/waw010.d.ts.map +1 -0
- package/dist/lint/post-synth/waw011.d.ts +9 -0
- package/dist/lint/post-synth/waw011.d.ts.map +1 -0
- package/dist/lint/post-synth/waw013.d.ts +10 -0
- package/dist/lint/post-synth/waw013.d.ts.map +1 -0
- package/dist/lint/post-synth/waw014.d.ts +9 -0
- package/dist/lint/post-synth/waw014.d.ts.map +1 -0
- package/dist/lint/post-synth/waw015.d.ts +13 -0
- package/dist/lint/post-synth/waw015.d.ts.map +1 -0
- package/dist/lint/post-synth/waw016.d.ts +13 -0
- package/dist/lint/post-synth/waw016.d.ts.map +1 -0
- package/dist/lint/post-synth/waw017.d.ts +13 -0
- package/dist/lint/post-synth/waw017.d.ts.map +1 -0
- package/dist/lint/post-synth/waw018.d.ts +9 -0
- package/dist/lint/post-synth/waw018.d.ts.map +1 -0
- package/dist/lint/post-synth/waw019.d.ts +10 -0
- package/dist/lint/post-synth/waw019.d.ts.map +1 -0
- package/dist/lint/post-synth/waw020.d.ts +10 -0
- package/dist/lint/post-synth/waw020.d.ts.map +1 -0
- package/dist/lint/post-synth/waw021.d.ts +9 -0
- package/dist/lint/post-synth/waw021.d.ts.map +1 -0
- package/dist/lint/post-synth/waw022.d.ts +9 -0
- package/dist/lint/post-synth/waw022.d.ts.map +1 -0
- package/dist/lint/post-synth/waw023.d.ts +9 -0
- package/dist/lint/post-synth/waw023.d.ts.map +1 -0
- package/dist/lint/post-synth/waw024.d.ts +9 -0
- package/dist/lint/post-synth/waw024.d.ts.map +1 -0
- package/dist/lint/post-synth/waw025.d.ts +9 -0
- package/dist/lint/post-synth/waw025.d.ts.map +1 -0
- package/dist/lint/post-synth/waw026.d.ts +9 -0
- package/dist/lint/post-synth/waw026.d.ts.map +1 -0
- package/dist/lint/post-synth/waw027.d.ts +9 -0
- package/dist/lint/post-synth/waw027.d.ts.map +1 -0
- package/dist/lint/post-synth/waw028.d.ts +9 -0
- package/dist/lint/post-synth/waw028.d.ts.map +1 -0
- package/dist/lint/post-synth/waw029.d.ts +11 -0
- package/dist/lint/post-synth/waw029.d.ts.map +1 -0
- package/dist/lint/post-synth/waw030.d.ts +19 -0
- package/dist/lint/post-synth/waw030.d.ts.map +1 -0
- package/dist/lint/post-synth/waw031.d.ts +17 -0
- package/dist/lint/post-synth/waw031.d.ts.map +1 -0
- package/dist/lint/post-synth/waw032.d.ts +11 -0
- package/dist/lint/post-synth/waw032.d.ts.map +1 -0
- package/dist/lint/post-synth/waw033.d.ts +12 -0
- package/dist/lint/post-synth/waw033.d.ts.map +1 -0
- package/dist/lint/post-synth/waw034.d.ts +11 -0
- package/dist/lint/post-synth/waw034.d.ts.map +1 -0
- package/dist/lint/post-synth/waw035.d.ts +12 -0
- package/dist/lint/post-synth/waw035.d.ts.map +1 -0
- package/dist/lint/post-synth/waw036.d.ts +21 -0
- package/dist/lint/post-synth/waw036.d.ts.map +1 -0
- package/dist/lint/post-synth/waw037.d.ts +21 -0
- package/dist/lint/post-synth/waw037.d.ts.map +1 -0
- package/dist/lint/rules/hardcoded-region.d.ts +9 -0
- package/dist/lint/rules/hardcoded-region.d.ts.map +1 -0
- package/dist/lint/rules/iam-wildcard.d.ts +9 -0
- package/dist/lint/rules/iam-wildcard.d.ts.map +1 -0
- package/dist/lint/rules/index.d.ts +7 -0
- package/dist/lint/rules/index.d.ts.map +1 -0
- package/dist/lint/rules/s3-encryption.d.ts +9 -0
- package/dist/lint/rules/s3-encryption.d.ts.map +1 -0
- package/dist/lsp/completions.d.ts +6 -0
- package/dist/lsp/completions.d.ts.map +1 -0
- package/dist/lsp/hover.d.ts +6 -0
- package/dist/lsp/hover.d.ts.map +1 -0
- package/dist/manifest.json +1 -1
- package/dist/meta.json +47226 -71473
- package/dist/nested-stack.d.ts +75 -0
- package/dist/nested-stack.d.ts.map +1 -0
- package/dist/package-cli.d.ts +3 -0
- package/dist/package-cli.d.ts.map +1 -0
- package/dist/parameter.d.ts +14 -0
- package/dist/parameter.d.ts.map +1 -0
- package/dist/plugin.d.ts +9 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/pseudo.d.ts +17 -0
- package/dist/pseudo.d.ts.map +1 -0
- package/dist/serializer.d.ts +6 -0
- package/dist/serializer.d.ts.map +1 -0
- package/dist/spec/fetch.d.ts +74 -0
- package/dist/spec/fetch.d.ts.map +1 -0
- package/dist/spec/parse.d.ts +65 -0
- package/dist/spec/parse.d.ts.map +1 -0
- package/dist/taggable.d.ts +11 -0
- package/dist/taggable.d.ts.map +1 -0
- package/dist/types/index.d.ts +36468 -78177
- package/dist/validate-cli.d.ts +3 -0
- package/dist/validate-cli.d.ts.map +1 -0
- package/dist/validate.d.ts +17 -0
- package/dist/validate.d.ts.map +1 -0
- package/package.json +24 -5
- package/src/codegen/__snapshots__/snapshot.test.ts.snap +0 -1
- package/src/codegen/fallback.ts +2 -0
- package/src/codegen/package.ts +1 -1
- package/src/codegen/sam.ts +18 -0
- package/src/composites/efs-with-access-point.ts +1 -1
- package/src/composites/fargate-service.ts +1 -1
- package/src/composites/lambda-api.ts +6 -2
- package/src/composites/lambda-function.ts +6 -1
- package/src/composites/lambda-s3.ts +7 -2
- package/src/composites/vpc-default.ts +25 -1
- package/src/detect.ts +19 -0
- package/src/generated/index.d.ts +36468 -78177
- package/src/generated/index.ts +110 -4962
- package/src/generated/lexicon-aws.json +47226 -71473
- package/src/lint/post-synth/index.ts +63 -0
- package/src/plugin.ts +7 -26
- package/src/spec/parse.ts +21 -1
|
@@ -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.
|
|
3
|
+
"version": "0.8.0",
|
|
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
|
-
".":
|
|
33
|
-
|
|
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.
|
|
73
|
+
"@intentius/chant": "^0.8.0"
|
|
55
74
|
}
|
|
56
75
|
}
|
package/src/codegen/fallback.ts
CHANGED
package/src/codegen/package.ts
CHANGED
|
@@ -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:
|
|
46
|
+
(i: IntrinsicDef) => ({
|
|
47
47
|
name: i.name,
|
|
48
48
|
description: i.description,
|
|
49
49
|
outputKey: intrinsicOutputKey(i.name),
|
package/src/codegen/sam.ts
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
+
}
|