@intentius/chant-lexicon-aws 0.18.36 → 0.19.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/generated/index.d.ts +22 -2
- package/dist/generated/index.d.ts.map +1 -1
- package/dist/integrity.json +6 -5
- package/dist/manifest.json +1 -1
- package/dist/meta.json +255 -20
- package/dist/plugin.d.ts.map +1 -1
- package/dist/skills/chant-aws-carve-terraform.md +102 -0
- package/dist/types/index.d.ts +269 -22
- package/package.json +2 -2
- package/src/generated/index.d.ts +269 -22
- package/src/generated/index.ts +25 -5
- package/src/generated/lexicon-aws.json +255 -20
- package/src/plugin.ts +38 -0
- package/src/skills/chant-aws-carve-terraform.md +102 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
skill: chant-aws-carve-terraform
|
|
3
|
+
description: Demo carving a resource out of Terraform into native chant — advise, emit, bridge, apply — fully offline
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Carve a resource out of Terraform (demo)
|
|
8
|
+
|
|
9
|
+
Use this skill to cleanly demonstrate chant's Terraform carve-out flow for
|
|
10
|
+
someone. The whole demo runs **offline** — no cloud account, no Terraform
|
|
11
|
+
binary, no state backend. It carves an AWS S3 bucket out of a small Terraform
|
|
12
|
+
estate into native chant source, patches the survivors, and plans the
|
|
13
|
+
graduation.
|
|
14
|
+
|
|
15
|
+
## When to use
|
|
16
|
+
|
|
17
|
+
- Someone asks "how does chant move things off Terraform?"
|
|
18
|
+
- You want to show the advise → emit → bridge → apply loop end to end.
|
|
19
|
+
- You are evaluating whether a Terraform estate is worth carving.
|
|
20
|
+
|
|
21
|
+
## Preconditions
|
|
22
|
+
|
|
23
|
+
- `chant --version` succeeds.
|
|
24
|
+
- `@cdktf/hcl2json` is installed (the HCL parser). If a command reports it is
|
|
25
|
+
missing, run `npm install -D @cdktf/hcl2json` once.
|
|
26
|
+
|
|
27
|
+
## The fastest path: run the bundled demo
|
|
28
|
+
|
|
29
|
+
The `examples/terraform-carve-out` example ships a runnable estate + state and a
|
|
30
|
+
script that runs all four steps with commentary:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
cd examples/terraform-carve-out
|
|
34
|
+
./demo.sh
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Walk the person through the output. That is the whole demo.
|
|
38
|
+
|
|
39
|
+
## Driving it step by step (to explain each stage)
|
|
40
|
+
|
|
41
|
+
From `examples/terraform-carve-out`, with `TF=./terraform`:
|
|
42
|
+
|
|
43
|
+
1. **Advise — what is cheap to carve.**
|
|
44
|
+
```bash
|
|
45
|
+
chant carve advise --from ./terraform
|
|
46
|
+
```
|
|
47
|
+
Point out the three bands: clean leaves (carve now), carvable with edits,
|
|
48
|
+
and leave-in-Terraform. `aws_s3_bucket.assets` is a clean leaf held back one
|
|
49
|
+
notch by the Lambda that reads it; `random_pet` has no native mapping.
|
|
50
|
+
|
|
51
|
+
2. **Emit — adopt the bucket into chant source, offline, from state.**
|
|
52
|
+
```bash
|
|
53
|
+
chant carve emit --from ./terraform --select aws_s3_bucket.assets \
|
|
54
|
+
--state ./terraform/terraform.tfstate --output ./carveout
|
|
55
|
+
```
|
|
56
|
+
Show `./carveout/assets.ts` — a real `new Bucket({ BucketName, Tags })` with
|
|
57
|
+
CloudFormation-style properties mapped from the Terraform state attributes.
|
|
58
|
+
Explain: a Terraform-managed resource is not in any CloudFormation stack, so
|
|
59
|
+
the correct source of its live shape is the state file, not a cloud read.
|
|
60
|
+
|
|
61
|
+
3. **Lint the inherited resource — optional, offer it.**
|
|
62
|
+
```bash
|
|
63
|
+
chant lint ./carveout --lexicon aws
|
|
64
|
+
```
|
|
65
|
+
After emit, offer to lint the carved source. chant audits the resource you
|
|
66
|
+
inherited from Terraform against the AWS lexicon's rules. Findings have a
|
|
67
|
+
severity: `error` (must fix before `chant build` will emit — e.g. an S3
|
|
68
|
+
bucket with no public-access block) and `warning`/`info` (advisory — e.g.
|
|
69
|
+
DynamoDB point-in-time recovery). This is a feature of carving: chant
|
|
70
|
+
immediately tells the person what is wrong with what they adopted. Whether to
|
|
71
|
+
fix an advisory finding is their call; errors block the build until resolved.
|
|
72
|
+
|
|
73
|
+
4. **Bridge — patch the surviving Terraform.**
|
|
74
|
+
```bash
|
|
75
|
+
chant carve bridge --from ./terraform --select aws_s3_bucket.assets --output ./carveout
|
|
76
|
+
```
|
|
77
|
+
Show the generated `data "aws_s3_bucket" "assets"` and the rewired survivor.
|
|
78
|
+
Emphasize it is dry-run: nothing in `./terraform` changed. `--apply-rewrites`
|
|
79
|
+
would edit it in place.
|
|
80
|
+
|
|
81
|
+
5. **Apply — graduation plan.**
|
|
82
|
+
```bash
|
|
83
|
+
chant carve apply --from ./terraform --select aws_s3_bucket.assets --env prod --stack assets
|
|
84
|
+
```
|
|
85
|
+
Show the ownership marker (`chant:managed-by/stack/env`) and the finalized
|
|
86
|
+
runbook. Stress this makes no cloud call — the apply is the person's own
|
|
87
|
+
lifecycle; chant just plans it.
|
|
88
|
+
|
|
89
|
+
## Key points to land
|
|
90
|
+
|
|
91
|
+
- Nothing is destroyed or applied; every step before graduation is reversible
|
|
92
|
+
with `terraform import`.
|
|
93
|
+
- You carve one resource at a time. The gnarly long tail stays in Terraform.
|
|
94
|
+
- `advise` and `bridge` work against **any** Terraform tree — offer to point
|
|
95
|
+
them at the person's own estate.
|
|
96
|
+
|
|
97
|
+
## Going live (only if asked)
|
|
98
|
+
|
|
99
|
+
The real handoff adds three Terraform commands between bridge and apply:
|
|
100
|
+
`terraform state rm <addr>` (stops managing it, does not destroy), then
|
|
101
|
+
`terraform plan && terraform apply` to land the survivor patch. See the
|
|
102
|
+
generated runbook in `./carveout/<addr>-runbook.md`.
|