@intentius/chant-lexicon-aws 0.0.6 → 0.0.8
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/integrity.json +7 -7
- package/dist/manifest.json +1 -1
- package/dist/meta.json +3701 -3701
- package/dist/rules/ext001.ts +2 -4
- package/dist/rules/s3-encryption.ts +2 -3
- package/dist/skills/chant-aws.md +72 -0
- package/dist/types/index.d.ts +57087 -57087
- package/package.json +1 -1
- package/src/codegen/__snapshots__/snapshot.test.ts.snap +18 -18
- package/src/codegen/docs.ts +59 -4
- package/src/codegen/generate.ts +1 -13
- package/src/codegen/package.ts +2 -0
- package/src/codegen/typecheck.test.ts +1 -1
- package/src/generated/index.d.ts +57087 -57087
- package/src/generated/index.ts +1351 -1351
- package/src/generated/lexicon-aws.json +3701 -3701
- package/src/import/generator.test.ts +5 -5
- package/src/import/generator.ts +4 -4
- package/src/import/roundtrip-fixtures.test.ts +2 -1
- package/src/import/roundtrip.test.ts +5 -5
- package/src/integration.test.ts +21 -21
- package/src/lint/post-synth/ext001.ts +2 -4
- package/src/lint/rules/rules.test.ts +8 -8
- package/src/lint/rules/s3-encryption.ts +2 -3
- package/src/lsp/completions.ts +2 -0
- package/src/lsp/hover.ts +2 -0
- package/src/nested-stack.ts +1 -1
- package/src/plugin.test.ts +13 -15
- package/src/plugin.ts +116 -110
- package/src/serializer.test.ts +42 -43
- package/src/serializer.ts +7 -16
- package/dist/skills/aws-cloudformation.md +0 -41
- package/src/codegen/rollback.test.ts +0 -80
- package/src/codegen/rollback.ts +0 -20
package/dist/rules/ext001.ts
CHANGED
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
* - required_xor: exactly one of the listed properties must exist
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
+
import { readFileSync } from "fs";
|
|
15
|
+
import { join } from "path";
|
|
14
16
|
import type { PostSynthCheck, PostSynthContext, PostSynthDiagnostic } from "@intentius/chant/lint/post-synth";
|
|
15
17
|
import { parseCFTemplate, type CFResource } from "./cf-refs";
|
|
16
18
|
|
|
@@ -34,10 +36,6 @@ interface LexiconEntry {
|
|
|
34
36
|
function loadLexiconConstraints(): Map<string, ExtensionConstraint[]> {
|
|
35
37
|
const map = new Map<string, ExtensionConstraint[]>();
|
|
36
38
|
try {
|
|
37
|
-
const { readFileSync } = require("fs");
|
|
38
|
-
const { join, dirname } = require("path");
|
|
39
|
-
const { fileURLToPath } = require("url");
|
|
40
|
-
|
|
41
39
|
// Navigate from src/lint/post-synth/ up to the package root
|
|
42
40
|
const pkgDir = join(__dirname, "..", "..", "..");
|
|
43
41
|
const lexiconPath = join(pkgDir, "src", "generated", "lexicon-aws.json");
|
|
@@ -38,9 +38,8 @@ export const s3EncryptionRule: LintRule = {
|
|
|
38
38
|
if (ts.isObjectLiteralExpression(props)) {
|
|
39
39
|
const hasEncryption = props.properties.some((prop) => {
|
|
40
40
|
if (ts.isPropertyAssignment(prop) && ts.isIdentifier(prop.name)) {
|
|
41
|
-
return prop.name.text === "
|
|
42
|
-
prop.name.text === "
|
|
43
|
-
prop.name.text === "serverSideEncryptionConfiguration";
|
|
41
|
+
return prop.name.text === "BucketEncryption" ||
|
|
42
|
+
prop.name.text === "ServerSideEncryptionConfiguration";
|
|
44
43
|
}
|
|
45
44
|
return false;
|
|
46
45
|
});
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
skill: chant-aws
|
|
3
|
+
description: Build, validate, and deploy CloudFormation templates from a chant project
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Deploying CloudFormation from Chant
|
|
8
|
+
|
|
9
|
+
This project defines CloudFormation resources as TypeScript in `src/`. Use these steps to build, validate, and deploy.
|
|
10
|
+
|
|
11
|
+
## Build the template
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
chant build src/ --output stack.json
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Validate before deploying
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
chant lint src/
|
|
21
|
+
aws cloudformation validate-template --template-body file://stack.json
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Deploy a new stack
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
aws cloudformation deploy \
|
|
28
|
+
--template-file stack.json \
|
|
29
|
+
--stack-name <stack-name> \
|
|
30
|
+
--capabilities CAPABILITY_NAMED_IAM
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Add `--parameter-overrides Key=Value` if the template has parameters.
|
|
34
|
+
|
|
35
|
+
## Update an existing stack
|
|
36
|
+
|
|
37
|
+
1. Edit the TypeScript source
|
|
38
|
+
2. Rebuild: `chant build src/ --output stack.json`
|
|
39
|
+
3. Preview changes:
|
|
40
|
+
```bash
|
|
41
|
+
aws cloudformation create-change-set \
|
|
42
|
+
--stack-name <stack-name> \
|
|
43
|
+
--template-body file://stack.json \
|
|
44
|
+
--change-set-name update-$(date +%s) \
|
|
45
|
+
--capabilities CAPABILITY_NAMED_IAM
|
|
46
|
+
aws cloudformation describe-change-set \
|
|
47
|
+
--stack-name <stack-name> \
|
|
48
|
+
--change-set-name update-<id>
|
|
49
|
+
```
|
|
50
|
+
4. Execute: `aws cloudformation execute-change-set --stack-name <stack-name> --change-set-name update-<id>`
|
|
51
|
+
|
|
52
|
+
Or deploy directly: `aws cloudformation deploy --template-file stack.json --stack-name <stack-name> --capabilities CAPABILITY_NAMED_IAM`
|
|
53
|
+
|
|
54
|
+
## Delete a stack
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
aws cloudformation delete-stack --stack-name <stack-name>
|
|
58
|
+
aws cloudformation wait stack-delete-complete --stack-name <stack-name>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Check stack status
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
aws cloudformation describe-stacks --stack-name <stack-name>
|
|
65
|
+
aws cloudformation describe-stack-events --stack-name <stack-name> --max-items 10
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Troubleshooting deploy failures
|
|
69
|
+
|
|
70
|
+
- Check events: `aws cloudformation describe-stack-events --stack-name <stack-name>`
|
|
71
|
+
- Rollback stuck: `aws cloudformation continue-update-rollback --stack-name <stack-name>`
|
|
72
|
+
- Drift: `aws cloudformation detect-stack-drift --stack-name <stack-name>`
|