@intentius/chant-lexicon-aws 0.0.5 → 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.
@@ -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 === "bucketEncryption" ||
42
- prop.name.text === "encryption" ||
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>`