@intentius/chant-lexicon-terraform 0.57.0 → 0.58.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/composites/terraform-adopt-op.d.ts +126 -0
- package/dist/composites/terraform-adopt-op.d.ts.map +1 -0
- package/dist/composites/terraform-apply-op.d.ts +63 -16
- package/dist/composites/terraform-apply-op.d.ts.map +1 -1
- package/dist/composites/terraform-watch-op.d.ts +80 -36
- package/dist/composites/terraform-watch-op.d.ts.map +1 -1
- package/dist/config.d.ts +49 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/describe-resources.d.ts +256 -16
- package/dist/describe-resources.d.ts.map +1 -1
- package/dist/hcl/descend.d.ts +98 -0
- package/dist/hcl/descend.d.ts.map +1 -0
- package/dist/hcl/marker.d.ts +130 -0
- package/dist/hcl/marker.d.ts.map +1 -0
- package/dist/hcl/parse.d.ts +142 -9
- package/dist/hcl/parse.d.ts.map +1 -1
- package/dist/hcl/references.d.ts +76 -0
- package/dist/hcl/references.d.ts.map +1 -0
- package/dist/hcl/roots.d.ts +22 -3
- package/dist/hcl/roots.d.ts.map +1 -1
- package/dist/hcl/suppressions.d.ts +54 -0
- package/dist/hcl/suppressions.d.ts.map +1 -0
- package/dist/hcl/value.d.ts +77 -0
- package/dist/hcl/value.d.ts.map +1 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/integrity.json +32 -5
- package/dist/lint/audit-catalog.d.ts +3 -2
- package/dist/lint/audit-catalog.d.ts.map +1 -1
- package/dist/lint/audit-lineage.d.ts +68 -0
- package/dist/lint/audit-lineage.d.ts.map +1 -1
- package/dist/lint/post-synth/blocks.d.ts +53 -0
- package/dist/lint/post-synth/blocks.d.ts.map +1 -0
- package/dist/lint/post-synth/fixtures/load.d.ts +37 -0
- package/dist/lint/post-synth/fixtures/load.d.ts.map +1 -0
- package/dist/lint/post-synth/index.d.ts.map +1 -1
- package/dist/lint/post-synth/module-source.d.ts +38 -0
- package/dist/lint/post-synth/module-source.d.ts.map +1 -0
- package/dist/lint/post-synth/scope.d.ts +65 -0
- package/dist/lint/post-synth/scope.d.ts.map +1 -0
- package/dist/lint/post-synth/tf001.d.ts +18 -0
- package/dist/lint/post-synth/tf001.d.ts.map +1 -1
- package/dist/lint/post-synth/tf002.d.ts +32 -0
- package/dist/lint/post-synth/tf002.d.ts.map +1 -0
- package/dist/lint/post-synth/tf003.d.ts +22 -0
- package/dist/lint/post-synth/tf003.d.ts.map +1 -0
- package/dist/lint/post-synth/tf004.d.ts +22 -0
- package/dist/lint/post-synth/tf004.d.ts.map +1 -0
- package/dist/lint/post-synth/tf005.d.ts +28 -0
- package/dist/lint/post-synth/tf005.d.ts.map +1 -0
- package/dist/lint/post-synth/tf006.d.ts +21 -0
- package/dist/lint/post-synth/tf006.d.ts.map +1 -0
- package/dist/lint/post-synth/tf007.d.ts +21 -0
- package/dist/lint/post-synth/tf007.d.ts.map +1 -0
- package/dist/lint/post-synth/tf008.d.ts +22 -0
- package/dist/lint/post-synth/tf008.d.ts.map +1 -0
- package/dist/lint/post-synth/tf009.d.ts +24 -0
- package/dist/lint/post-synth/tf009.d.ts.map +1 -0
- package/dist/lint/post-synth/tf010.d.ts +19 -0
- package/dist/lint/post-synth/tf010.d.ts.map +1 -0
- package/dist/lint/post-synth/tf011.d.ts +18 -0
- package/dist/lint/post-synth/tf011.d.ts.map +1 -0
- package/dist/lint/post-synth/tf012.d.ts +17 -0
- package/dist/lint/post-synth/tf012.d.ts.map +1 -0
- package/dist/lint/post-synth/tf013.d.ts +21 -0
- package/dist/lint/post-synth/tf013.d.ts.map +1 -0
- package/dist/lint/post-synth/tf014.d.ts +25 -0
- package/dist/lint/post-synth/tf014.d.ts.map +1 -0
- package/dist/lint/post-synth/tf015.d.ts +21 -0
- package/dist/lint/post-synth/tf015.d.ts.map +1 -0
- package/dist/lint/post-synth/tf016.d.ts +30 -0
- package/dist/lint/post-synth/tf016.d.ts.map +1 -0
- package/dist/lint/post-synth/tf017.d.ts +19 -0
- package/dist/lint/post-synth/tf017.d.ts.map +1 -0
- package/dist/lint/post-synth/tf018.d.ts +20 -0
- package/dist/lint/post-synth/tf018.d.ts.map +1 -0
- package/dist/lint/post-synth/tf019.d.ts +25 -0
- package/dist/lint/post-synth/tf019.d.ts.map +1 -0
- package/dist/lint/post-synth/tf020.d.ts +38 -0
- package/dist/lint/post-synth/tf020.d.ts.map +1 -0
- package/dist/lint/post-synth/tf021.d.ts +41 -0
- package/dist/lint/post-synth/tf021.d.ts.map +1 -0
- package/dist/lint/post-synth/tf022.d.ts +24 -0
- package/dist/lint/post-synth/tf022.d.ts.map +1 -0
- package/dist/lint/post-synth/tf024.d.ts +24 -0
- package/dist/lint/post-synth/tf024.d.ts.map +1 -0
- package/dist/lint/post-synth/tf025.d.ts +29 -0
- package/dist/lint/post-synth/tf025.d.ts.map +1 -0
- package/dist/lint/post-synth/tf026.d.ts +21 -0
- package/dist/lint/post-synth/tf026.d.ts.map +1 -0
- package/dist/lint/rules/fixtures/load.d.ts +13 -0
- package/dist/lint/rules/fixtures/load.d.ts.map +1 -0
- package/dist/lint/rules/plan-before-apply.d.ts +11 -0
- package/dist/lint/rules/plan-before-apply.d.ts.map +1 -1
- package/dist/lint/secret-shape.d.ts +68 -0
- package/dist/lint/secret-shape.d.ts.map +1 -0
- package/dist/live-ownership.d.ts +55 -0
- package/dist/live-ownership.d.ts.map +1 -0
- package/dist/lsp/option-keys.d.ts.map +1 -1
- package/dist/manifest.json +1 -1
- package/dist/okf/index.md +24 -0
- package/dist/okf/rules/TF002.md +11 -0
- package/dist/okf/rules/TF003.md +11 -0
- package/dist/okf/rules/TF004.md +11 -0
- package/dist/okf/rules/TF005.md +11 -0
- package/dist/okf/rules/TF006.md +11 -0
- package/dist/okf/rules/TF007.md +11 -0
- package/dist/okf/rules/TF008.md +11 -0
- package/dist/okf/rules/TF009.md +11 -0
- package/dist/okf/rules/TF010.md +11 -0
- package/dist/okf/rules/TF011.md +11 -0
- package/dist/okf/rules/TF012.md +11 -0
- package/dist/okf/rules/TF013.md +11 -0
- package/dist/okf/rules/TF014.md +11 -0
- package/dist/okf/rules/TF015.md +11 -0
- package/dist/okf/rules/TF016.md +11 -0
- package/dist/okf/rules/TF017.md +11 -0
- package/dist/okf/rules/TF018.md +11 -0
- package/dist/okf/rules/TF019.md +11 -0
- package/dist/okf/rules/TF020.md +11 -0
- package/dist/okf/rules/TF021.md +11 -0
- package/dist/okf/rules/TF022.md +11 -0
- package/dist/okf/rules/TF024.md +11 -0
- package/dist/okf/rules/TF025.md +11 -0
- package/dist/okf/rules/TF026.md +11 -0
- package/dist/op/activities/index.d.ts +13 -6
- package/dist/op/activities/index.d.ts.map +1 -1
- package/dist/op/activities/live-detect.d.ts +51 -0
- package/dist/op/activities/live-detect.d.ts.map +1 -0
- package/dist/op/activities/terraform.d.ts +445 -17
- package/dist/op/activities/terraform.d.ts.map +1 -1
- package/dist/op/activity-contracts.d.ts +148 -0
- package/dist/op/activity-contracts.d.ts.map +1 -0
- package/dist/op/adoption.d.ts +118 -0
- package/dist/op/adoption.d.ts.map +1 -0
- package/dist/op/builders.d.ts +46 -6
- package/dist/op/builders.d.ts.map +1 -1
- package/dist/op/resolve-root-mode.d.ts +45 -0
- package/dist/op/resolve-root-mode.d.ts.map +1 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/rules/blocks.ts +109 -0
- package/dist/rules/module-source.ts +121 -0
- package/dist/rules/plan-before-apply.ts +11 -0
- package/dist/rules/scope.ts +107 -0
- package/dist/rules/tf001.ts +32 -8
- package/dist/rules/tf002.ts +151 -0
- package/dist/rules/tf003.ts +71 -0
- package/dist/rules/tf004.ts +63 -0
- package/dist/rules/tf005.ts +76 -0
- package/dist/rules/tf006.ts +53 -0
- package/dist/rules/tf007.ts +78 -0
- package/dist/rules/tf008.ts +75 -0
- package/dist/rules/tf009.ts +59 -0
- package/dist/rules/tf010.ts +51 -0
- package/dist/rules/tf011.ts +49 -0
- package/dist/rules/tf012.ts +47 -0
- package/dist/rules/tf013.ts +63 -0
- package/dist/rules/tf014.ts +72 -0
- package/dist/rules/tf015.ts +63 -0
- package/dist/rules/tf016.ts +75 -0
- package/dist/rules/tf017.ts +50 -0
- package/dist/rules/tf018.ts +72 -0
- package/dist/rules/tf019.ts +72 -0
- package/dist/rules/tf020.ts +123 -0
- package/dist/rules/tf021.ts +126 -0
- package/dist/rules/tf022.ts +61 -0
- package/dist/rules/tf024.ts +70 -0
- package/dist/rules/tf025.ts +101 -0
- package/dist/rules/tf026.ts +80 -0
- package/dist/skills/chant-terraform.md +1 -1
- package/package.json +7 -2
- package/src/__fixtures__/live/main.tf +28 -0
- package/src/__fixtures__/live-adopt/estate.chdf.hcl +6 -0
- package/src/__fixtures__/live-adopt/main.tf +21 -0
- package/src/__fixtures__/live-estate/README.md +58 -0
- package/src/__fixtures__/live-estate/compute.tf +10 -0
- package/src/__fixtures__/live-estate/estate.chdf.hcl +1 -0
- package/src/__fixtures__/live-estate/logs.tf +8 -0
- package/src/__fixtures__/live-estate/network.tf +24 -0
- package/src/__fixtures__/live-estate/rule.tf +11 -0
- package/src/__fixtures__/live-estate/unowned.tf +21 -0
- package/src/__fixtures__/live-estate/versions.tf +31 -0
- package/src/__fixtures__/live-ls.json +98 -0
- package/src/__fixtures__/live-plan.json +285 -0
- package/src/__fixtures__/live-sidecar/estate.chdf.hcl +3 -0
- package/src/__fixtures__/live-sidecar/main.tf +24 -0
- package/src/__fixtures__/module-tree/README.md +16 -0
- package/src/__fixtures__/module-tree/cycle/main.tf +3 -0
- package/src/__fixtures__/module-tree/cycle/modules/a/main.tf +9 -0
- package/src/__fixtures__/module-tree/cycle/modules/b/main.tf +9 -0
- package/src/__fixtures__/module-tree/missing/main.tf +9 -0
- package/src/__fixtures__/module-tree/outside/root/main.tf +9 -0
- package/src/__fixtures__/module-tree/root/main.tf +28 -0
- package/src/__fixtures__/module-tree/root/modules/cdn/main.tf +15 -0
- package/src/__fixtures__/module-tree/root/modules/cdn/modules/bucket/main.tf +11 -0
- package/src/__fixtures__/module-tree/shared/main.tf +5 -0
- package/src/__fixtures__/references/main.tf +56 -0
- package/src/codegen/lint-rules-page.test.ts +28 -0
- package/src/composites/terraform-adopt-op.acceptance.test.ts +166 -0
- package/src/composites/terraform-adopt-op.test.ts +170 -0
- package/src/composites/terraform-adopt-op.ts +197 -0
- package/src/composites/terraform-apply-op.acceptance.test.ts +183 -5
- package/src/composites/terraform-apply-op.test.ts +167 -15
- package/src/composites/terraform-apply-op.ts +105 -28
- package/src/composites/terraform-watch-op.test.ts +85 -26
- package/src/composites/terraform-watch-op.ts +130 -73
- package/src/config.ts +32 -3
- package/src/describe-resources.live.test.ts +598 -0
- package/src/describe-resources.test.ts +53 -0
- package/src/describe-resources.ts +811 -28
- package/src/hcl/descend.test.ts +162 -0
- package/src/hcl/descend.ts +273 -0
- package/src/hcl/marker.test.ts +147 -0
- package/src/hcl/marker.ts +235 -0
- package/src/hcl/parse.test.ts +69 -0
- package/src/hcl/parse.ts +249 -27
- package/src/hcl/references.test.ts +116 -0
- package/src/hcl/references.ts +172 -0
- package/src/hcl/roots.ts +59 -5
- package/src/hcl/suppressions.test.ts +147 -0
- package/src/hcl/suppressions.ts +204 -0
- package/src/hcl/value.test.ts +73 -0
- package/src/hcl/value.ts +106 -0
- package/src/index.ts +31 -1
- package/src/lint/audit-catalog.ts +264 -3
- package/src/lint/audit-lineage.ts +319 -1
- package/src/lint/audit.test.ts +40 -1
- package/src/lint/post-synth/blocks.ts +109 -0
- package/src/lint/post-synth/fixtures/TF001/negative.tf +28 -0
- package/src/lint/post-synth/fixtures/TF001/positive.tf +24 -0
- package/src/lint/post-synth/fixtures/TF002/negative.tf +17 -0
- package/src/lint/post-synth/fixtures/TF002/positive-legacy.tf +10 -0
- package/src/lint/post-synth/fixtures/TF002/positive-no-version.tf +12 -0
- package/src/lint/post-synth/fixtures/TF002/positive.tf +7 -0
- package/src/lint/post-synth/fixtures/TF003/negative.tf +10 -0
- package/src/lint/post-synth/fixtures/TF003/positive.tf +8 -0
- package/src/lint/post-synth/fixtures/TF004/negative-git.tf +3 -0
- package/src/lint/post-synth/fixtures/TF004/negative-local.tf +3 -0
- package/src/lint/post-synth/fixtures/TF004/negative.tf +4 -0
- package/src/lint/post-synth/fixtures/TF004/positive.tf +3 -0
- package/src/lint/post-synth/fixtures/TF005/negative-local.tf +3 -0
- package/src/lint/post-synth/fixtures/TF005/negative-registry.tf +3 -0
- package/src/lint/post-synth/fixtures/TF005/negative-sha.tf +3 -0
- package/src/lint/post-synth/fixtures/TF005/negative.tf +3 -0
- package/src/lint/post-synth/fixtures/TF005/positive-branch.tf +3 -0
- package/src/lint/post-synth/fixtures/TF005/positive-non-semver.tf +3 -0
- package/src/lint/post-synth/fixtures/TF005/positive.tf +3 -0
- package/src/lint/post-synth/fixtures/TF006/negative.tf +5 -0
- package/src/lint/post-synth/fixtures/TF006/positive-empty-default.tf +11 -0
- package/src/lint/post-synth/fixtures/TF006/positive.tf +6 -0
- package/src/lint/post-synth/fixtures/TF007/negative.tf +10 -0
- package/src/lint/post-synth/fixtures/TF007/positive.tf +9 -0
- package/src/lint/post-synth/fixtures/TF008/negative-variable.tf +10 -0
- package/src/lint/post-synth/fixtures/TF008/negative.tf +8 -0
- package/src/lint/post-synth/fixtures/TF008/positive-other-provider.tf +10 -0
- package/src/lint/post-synth/fixtures/TF008/positive.tf +5 -0
- package/src/lint/post-synth/fixtures/TF009/negative.tf +10 -0
- package/src/lint/post-synth/fixtures/TF009/positive.tf +4 -0
- package/src/lint/post-synth/fixtures/TF010/negative.tf +5 -0
- package/src/lint/post-synth/fixtures/TF010/positive.tf +4 -0
- package/src/lint/post-synth/fixtures/TF011/negative.tf +5 -0
- package/src/lint/post-synth/fixtures/TF011/positive-blank.tf +5 -0
- package/src/lint/post-synth/fixtures/TF011/positive.tf +4 -0
- package/src/lint/post-synth/fixtures/TF012/negative.tf +4 -0
- package/src/lint/post-synth/fixtures/TF012/positive.tf +3 -0
- package/src/lint/post-synth/fixtures/TF013/negative.tf +8 -0
- package/src/lint/post-synth/fixtures/TF013/positive-data.tf +8 -0
- package/src/lint/post-synth/fixtures/TF013/positive.tf +8 -0
- package/src/lint/post-synth/fixtures/TF014/negative/main.tf +26 -0
- package/src/lint/post-synth/fixtures/TF014/negative/modules/cdn/main.tf +19 -0
- package/src/lint/post-synth/fixtures/TF014/positive/main.tf +16 -0
- package/src/lint/post-synth/fixtures/TF014/positive/modules/cdn/main.tf +15 -0
- package/src/lint/post-synth/fixtures/TF015/negative/main.tf +13 -0
- package/src/lint/post-synth/fixtures/TF015/negative/modules/cdn/main.tf +16 -0
- package/src/lint/post-synth/fixtures/TF015/positive/main.tf +13 -0
- package/src/lint/post-synth/fixtures/TF015/positive/modules/cdn/main.tf +14 -0
- package/src/lint/post-synth/fixtures/TF016/negative-template.tf +7 -0
- package/src/lint/post-synth/fixtures/TF016/negative.tf +16 -0
- package/src/lint/post-synth/fixtures/TF016/positive-shared-file.tf +12 -0
- package/src/lint/post-synth/fixtures/TF016/positive.tf +13 -0
- package/src/lint/post-synth/fixtures/TF017/negative.tf +4 -0
- package/src/lint/post-synth/fixtures/TF017/positive.tf +5 -0
- package/src/lint/post-synth/fixtures/TF018/negative.tf +9 -0
- package/src/lint/post-synth/fixtures/TF018/positive-data.tf +9 -0
- package/src/lint/post-synth/fixtures/TF018/positive.tf +4 -0
- package/src/lint/post-synth/fixtures/TF019/negative.tf +14 -0
- package/src/lint/post-synth/fixtures/TF019/positive-output.tf +5 -0
- package/src/lint/post-synth/fixtures/TF019/positive.tf +16 -0
- package/src/lint/post-synth/fixtures/TF020/negative.tf +43 -0
- package/src/lint/post-synth/fixtures/TF020/positive.tf +32 -0
- package/src/lint/post-synth/fixtures/TF020/scoped/main.tf +21 -0
- package/src/lint/post-synth/fixtures/TF020/scoped/modules/cdn/main.tf +13 -0
- package/src/lint/post-synth/fixtures/TF021/negative.tf +31 -0
- package/src/lint/post-synth/fixtures/TF021/positive-length.tf +8 -0
- package/src/lint/post-synth/fixtures/TF021/positive.tf +8 -0
- package/src/lint/post-synth/fixtures/TF022/negative-locator.tf +7 -0
- package/src/lint/post-synth/fixtures/TF022/negative.tf +10 -0
- package/src/lint/post-synth/fixtures/TF022/positive-nested.tf +10 -0
- package/src/lint/post-synth/fixtures/TF022/positive.tf +6 -0
- package/src/lint/post-synth/fixtures/TF023/negative/main.tf +15 -0
- package/src/lint/post-synth/fixtures/TF023/positive/main.tf +9 -0
- package/src/lint/post-synth/fixtures/TF023/positive/state.json +24 -0
- package/src/lint/post-synth/fixtures/TF024/live-clean/main.tf +9 -0
- package/src/lint/post-synth/fixtures/TF024/live-with-backend/main.tf +14 -0
- package/src/lint/post-synth/fixtures/TF024/live-with-cloud/main.tf +16 -0
- package/src/lint/post-synth/fixtures/TF025/live-clean/main.tf +13 -0
- package/src/lint/post-synth/fixtures/TF025/live-with-workspace-ref/main.tf +13 -0
- package/src/lint/post-synth/fixtures/TF026/live-default/main.tf +9 -0
- package/src/lint/post-synth/fixtures/TF026/live-explicit-delete/main.tf +13 -0
- package/src/lint/post-synth/fixtures/TF026/live-keep/main.tf +13 -0
- package/src/lint/post-synth/fixtures/load.ts +108 -0
- package/src/lint/post-synth/index.ts +48 -0
- package/src/lint/post-synth/module-rules.test.ts +153 -0
- package/src/lint/post-synth/module-source.test.ts +75 -0
- package/src/lint/post-synth/module-source.ts +121 -0
- package/src/lint/post-synth/post-synth.test.ts +14 -15
- package/src/lint/post-synth/scope.ts +107 -0
- package/src/lint/post-synth/single-block.test.ts +263 -0
- package/src/lint/post-synth/suppression.test.ts +110 -0
- package/src/lint/post-synth/tf001.ts +32 -8
- package/src/lint/post-synth/tf002.test.ts +93 -0
- package/src/lint/post-synth/tf002.ts +151 -0
- package/src/lint/post-synth/tf003.test.ts +75 -0
- package/src/lint/post-synth/tf003.ts +71 -0
- package/src/lint/post-synth/tf004.test.ts +47 -0
- package/src/lint/post-synth/tf004.ts +63 -0
- package/src/lint/post-synth/tf005.test.ts +57 -0
- package/src/lint/post-synth/tf005.ts +76 -0
- package/src/lint/post-synth/tf006.ts +53 -0
- package/src/lint/post-synth/tf007.ts +78 -0
- package/src/lint/post-synth/tf008.ts +75 -0
- package/src/lint/post-synth/tf009.ts +59 -0
- package/src/lint/post-synth/tf010.ts +51 -0
- package/src/lint/post-synth/tf011.ts +49 -0
- package/src/lint/post-synth/tf012.ts +47 -0
- package/src/lint/post-synth/tf013.ts +63 -0
- package/src/lint/post-synth/tf014.ts +72 -0
- package/src/lint/post-synth/tf015.ts +63 -0
- package/src/lint/post-synth/tf016.ts +75 -0
- package/src/lint/post-synth/tf017.ts +50 -0
- package/src/lint/post-synth/tf018.ts +72 -0
- package/src/lint/post-synth/tf019.ts +72 -0
- package/src/lint/post-synth/tf020.ts +123 -0
- package/src/lint/post-synth/tf021.ts +126 -0
- package/src/lint/post-synth/tf022.ts +61 -0
- package/src/lint/post-synth/tf024.test.ts +42 -0
- package/src/lint/post-synth/tf024.ts +70 -0
- package/src/lint/post-synth/tf025.test.ts +46 -0
- package/src/lint/post-synth/tf025.ts +101 -0
- package/src/lint/post-synth/tf026.test.ts +56 -0
- package/src/lint/post-synth/tf026.ts +80 -0
- package/src/lint/presets.test.ts +72 -0
- package/src/lint/rules/fixtures/TF101/negative-op.ts +2 -0
- package/src/lint/rules/fixtures/TF101/positive-op.ts +2 -0
- package/src/lint/rules/fixtures/load.ts +53 -0
- package/src/lint/rules/plan-before-apply.test.ts +112 -7
- package/src/lint/rules/plan-before-apply.ts +11 -0
- package/src/lint/secret-shape.test.ts +150 -0
- package/src/lint/secret-shape.ts +159 -0
- package/src/live-ownership.ts +60 -0
- package/src/lsp/completions.test.ts +3 -2
- package/src/lsp/option-keys.ts +10 -5
- package/src/op/activities/choudoufu.acceptance.test.ts +143 -0
- package/src/op/activities/choudoufu.test.ts +693 -0
- package/src/op/activities/index.ts +40 -4
- package/src/op/activities/live-detect.test.ts +143 -0
- package/src/op/activities/live-detect.ts +162 -0
- package/src/op/activities/registry.test.ts +11 -3
- package/src/op/activities/terraform.test.ts +7 -3
- package/src/op/activities/terraform.ts +823 -69
- package/src/op/activity-contracts.test.ts +147 -0
- package/src/op/activity-contracts.ts +178 -0
- package/src/op/adoption.test.ts +170 -0
- package/src/op/adoption.ts +241 -0
- package/src/op/builders.test.ts +60 -5
- package/src/op/builders.ts +93 -5
- package/src/op/resolve-root-mode.test.ts +85 -0
- package/src/op/resolve-root-mode.ts +72 -0
- package/src/plugin.test.ts +68 -0
- package/src/plugin.ts +75 -9
- package/src/skills/chant-terraform.md +1 -1
package/src/plugin.test.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { terraformPlugin } from "./plugin";
|
|
|
9
9
|
import { terraformConfigSchema } from "./config";
|
|
10
10
|
import {
|
|
11
11
|
DATA_TYPE,
|
|
12
|
+
LIVE_TYPE,
|
|
12
13
|
PROVIDER_TYPE,
|
|
13
14
|
RESOURCE_TYPE,
|
|
14
15
|
TERRAFORM_TYPE,
|
|
@@ -57,6 +58,12 @@ describe("terraform plugin", () => {
|
|
|
57
58
|
expect(terraformPlugin.postSynthChecks?.().length).toBeGreaterThan(0);
|
|
58
59
|
});
|
|
59
60
|
|
|
61
|
+
it("registers the estate-wide reads a live root makes possible (#2104)", () => {
|
|
62
|
+
expect(terraformPlugin.ambientKinds?.()).toEqual(["Terraform::Resource"]);
|
|
63
|
+
expect(typeof terraformPlugin.observeAmbient).toBe("function");
|
|
64
|
+
expect(typeof terraformPlugin.teardownOwned).toBe("function");
|
|
65
|
+
});
|
|
66
|
+
|
|
60
67
|
it("registers the LSP providers and docs", () => {
|
|
61
68
|
expect(typeof terraformPlugin.completionProvider).toBe("function");
|
|
62
69
|
expect(typeof terraformPlugin.hoverProvider).toBe("function");
|
|
@@ -227,6 +234,67 @@ describe("buildRoots", () => {
|
|
|
227
234
|
});
|
|
228
235
|
});
|
|
229
236
|
|
|
237
|
+
describe("buildRoots: choudoufu live mode (#2103)", () => {
|
|
238
|
+
it("marks every entity live and carries the estate, under binary: choudoufu", async () => {
|
|
239
|
+
const { entities, warnings } = await buildRoots(fixtures, {
|
|
240
|
+
terraform: { binary: "choudoufu", roots: { estate: { dir: "./live" } } },
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
expect(warnings ?? []).toEqual([]);
|
|
244
|
+
expect([...entities.keys()].sort()).toEqual([
|
|
245
|
+
"estate/live",
|
|
246
|
+
"estate/null_resource.first",
|
|
247
|
+
"estate/null_resource.second",
|
|
248
|
+
"estate/provider.null",
|
|
249
|
+
"estate/terraform",
|
|
250
|
+
]);
|
|
251
|
+
|
|
252
|
+
const live = entities.get("estate/live")!;
|
|
253
|
+
expect(live.entityType).toBe(LIVE_TYPE);
|
|
254
|
+
for (const key of entities.keys()) {
|
|
255
|
+
const props = propsOf(entities.get(key));
|
|
256
|
+
expect(props.mode).toBe("live");
|
|
257
|
+
expect(props.estate).toBe("fixture-estate");
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
it("reads the estate from the estate.chdf.hcl sidecar the same way", async () => {
|
|
262
|
+
const { entities, warnings } = await buildRoots(fixtures, {
|
|
263
|
+
terraform: { binary: "choudoufu", roots: { estate: { dir: "./live-sidecar" } } },
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
expect(warnings ?? []).toEqual([]);
|
|
267
|
+
const live = entities.get("estate/live")!;
|
|
268
|
+
expect(live.entityType).toBe(LIVE_TYPE);
|
|
269
|
+
expect(propsOf(live).file).toBe("estate.chdf.hcl");
|
|
270
|
+
expect(propsOf(entities.get("estate/terraform")).estate).toBe("fixture-estate");
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
it("stays state mode and warns when the estate is declared but the binary is not choudoufu", async () => {
|
|
274
|
+
const { entities, warnings } = await buildRoots(fixtures, {
|
|
275
|
+
terraform: { roots: { estate: { dir: "./live" } } },
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
for (const key of entities.keys()) {
|
|
279
|
+
const props = propsOf(entities.get(key));
|
|
280
|
+
expect(props.mode).toBe("state");
|
|
281
|
+
expect(props.estate).toBeUndefined();
|
|
282
|
+
}
|
|
283
|
+
expect(warnings).toHaveLength(1);
|
|
284
|
+
expect(warnings![0]).toContain("terraform.roots.estate");
|
|
285
|
+
expect(warnings![0]).toContain("inert");
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
it("stays state mode with no live declaration at all, regardless of binary", async () => {
|
|
289
|
+
const { entities, warnings } = await buildRoots(fixtures, {
|
|
290
|
+
terraform: { binary: "choudoufu", roots: { app: { dir: "./with-backend" } } },
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
expect(warnings ?? []).toEqual([]);
|
|
294
|
+
expect(propsOf(entities.get("app/terraform")).mode).toBe("state");
|
|
295
|
+
});
|
|
296
|
+
});
|
|
297
|
+
|
|
230
298
|
describe("auditEntities (#2085, parse-to-graph for chant audit)", () => {
|
|
231
299
|
it("parses a joined `# file:` bundle into entities", async () => {
|
|
232
300
|
const hook = terraformPlugin.auditEntities;
|
package/src/plugin.ts
CHANGED
|
@@ -5,12 +5,13 @@ import { createSkillsLoader } from "@intentius/chant/lexicon-plugin-helpers";
|
|
|
5
5
|
import { terraformSerializer } from "./serializer";
|
|
6
6
|
import { rules } from "./lint/rules";
|
|
7
7
|
import { postSynthChecks } from "./lint/post-synth";
|
|
8
|
+
import { withCallersChain } from "./lint/post-synth/scope";
|
|
8
9
|
import { terraformAuditCatalog } from "./lint/audit-catalog";
|
|
9
10
|
import { completions } from "./lsp/completions";
|
|
10
11
|
import { hover } from "./lsp/hover";
|
|
11
12
|
import { terraformConfigSchema, type TerraformConfig } from "./config";
|
|
12
13
|
import { renderTerraformRoots } from "./hcl/roots";
|
|
13
|
-
import { parseTerraformRootContent } from "./hcl/parse";
|
|
14
|
+
import { parseTerraformRootContent, RESOURCE_TYPE } from "./hcl/parse";
|
|
14
15
|
import { TERRAFORM_STATE_OWNERSHIP_KEYS } from "./state-ownership";
|
|
15
16
|
|
|
16
17
|
const loadSkills = createSkillsLoader(import.meta.url, [
|
|
@@ -70,11 +71,19 @@ export const terraformPlugin: LexiconPlugin = {
|
|
|
70
71
|
// ── Optional extensions ────────────────────────────────────
|
|
71
72
|
|
|
72
73
|
/**
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
74
|
+
* The ownership channel is per mode, and the channel declared here names
|
|
75
|
+
* the stock one, because a project's roots are stock unless it opts into
|
|
76
|
+
* choudoufu.
|
|
77
|
+
*
|
|
78
|
+
* On a stock root the channel is the state file, not a tag or a label
|
|
79
|
+
* (#2087): every address `terraform show -json` returns is `owned` and
|
|
80
|
+
* everything else is `unknown`. On a live root (#2104) it is choudoufu's
|
|
81
|
+
* two marker tags, `./live-ownership.ts`'s `TERRAFORM_LIVE_MARKER_KEYS`,
|
|
82
|
+
* and the verdicts come from `live-plan -json`'s own sections. Both
|
|
83
|
+
* readings resolve a real verdict on this path, which is what declaring
|
|
84
|
+
* `describeResources` here claims and what the conformance suite checks,
|
|
85
|
+
* for both modes. See `./describe-resources.ts` and
|
|
86
|
+
* `docs/pages/observation.mdx`.
|
|
78
87
|
*/
|
|
79
88
|
ownershipChannel: {
|
|
80
89
|
keys: TERRAFORM_STATE_OWNERSHIP_KEYS,
|
|
@@ -86,6 +95,26 @@ export const terraformPlugin: LexiconPlugin = {
|
|
|
86
95
|
return describeResources(options);
|
|
87
96
|
},
|
|
88
97
|
|
|
98
|
+
/**
|
|
99
|
+
* The kinds a live root can enumerate beyond its declaration (#1278,
|
|
100
|
+
* #2104). Empty on a project with no live root, because `live-ls` is the
|
|
101
|
+
* only estate-wide read this lexicon has and a stock root has none: a state
|
|
102
|
+
* file knows what it created and nothing else.
|
|
103
|
+
*/
|
|
104
|
+
ambientKinds() {
|
|
105
|
+
return [RESOURCE_TYPE];
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
async observeAmbient(options) {
|
|
109
|
+
const { observeAmbient } = await import("./describe-resources");
|
|
110
|
+
return observeAmbient(options);
|
|
111
|
+
},
|
|
112
|
+
|
|
113
|
+
async teardownOwned(options) {
|
|
114
|
+
const { teardownOwned } = await import("./describe-resources");
|
|
115
|
+
return teardownOwned(options);
|
|
116
|
+
},
|
|
117
|
+
|
|
89
118
|
/**
|
|
90
119
|
* Each entry in `terraform.roots` is a root module directory that parses at
|
|
91
120
|
* build time into one entity per HCL block. The render lives in
|
|
@@ -93,23 +122,49 @@ export const terraformPlugin: LexiconPlugin = {
|
|
|
93
122
|
* project root, which is what relative `dir` paths resolve against.
|
|
94
123
|
*/
|
|
95
124
|
async buildRoots(ctx): Promise<{ entities: Map<string, Declarable>; warnings: string[] }> {
|
|
96
|
-
const
|
|
125
|
+
const namespace = (ctx.config as { terraform?: TerraformConfig }).terraform;
|
|
126
|
+
const roots = namespace?.roots ?? {};
|
|
97
127
|
if (Object.keys(roots).length === 0) return { entities: new Map(), warnings: [] };
|
|
98
|
-
return renderTerraformRoots({
|
|
128
|
+
return renderTerraformRoots({
|
|
129
|
+
projectRoot: ctx.projectRoot,
|
|
130
|
+
roots,
|
|
131
|
+
binary: namespace?.binary,
|
|
132
|
+
callModuleType: namespace?.callModuleType,
|
|
133
|
+
});
|
|
99
134
|
},
|
|
100
135
|
|
|
101
136
|
lintRules() {
|
|
102
137
|
return rules;
|
|
103
138
|
},
|
|
104
139
|
|
|
140
|
+
/**
|
|
141
|
+
* The generated barrel of checks, each wrapped so a finding inside a
|
|
142
|
+
* descended child module names the call chain that reached it (#2112). See
|
|
143
|
+
* `./lint/post-synth/scope.ts`.
|
|
144
|
+
*/
|
|
105
145
|
postSynthChecks() {
|
|
106
|
-
return postSynthChecks;
|
|
146
|
+
return withCallersChain(postSynthChecks);
|
|
107
147
|
},
|
|
108
148
|
|
|
109
149
|
auditCatalog() {
|
|
110
150
|
return terraformAuditCatalog;
|
|
111
151
|
},
|
|
112
152
|
|
|
153
|
+
/**
|
|
154
|
+
* `recommended`/`all` (chant #2113), the tflint-ruleset-terraform shape:
|
|
155
|
+
* `recommended` is every `merge-worthy` TF rule (a correctness/security
|
|
156
|
+
* finding worth reporting by default), `all` adds the `report-only` ones
|
|
157
|
+
* (hygiene the family grows into as #2109/#2110/#2112 land). Derived from
|
|
158
|
+
* `terraformAuditCatalog` rather than a hand-kept id list, so a rule that
|
|
159
|
+
* lands in a later, parallel issue is picked up automatically the moment
|
|
160
|
+
* its catalog entry ships, with no second list to fall out of sync.
|
|
161
|
+
*/
|
|
162
|
+
lintPresets() {
|
|
163
|
+
const ids = Object.keys(terraformAuditCatalog);
|
|
164
|
+
const recommended = ids.filter((id) => terraformAuditCatalog[id].tier === "merge-worthy");
|
|
165
|
+
return { recommended, all: ids };
|
|
166
|
+
},
|
|
167
|
+
|
|
113
168
|
/**
|
|
114
169
|
* Parse-to-graph for `chant audit` (#1567, #2085). `content` is the
|
|
115
170
|
* `# file: <name>`-joined bundle discovery builds for one discovered root
|
|
@@ -119,6 +174,17 @@ export const terraformPlugin: LexiconPlugin = {
|
|
|
119
174
|
* the root name to group and de-duplicate diagnostics within one parse, so
|
|
120
175
|
* this is enough for the same graph-reading check that fires on `chant
|
|
121
176
|
* build` to fire here too. Never throws: malformed HCL yields an empty map.
|
|
177
|
+
*
|
|
178
|
+
* Module descent (#2112) reaches this path through the same
|
|
179
|
+
* `blocksToEntities`, but finds nothing to descend into: this hook is
|
|
180
|
+
* handed one directory's joined text and no directory to read a local
|
|
181
|
+
* module's files from, and audit discovery has already classified every
|
|
182
|
+
* nested `.tf` directory as an audit input of its own (`classifyTerraform`,
|
|
183
|
+
* `packages/core/src/audit/discover.ts`). So a child module IS audited on
|
|
184
|
+
* this path, as its own root rather than as a child scope, which means the
|
|
185
|
+
* two rules that ask "is this block inside a child module?" (TF014, TF015)
|
|
186
|
+
* report on `chant build` and not in `chant audit`, and TF020 answers per
|
|
187
|
+
* directory either way. The rule pages say so.
|
|
122
188
|
*/
|
|
123
189
|
async auditEntities(content: string): Promise<Map<string, Declarable>> {
|
|
124
190
|
try {
|
|
@@ -65,7 +65,7 @@ export const { op } = TerraformApplyOp({
|
|
|
65
65
|
});
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
`gate: "never"`
|
|
68
|
+
`gate: "never"` drops the Gate phase, so `chant run` walks straight from Plan to Apply; any other mode emits a Gate phase, and a run that reaches an unapproved gate records a pending fact on the gate ledger, ends `gated` and exits 3 until someone runs `chant approve <op> <gate>`. The Gate phase always shows the saved plan first and reports its `destroys` count as a `Destroys` run outcome, because `GateStep` carries no condition to branch on at build time — the approver sees what's at stake before approving, rather than the Op deciding for them.
|
|
69
69
|
|
|
70
70
|
Terraform has no automatic rollback, so `compensate: true` with no command throws at build time, naming the Op, rather than warning once an apply has already half-run:
|
|
71
71
|
|