@intentius/chant-lexicon-terraform 0.124.54 → 0.124.56
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/README.md +7 -4
- package/dist/ci-setup.d.ts +11 -0
- package/dist/ci-setup.d.ts.map +1 -0
- package/dist/ci-setup.js +41 -0
- package/dist/components/capability-plugin.d.ts +40 -6
- package/dist/components/capability-plugin.d.ts.map +1 -1
- package/dist/components/capability-plugin.js +174 -30
- package/dist/components/compose-group.d.ts +1 -1
- package/dist/components/compose-group.d.ts.map +1 -1
- package/dist/components/compose-group.js +1 -1
- package/dist/components/release-inputs.d.ts +29 -0
- package/dist/components/release-inputs.d.ts.map +1 -0
- package/dist/components/release-inputs.js +57 -0
- package/dist/components/trace-facts.d.ts +16 -0
- package/dist/components/trace-facts.d.ts.map +1 -0
- package/dist/components/trace-facts.js +19 -0
- package/dist/cone.d.ts +53 -0
- package/dist/cone.d.ts.map +1 -0
- package/dist/cone.js +119 -0
- package/dist/cost-hold.d.ts +27 -0
- package/dist/cost-hold.d.ts.map +1 -0
- package/dist/cost-hold.js +21 -0
- package/dist/drift-rows.d.ts +61 -0
- package/dist/drift-rows.d.ts.map +1 -0
- package/dist/drift-rows.js +108 -0
- package/dist/exit-codes.d.ts +55 -0
- package/dist/exit-codes.d.ts.map +1 -0
- package/dist/exit-codes.js +48 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/integrity.json +7 -4
- package/dist/lint/audit-catalog.d.ts.map +1 -1
- package/dist/lint/audit-catalog.js +27 -3
- package/dist/lint/audit-lineage.d.ts +14 -2
- package/dist/lint/audit-lineage.d.ts.map +1 -1
- package/dist/lint/post-synth/index.d.ts.map +1 -1
- package/dist/lint/post-synth/index.js +4 -0
- package/dist/lint/post-synth/record-store.d.ts +54 -0
- package/dist/lint/post-synth/record-store.d.ts.map +1 -0
- package/dist/lint/post-synth/record-store.js +104 -0
- package/dist/lint/post-synth/tf001.d.ts +2 -2
- package/dist/lint/post-synth/tf001.js +2 -2
- package/dist/lint/post-synth/tf024.d.ts +35 -11
- package/dist/lint/post-synth/tf024.d.ts.map +1 -1
- package/dist/lint/post-synth/tf024.js +92 -20
- package/dist/lint/post-synth/tf046.d.ts +64 -0
- package/dist/lint/post-synth/tf046.d.ts.map +1 -0
- package/dist/lint/post-synth/tf046.js +175 -0
- package/dist/lint/post-synth/tf047.d.ts +36 -0
- package/dist/lint/post-synth/tf047.d.ts.map +1 -0
- package/dist/lint/post-synth/tf047.js +94 -0
- package/dist/lock-rows.d.ts +36 -0
- package/dist/lock-rows.d.ts.map +1 -0
- package/dist/lock-rows.js +60 -0
- package/dist/lock-timeout.d.ts +22 -0
- package/dist/lock-timeout.d.ts.map +1 -0
- package/dist/lock-timeout.js +32 -0
- package/dist/manifest.json +1 -1
- package/dist/module-catalog/index.d.ts +69 -0
- package/dist/module-catalog/index.d.ts.map +1 -0
- package/dist/module-catalog/index.js +110 -0
- package/dist/module-catalog/refresh-cli.d.ts +4 -0
- package/dist/module-catalog/refresh-cli.d.ts.map +1 -0
- package/dist/module-catalog/refresh-cli.js +64 -0
- package/dist/module-catalog/static-tier.d.ts +6 -0
- package/dist/module-catalog/static-tier.d.ts.map +1 -0
- package/dist/module-catalog/static-tier.js +1650 -0
- package/dist/module-catalog/types.d.ts +65 -0
- package/dist/module-catalog/types.d.ts.map +1 -0
- package/dist/module-catalog/types.js +33 -0
- package/dist/okf/index.md +3 -1
- package/dist/okf/rules/TF024.md +2 -2
- package/dist/okf/rules/TF046.md +11 -0
- package/dist/okf/rules/TF047.md +11 -0
- package/dist/op/activities/terraform.d.ts +29 -0
- package/dist/op/activities/terraform.d.ts.map +1 -1
- package/dist/op/activities/terraform.js +19 -4
- package/dist/pin/consumers.d.ts +35 -0
- package/dist/pin/consumers.d.ts.map +1 -0
- package/dist/pin/consumers.js +70 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +5 -0
- package/dist/registry/address.d.ts +63 -0
- package/dist/registry/address.d.ts.map +1 -0
- package/dist/registry/address.js +65 -0
- package/dist/registry/catalog-read.d.ts +14 -0
- package/dist/registry/catalog-read.d.ts.map +1 -0
- package/dist/registry/catalog-read.js +58 -0
- package/dist/registry/deprecated.d.ts +37 -0
- package/dist/registry/deprecated.d.ts.map +1 -0
- package/dist/registry/deprecated.js +43 -0
- package/dist/registry/docs.d.ts +96 -0
- package/dist/registry/docs.d.ts.map +1 -0
- package/dist/registry/docs.js +210 -0
- package/dist/registry/edge/edge.d.ts +46 -0
- package/dist/registry/edge/edge.d.ts.map +1 -0
- package/dist/registry/edge/edge.js +194 -0
- package/dist/registry/edge/index.d.ts +11 -0
- package/dist/registry/edge/index.d.ts.map +1 -0
- package/dist/registry/edge/index.js +10 -0
- package/dist/registry/edge/lambda-edge.d.ts +76 -0
- package/dist/registry/edge/lambda-edge.d.ts.map +1 -0
- package/dist/registry/edge/lambda-edge.js +95 -0
- package/dist/registry/edge/sigv4-web.d.ts +33 -0
- package/dist/registry/edge/sigv4-web.d.ts.map +1 -0
- package/dist/registry/edge/sigv4-web.js +56 -0
- package/dist/registry/edge/token-source.d.ts +73 -0
- package/dist/registry/edge/token-source.d.ts.map +1 -0
- package/dist/registry/edge/token-source.js +115 -0
- package/dist/registry/edge/worker.d.ts +45 -0
- package/dist/registry/edge/worker.d.ts.map +1 -0
- package/dist/registry/edge/worker.js +26 -0
- package/dist/registry/handler.d.ts +25 -0
- package/dist/registry/handler.d.ts.map +1 -0
- package/dist/registry/handler.js +75 -0
- package/dist/registry/headers-file.d.ts +21 -0
- package/dist/registry/headers-file.d.ts.map +1 -0
- package/dist/registry/headers-file.js +57 -0
- package/dist/registry/index.d.ts +31 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/index.js +30 -0
- package/dist/registry/mirror-paths.d.ts +9 -0
- package/dist/registry/mirror-paths.d.ts.map +1 -0
- package/dist/registry/mirror-paths.js +8 -0
- package/dist/registry/mirror.d.ts +130 -0
- package/dist/registry/mirror.d.ts.map +1 -0
- package/dist/registry/mirror.js +319 -0
- package/dist/registry/proxies.d.ts +73 -0
- package/dist/registry/proxies.d.ts.map +1 -0
- package/dist/registry/proxies.js +111 -0
- package/dist/registry/reader.d.ts +57 -0
- package/dist/registry/reader.d.ts.map +1 -0
- package/dist/registry/reader.js +198 -0
- package/dist/registry/semver.d.ts +16 -0
- package/dist/registry/semver.d.ts.map +1 -0
- package/dist/registry/semver.js +24 -0
- package/dist/registry/serve.d.ts +24 -0
- package/dist/registry/serve.d.ts.map +1 -0
- package/dist/registry/serve.js +64 -0
- package/dist/registry/source-forms.d.ts +79 -0
- package/dist/registry/source-forms.d.ts.map +1 -0
- package/dist/registry/source-forms.js +202 -0
- package/dist/registry/targets/artifactory.d.ts +28 -0
- package/dist/registry/targets/artifactory.d.ts.map +1 -0
- package/dist/registry/targets/artifactory.js +206 -0
- package/dist/registry/targets/fake-artifactory.d.ts +30 -0
- package/dist/registry/targets/fake-artifactory.d.ts.map +1 -0
- package/dist/registry/targets/fake-artifactory.js +142 -0
- package/dist/registry/targets/fake-gitlab.d.ts +39 -0
- package/dist/registry/targets/fake-gitlab.d.ts.map +1 -0
- package/dist/registry/targets/fake-gitlab.js +136 -0
- package/dist/registry/targets/fake-hcp.d.ts +50 -0
- package/dist/registry/targets/fake-hcp.d.ts.map +1 -0
- package/dist/registry/targets/fake-hcp.js +202 -0
- package/dist/registry/targets/fake-http.d.ts +31 -0
- package/dist/registry/targets/fake-http.d.ts.map +1 -0
- package/dist/registry/targets/fake-http.js +87 -0
- package/dist/registry/targets/fake-nexus.d.ts +27 -0
- package/dist/registry/targets/fake-nexus.d.ts.map +1 -0
- package/dist/registry/targets/fake-nexus.js +137 -0
- package/dist/registry/targets/gitlab.d.ts +53 -0
- package/dist/registry/targets/gitlab.d.ts.map +1 -0
- package/dist/registry/targets/gitlab.js +187 -0
- package/dist/registry/targets/hcp.d.ts +29 -0
- package/dist/registry/targets/hcp.d.ts.map +1 -0
- package/dist/registry/targets/hcp.js +310 -0
- package/dist/registry/targets/hosted.d.ts +62 -0
- package/dist/registry/targets/hosted.d.ts.map +1 -0
- package/dist/registry/targets/hosted.js +74 -0
- package/dist/registry/targets/index.d.ts +18 -0
- package/dist/registry/targets/index.d.ts.map +1 -0
- package/dist/registry/targets/index.js +17 -0
- package/dist/registry/targets/module-target.d.ts +68 -0
- package/dist/registry/targets/module-target.d.ts.map +1 -0
- package/dist/registry/targets/module-target.js +63 -0
- package/dist/registry/targets/nexus.d.ts +43 -0
- package/dist/registry/targets/nexus.d.ts.map +1 -0
- package/dist/registry/targets/nexus.js +250 -0
- package/dist/registry/targets/zip.d.ts +55 -0
- package/dist/registry/targets/zip.d.ts.map +1 -0
- package/dist/registry/targets/zip.js +278 -0
- package/dist/registry/writer.d.ts +101 -0
- package/dist/registry/writer.d.ts.map +1 -0
- package/dist/registry/writer.js +109 -0
- package/dist/rules/record-store.ts +122 -0
- package/dist/rules/tf001.ts +2 -2
- package/dist/rules/tf024.ts +105 -22
- package/dist/rules/tf046.ts +204 -0
- package/dist/rules/tf047.ts +114 -0
- package/dist/state/azure-blob.d.ts +8 -67
- package/dist/state/azure-blob.d.ts.map +1 -1
- package/dist/state/azure-blob.js +6 -199
- package/dist/state/gcs.d.ts +7 -61
- package/dist/state/gcs.d.ts.map +1 -1
- package/dist/state/gcs.js +5 -222
- package/dist/state/object-store.d.ts +4 -33
- package/dist/state/object-store.d.ts.map +1 -1
- package/dist/state/object-store.js +4 -17
- package/dist/state/s3.d.ts +11 -58
- package/dist/state/s3.d.ts.map +1 -1
- package/dist/state/s3.js +10 -161
- package/dist/state/store.js +2 -2
- package/dist/state-ops.d.ts +255 -0
- package/dist/state-ops.d.ts.map +1 -0
- package/dist/state-ops.js +305 -0
- package/dist/state-reads.d.ts +57 -0
- package/dist/state-reads.d.ts.map +1 -0
- package/dist/state-reads.js +104 -0
- package/dist/used-sources.d.ts +54 -0
- package/dist/used-sources.d.ts.map +1 -0
- package/dist/used-sources.js +157 -0
- package/package.json +19 -3
- package/src/__fixtures__/drift-record/README.md +5 -0
- package/src/__fixtures__/drift-rows/live-root-plan.json +70 -0
- package/src/__fixtures__/drift-rows/refresh-plan.json +61 -0
- package/src/__fixtures__/used-sources/root/extra.tofu +1 -0
- package/src/__fixtures__/used-sources/root/main.tf +31 -0
- package/src/__fixtures__/used-sources/root/modules/net/main.tf +14 -0
- package/src/__fixtures__/used-sources/root/modules/net/versions.tf.json +7 -0
- package/src/__fixtures__/used-sources/unit/terragrunt.hcl +3 -0
- package/src/ci-setup.ts +42 -0
- package/src/components/capability-plugin.test.ts +26 -14
- package/src/components/capability-plugin.ts +185 -31
- package/src/components/compose-group.ts +1 -1
- package/src/components/pr-loop-compose.tofu.e2e.test.ts +1 -1
- package/src/components/pr-loop.tofu.test.ts +1 -1
- package/src/components/release-inputs.ts +69 -0
- package/src/components/trace-facts.test.ts +21 -0
- package/src/components/trace-facts.ts +27 -0
- package/src/cone.ts +138 -0
- package/src/cost-hold.ts +29 -0
- package/src/describe-resources.engine-facts.test.ts +2 -3
- package/src/drift-rows.test.ts +135 -0
- package/src/drift-rows.ts +137 -0
- package/src/exit-codes.test.ts +23 -0
- package/src/exit-codes.ts +59 -0
- package/src/index.ts +3 -0
- package/src/lint/audit-catalog.ts +29 -3
- package/src/lint/audit-lineage.ts +14 -2
- package/src/lint/post-synth/fixtures/TF024/live-with-record-store/main.tf +18 -0
- package/src/lint/post-synth/fixtures/TF024/sidecar-with-backend/estate.chdf.hcl +1 -0
- package/src/lint/post-synth/fixtures/TF024/sidecar-with-backend/main.tf +10 -0
- package/src/lint/post-synth/fixtures/TF046/azurerm-no-resource-group/main.tf +15 -0
- package/src/lint/post-synth/fixtures/TF046/backend-config-only/main.tf +14 -0
- package/src/lint/post-synth/fixtures/TF046/derived-s3/backend.tf +7 -0
- package/src/lint/post-synth/fixtures/TF046/derived-s3/main.tf +9 -0
- package/src/lint/post-synth/fixtures/TF046/explicit-local/main.tf +16 -0
- package/src/lint/post-synth/fixtures/TF046/explicit-s3-beside-local-backend/main.tf +15 -0
- package/src/lint/post-synth/fixtures/TF046/implied-local/main.tf +9 -0
- package/src/lint/post-synth/fixtures/TF046/sidecar-implied/estate.chdf.hcl +1 -0
- package/src/lint/post-synth/fixtures/TF046/sidecar-implied/main.tf +5 -0
- package/src/lint/post-synth/fixtures/TF047/clear/main.tf +12 -0
- package/src/lint/post-synth/fixtures/TF047/refused/main.tf +12 -0
- package/src/lint/post-synth/fixtures/TF047/unknown-module/main.tf +12 -0
- package/src/lint/post-synth/fixtures/TF047/unknown-version/main.tf +12 -0
- package/src/lint/post-synth/index.ts +4 -0
- package/src/lint/post-synth/record-store.ts +122 -0
- package/src/lint/post-synth/tf001.ts +2 -2
- package/src/lint/post-synth/tf024.test.ts +26 -5
- package/src/lint/post-synth/tf024.ts +105 -22
- package/src/lint/post-synth/tf046.test.ts +137 -0
- package/src/lint/post-synth/tf046.ts +204 -0
- package/src/lint/post-synth/tf047.test.ts +56 -0
- package/src/lint/post-synth/tf047.ts +114 -0
- package/src/lock-rows.test.ts +70 -0
- package/src/lock-rows.ts +82 -0
- package/src/lock-timeout.ts +34 -0
- package/src/module-catalog/index.test.ts +93 -0
- package/src/module-catalog/index.ts +159 -0
- package/src/module-catalog/refresh-cli.ts +68 -0
- package/src/module-catalog/static-tier.ts +1659 -0
- package/src/module-catalog/types.ts +88 -0
- package/src/op/activities/terraform.ts +46 -5
- package/src/op-wave-step.test.ts +109 -0
- package/src/pin/__fixtures__/consumers/live/dev/main.tf +4 -0
- package/src/pin/__fixtures__/consumers/live/prod/main.tf +21 -0
- package/src/pin/__fixtures__/consumers/units/vpc/terragrunt.hcl +7 -0
- package/src/pin/consumers.test.ts +57 -0
- package/src/pin/consumers.ts +95 -0
- package/src/plugin.ts +6 -0
- package/src/registry/__fixtures__/docs/documented/.terraform-docs.yml +3 -0
- package/src/registry/__fixtures__/docs/documented/README.md +1 -0
- package/src/registry/__fixtures__/docs/documented/main.tf +8 -0
- package/src/registry/__fixtures__/docs/json/main.tf.json +14 -0
- package/src/registry/__fixtures__/docs/vpc/README.md +3 -0
- package/src/registry/__fixtures__/docs/vpc/examples/complete/main.tf +5 -0
- package/src/registry/__fixtures__/docs/vpc/examples/simple/README.md +1 -0
- package/src/registry/__fixtures__/docs/vpc/examples/simple/main.tf +4 -0
- package/src/registry/__fixtures__/docs/vpc/main.tf +14 -0
- package/src/registry/__fixtures__/docs/vpc/outputs.tf +9 -0
- package/src/registry/__fixtures__/docs/vpc/variables.tf +16 -0
- package/src/registry/__fixtures__/proxied-root/main.tf +12 -0
- package/src/registry/address.ts +100 -0
- package/src/registry/catalog-read.ts +56 -0
- package/src/registry/deprecated.test.ts +139 -0
- package/src/registry/deprecated.ts +76 -0
- package/src/registry/docs.test.ts +140 -0
- package/src/registry/docs.ts +299 -0
- package/src/registry/edge/bundle.test.ts +50 -0
- package/src/registry/edge/edge.test.ts +176 -0
- package/src/registry/edge/edge.ts +211 -0
- package/src/registry/edge/index.ts +10 -0
- package/src/registry/edge/lambda-edge.ts +127 -0
- package/src/registry/edge/sigv4-web.ts +79 -0
- package/src/registry/edge/token-source.test.ts +258 -0
- package/src/registry/edge/token-source.ts +169 -0
- package/src/registry/edge/worker.ts +61 -0
- package/src/registry/handler.ts +89 -0
- package/src/registry/headers-file.ts +61 -0
- package/src/registry/index.ts +31 -0
- package/src/registry/mirror-paths.ts +10 -0
- package/src/registry/mirror.test.ts +198 -0
- package/src/registry/mirror.ts +395 -0
- package/src/registry/proxies.test.ts +153 -0
- package/src/registry/proxies.ts +132 -0
- package/src/registry/reader.ts +225 -0
- package/src/registry/registry.test.ts +262 -0
- package/src/registry/semver.ts +34 -0
- package/src/registry/serve.ts +82 -0
- package/src/registry/source-forms.test.ts +87 -0
- package/src/registry/source-forms.ts +216 -0
- package/src/registry/targets/artifactory.test.ts +248 -0
- package/src/registry/targets/artifactory.ts +257 -0
- package/src/registry/targets/fake-artifactory.ts +158 -0
- package/src/registry/targets/fake-gitlab.ts +161 -0
- package/src/registry/targets/fake-hcp.ts +233 -0
- package/src/registry/targets/fake-http.ts +97 -0
- package/src/registry/targets/fake-nexus.ts +152 -0
- package/src/registry/targets/gitlab.test.ts +208 -0
- package/src/registry/targets/gitlab.ts +223 -0
- package/src/registry/targets/hcp.test.ts +230 -0
- package/src/registry/targets/hcp.ts +360 -0
- package/src/registry/targets/hosted.ts +117 -0
- package/src/registry/targets/index.ts +17 -0
- package/src/registry/targets/module-target.ts +131 -0
- package/src/registry/targets/nexus.test.ts +220 -0
- package/src/registry/targets/nexus.ts +314 -0
- package/src/registry/targets/zip.test.ts +65 -0
- package/src/registry/targets/zip.ts +287 -0
- package/src/registry/writer.ts +155 -0
- package/src/state/azure-blob.ts +6 -221
- package/src/state/gcs.ts +5 -252
- package/src/state/object-store.ts +4 -32
- package/src/state/s3.ts +10 -182
- package/src/state/store.ts +2 -2
- package/src/state-ops.test.ts +182 -0
- package/src/state-ops.ts +462 -0
- package/src/state-reads.ts +116 -0
- package/src/used-sources.test.ts +75 -0
- package/src/used-sources.ts +204 -0
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAM3C,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,uBAAuB,EACvB,uBAAuB,EAEvB,qBAAqB,EACrB,6BAA6B,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,GAC9B,MAAM,gCAAgC,CAAC;AAIxC,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC/H,OAAO,EACL,SAAS,IAAI,iBAAiB,EAC9B,SAAS,EACT,UAAU,EACV,aAAa,EACb,mBAAmB,EACnB,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,0BAA0B,GAChC,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,qBAAqB,EAAE,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,KAAK,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC1J,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAG9F,OAAO,EACL,SAAS,EACT,qBAAqB,EACrB,cAAc,EACd,mBAAmB,EACnB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,GACtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAI3G,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,iBAAiB,GACvB,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,kBAAkB,EAAE,KAAK,yBAAyB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
|
package/dist/index.js
CHANGED
|
@@ -21,6 +21,7 @@ export { priorStateValues, stateResources, stateOutputs } from "./applied-state.
|
|
|
21
21
|
export { ComposedRun, composedPlanDigest, changesSomething, } from "./compose/run.js";
|
|
22
22
|
// The plan shape of a `show -json` plan (#4436), for core's `coveredRound`.
|
|
23
23
|
export { terraformPlanShape } from "./plan-shape.js";
|
|
24
|
+
export { terraformLockRows, terraformLockRowsFromPart, terraformDefaultLockGrain, terraformLockGrainRefusal } from "./lock-rows.js";
|
|
24
25
|
// Composed runs (#4419, #4438): which roots compose, in what order, and why
|
|
25
26
|
// the others fall back. Off unless `terraform.compose.enabled` is set.
|
|
26
27
|
export { compositionFor, compositionIfEnabled, composeOff, composeSet, readOrder, moduleNames, fallbackLine, withPlanFailed, identityKey, DEFAULT_COMPOSE_MAX, COMPOSE_STEP_KIND, } from "./compose.js";
|
|
@@ -63,3 +64,5 @@ export { TERRAFORM_STATE_OWNERSHIP_KEYS } from "./state-ownership.js";
|
|
|
63
64
|
// engine is injected, and defaults to core's front (#2495): this lexicon
|
|
64
65
|
// dials none.
|
|
65
66
|
export { predictTerraformBehaviour, terraformBehaviourRequest, terraformPredictOptionsFrom, TERRAFORM_REFERENCE_CATALOG, } from "./behaviour/index.js";
|
|
67
|
+
// terraform, tofu and choudoufu exit statuses on chant's exit-code table (#4553).
|
|
68
|
+
export { terraformExitOf, terraformPlanMoved } from "./exit-codes.js";
|
package/dist/integrity.json
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"algorithm": "sha256",
|
|
3
3
|
"artifacts": {
|
|
4
|
-
"manifest.json": "
|
|
4
|
+
"manifest.json": "fc7d3f91a4b8cbef48f1ef39e169b36d41f90bfe2b68ba0c46153dd5461efdcd",
|
|
5
5
|
"meta.json": "ca3d163bab055381827226140568f3bef7eaac187cebd76878e0b63e9e442356",
|
|
6
6
|
"types/index.d.ts": "022927e6a7b351cc4cf52d5f973f60ccd140e5810e17b32fb8868965aa1db161",
|
|
7
7
|
"rules/plan-before-apply.ts": "7c10245b2c3335253b48ee7d8b075d89f43116bde20313a5d1031b343fef1282",
|
|
8
8
|
"rules/blocks.ts": "d69f65c13b44ff425ccd465644f41c160e07b4c221bd60698d3ec84bf5d9cef8",
|
|
9
9
|
"rules/flat-attributes.ts": "135b4b118cb76ea7ef7a6f2851bb5c80d0907485b86a364c017f66388d0d4cb2",
|
|
10
10
|
"rules/module-source.ts": "9e6e8f47725c3a01ee8b65b7acff6fe902bf5fc638820efdb5721f4c6ea9d95c",
|
|
11
|
+
"rules/record-store.ts": "644ef9785ea9500e8945a181160aff1c4133ad895451413b40d293abc9620066",
|
|
11
12
|
"rules/scope.ts": "a6d327d821f219c98a9d4ae6e6eed6325f3d3edf6286f3622b41be591d190dc8",
|
|
12
13
|
"rules/terragrunt.ts": "1973dbee0933db9593347aa662c71b86f02302c19a28f5ecba23a694ca96641b",
|
|
13
|
-
"rules/tf001.ts": "
|
|
14
|
+
"rules/tf001.ts": "d0c20e9e70403ec79515114cc00dff8c599c372b343ff96beb951bb7b0dbf9ba",
|
|
14
15
|
"rules/tf002.ts": "6759fe5135c85ed9016adbddd90e77743cdf243b261a98deb38e907da83c6d25",
|
|
15
16
|
"rules/tf003.ts": "7b705a08f03769f353910e524bb3f1b4cc844bcb620e240a9063288d0fd60802",
|
|
16
17
|
"rules/tf004.ts": "59ef2108aa561cc6a40cd970fc54604be60872b51a035ed3bc3c53346a31d358",
|
|
@@ -32,7 +33,7 @@
|
|
|
32
33
|
"rules/tf020.ts": "2210815c355e37459c34de0fe622f0b87b78010ee7c444135cf5abf7e048adf7",
|
|
33
34
|
"rules/tf021.ts": "ad3cd813a289437d33da866927697077e7a5b20f3c05341325193d286b57bbd5",
|
|
34
35
|
"rules/tf022.ts": "5466797cd88fd5489f6c5abd1e796d7c5d3d0e977d0e9e043d253f6ecf369cdc",
|
|
35
|
-
"rules/tf024.ts": "
|
|
36
|
+
"rules/tf024.ts": "e82bb9d29fb1645823899fb03fcb0381ca2df11039f02609acee861013278724",
|
|
36
37
|
"rules/tf025.ts": "0c31be3885e940e2b3e9ac8e023067d8d6e2b42c04f628890405c9fc6db7d1ce",
|
|
37
38
|
"rules/tf026.ts": "8cf1e61bc9563aa2d3c149f243ffa02ad4f183eebb672f861cd6c4e6fba1d310",
|
|
38
39
|
"rules/tf027.ts": "0a6062a230cdaa707f82b2353be4b34dff81322d24075d46f732a47bcef15893",
|
|
@@ -54,7 +55,9 @@
|
|
|
54
55
|
"rules/tf043.ts": "c8724a7c0734870101d73e411ed97240c03a01a1133adbf0b445a5083f40faee",
|
|
55
56
|
"rules/tf044.ts": "4e9b17a6080074d2b2e02862a9f1c9c2baf0ef32d4f3b48df1e62d9d8c362008",
|
|
56
57
|
"rules/tf045.ts": "760b1f4f385fbe7a86897efe3078fdeac11bcc9bfb806285d63db50488174b7b",
|
|
58
|
+
"rules/tf046.ts": "d3de9a40366847a832a5ad739aa8c4411249aab36815f7eeb245f9b2fdb91e42",
|
|
59
|
+
"rules/tf047.ts": "bfa86f85c4c5efff297280fc2f15104d6319fa96dfc444a31829fb7353224092",
|
|
57
60
|
"skills/chant-terraform.md": "53dd11c7b289652f92fdaf2c03766abda46d8964e31fe709e8b142ced4f19c50"
|
|
58
61
|
},
|
|
59
|
-
"composite": "
|
|
62
|
+
"composite": "4ad36b947836a73adda4843346e414abf6ed9efe81fda791855d70f3143ed0f0"
|
|
60
63
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit-catalog.d.ts","sourceRoot":"","sources":["../../src/lint/audit-catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAa,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AA+D1E,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"audit-catalog.d.ts","sourceRoot":"","sources":["../../src/lint/audit-catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAa,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AA+D1E,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CA0f1D,CAAC"}
|
|
@@ -65,9 +65,10 @@ export const terraformAuditCatalog = {
|
|
|
65
65
|
tier: "merge-worthy",
|
|
66
66
|
fixKind: "guidance",
|
|
67
67
|
category: "correctness",
|
|
68
|
-
title: "Live root declares a backend or cloud block, which choudoufu
|
|
69
|
-
remediation: "
|
|
70
|
-
"
|
|
68
|
+
title: "Live root declares a backend or cloud block, which choudoufu ignores",
|
|
69
|
+
remediation: "Keep a `backend` block if other roots read this estate's outputs or the record store should be " +
|
|
70
|
+
"derived from its bucket; declare `record_store` to put records elsewhere. Remove a `cloud` block, " +
|
|
71
|
+
"which choudoufu drops entirely, or swap it for a `backend` block.",
|
|
71
72
|
yamlBased: false,
|
|
72
73
|
},
|
|
73
74
|
TF025: {
|
|
@@ -495,6 +496,29 @@ export const terraformAuditCatalog = {
|
|
|
495
496
|
remediation: 'Set `terragrunt_version_constraint = ">= 1.1.0"` in the root config. Off by default; judged only across the configs scanned.',
|
|
496
497
|
yamlBased: false,
|
|
497
498
|
},
|
|
499
|
+
TF046: {
|
|
500
|
+
id: "TF046",
|
|
501
|
+
tier: "report-only",
|
|
502
|
+
fixKind: "guidance",
|
|
503
|
+
category: "correctness",
|
|
504
|
+
title: "Live root resolves to the local record store in a CI run",
|
|
505
|
+
remediation: "Keep or add a `backend` block of type s3, gcs or azurerm with a literal bucket, so choudoufu " +
|
|
506
|
+
"derives the record store from it, or declare `record_store` in the live block or `estate.chdf.hcl`. " +
|
|
507
|
+
"The rule is off by default and terragucci turns it on for its users; an emulator or test lane " +
|
|
508
|
+
"that keeps the local store on purpose sets `CHANT_ALLOW_LOCAL_RECORD_STORE=1`.",
|
|
509
|
+
yamlBased: false,
|
|
510
|
+
},
|
|
511
|
+
TF047: {
|
|
512
|
+
id: "TF047",
|
|
513
|
+
tier: "report-only",
|
|
514
|
+
fixKind: "guidance",
|
|
515
|
+
category: "correctness",
|
|
516
|
+
title: "Live root pins a module version the known-module catalog has no row for, or one with refusals",
|
|
517
|
+
remediation: "Run `choudoufu live-check` on the root to see each refused site, or pin a version whose examples are clear in " +
|
|
518
|
+
"the static tier of choudoufu's module table (https://intentius.io/choudoufu/aws/compatibility/#modules). " +
|
|
519
|
+
"Off by default; terragucci turns it on for its users.",
|
|
520
|
+
yamlBased: false,
|
|
521
|
+
},
|
|
498
522
|
};
|
|
499
523
|
// Prior art credits, if any, live beside the rules in ./audit-lineage.ts (see
|
|
500
524
|
// core audit/prior-art.ts).
|
|
@@ -76,8 +76,8 @@
|
|
|
76
76
|
*
|
|
77
77
|
* TF024 (#2103, live root declares a backend/cloud block) credits choudoufu's
|
|
78
78
|
* own `RuleStateBackend`, `internal/live/lint/issue.go` of
|
|
79
|
-
* github.com/INTENTIUS/choudoufu: the
|
|
80
|
-
*
|
|
79
|
+
* github.com/INTENTIUS/choudoufu: the same condition, which choudoufu has
|
|
80
|
+
* reported as a warning since its #2213 (the block is ignored, not refused). TF025 (a live
|
|
81
81
|
* root's non-default `terraform.workspace`) has no entry: its workspace half
|
|
82
82
|
* is refused at the CLI argument-parsing layer there
|
|
83
83
|
* (`internal/command/live_mode.go`), not by a dedicated lint rule under
|
|
@@ -110,6 +110,18 @@
|
|
|
110
110
|
* a root's mode, and no surveyed tool has an Op model to read: choudoufu lints
|
|
111
111
|
* HCL, and every tflint ruleset, tfsec/trivy-checks and the Sentinel policies
|
|
112
112
|
* do the same. There is nothing upstream to credit.
|
|
113
|
+
*
|
|
114
|
+
* TF046 (chant#4561, a live root on the local record store in a CI run) has
|
|
115
|
+
* no entry. choudoufu prints where records go on every run and reports a
|
|
116
|
+
* `record_store.note` in `live-check -json` (INTENTIUS/choudoufu#2293), but
|
|
117
|
+
* it has no `internal/live/lint` rule for the local store, and no surveyed
|
|
118
|
+
* tool knows about record stores. TF044 is the nearest neighbour, for a
|
|
119
|
+
* Terragrunt state backend.
|
|
120
|
+
*
|
|
121
|
+
* TF047 (chant#4560, a live root pins a module version the known-module
|
|
122
|
+
* catalog has no row for, or one with refusals) has no entry. Its data is
|
|
123
|
+
* choudoufu's own module table (choudoufu#2292), vendored; no surveyed tool
|
|
124
|
+
* checks a module pin against a measured compatibility table.
|
|
113
125
|
*/
|
|
114
126
|
import type { Lineage } from "@intentius/chant/audit/catalog";
|
|
115
127
|
export declare const terraformAuditLineage: Record<string, Lineage[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit-lineage.d.ts","sourceRoot":"","sources":["../../src/lint/audit-lineage.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"audit-lineage.d.ts","sourceRoot":"","sources":["../../src/lint/audit-lineage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4HG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAQ9D,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAob3D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAgDvE,eAAO,MAAM,eAAe,EAAE,cAAc,EA+C3C,CAAC"}
|
|
@@ -42,6 +42,8 @@ import { tf042 } from "./tf042.js";
|
|
|
42
42
|
import { tf043 } from "./tf043.js";
|
|
43
43
|
import { tf044 } from "./tf044.js";
|
|
44
44
|
import { tf045 } from "./tf045.js";
|
|
45
|
+
import { tf046 } from "./tf046.js";
|
|
46
|
+
import { tf047 } from "./tf047.js";
|
|
45
47
|
export const postSynthChecks = [
|
|
46
48
|
tf001,
|
|
47
49
|
tf002,
|
|
@@ -87,4 +89,6 @@ export const postSynthChecks = [
|
|
|
87
89
|
tf043,
|
|
88
90
|
tf044,
|
|
89
91
|
tf045,
|
|
92
|
+
tf046,
|
|
93
|
+
tf047,
|
|
90
94
|
];
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The record store a live root resolves to, read from its HCL the way
|
|
3
|
+
* choudoufu resolves it (INTENTIUS/choudoufu#2293, `internal/configs/live_derive.go`
|
|
4
|
+
* at choudoufu 74ffde956bfd97f44b8ad444424584e23321adc2). Shared by TF024,
|
|
5
|
+
* which names where records go, and TF046, which guards a CI root that ends
|
|
6
|
+
* up on the local store, so the two never disagree.
|
|
7
|
+
*
|
|
8
|
+
* The order is choudoufu's:
|
|
9
|
+
*
|
|
10
|
+
* 1. A `record_store "<kind>"` block in the `live` block or the
|
|
11
|
+
* `estate.chdf.hcl` sidecar always wins (`source: "record_store"`).
|
|
12
|
+
* 2. Otherwise the backend block choudoufu ignores under live gives the store,
|
|
13
|
+
* s3 to s3, gcs to gcs, azurerm to azurerm (`source: "backend"`). s3 and gcs
|
|
14
|
+
* need a literal `bucket`; azurerm needs literal `storage_account_name`,
|
|
15
|
+
* `container_name` and `resource_group_name`. A value passed only with
|
|
16
|
+
* `-backend-config` is not in the configuration, so choudoufu does not see
|
|
17
|
+
* it either.
|
|
18
|
+
* 3. Otherwise the store is local (`source: "implied"`), with `note` saying
|
|
19
|
+
* why a backend that was there was not used.
|
|
20
|
+
*
|
|
21
|
+
* This mirrors `record_store.source` and `record_store.note` in
|
|
22
|
+
* `choudoufu live-check -json`. A literal here is a string hcl2json hands back
|
|
23
|
+
* with no `${...}` in it, the same "not determined" reading the Terragrunt
|
|
24
|
+
* rules use (`./terragrunt.ts`).
|
|
25
|
+
*/
|
|
26
|
+
import type { BlockBody } from "../../hcl/parse.js";
|
|
27
|
+
export type RecordStoreSource = "record_store" | "backend" | "implied";
|
|
28
|
+
export interface ResolvedRecordStore {
|
|
29
|
+
/** `local`, `s3`, `gcs`, `azurerm` or `kubernetes`, or whatever label a `record_store` block carries. */
|
|
30
|
+
kind: string;
|
|
31
|
+
source: RecordStoreSource;
|
|
32
|
+
/** The backend type the store came from, or was not derived from, when there is a backend block. */
|
|
33
|
+
backend?: string;
|
|
34
|
+
/** Why a backend block that was present did not give a store. Set only with `source: "implied"`. */
|
|
35
|
+
note?: string;
|
|
36
|
+
}
|
|
37
|
+
/** Backend types choudoufu derives a record store from (INTENTIUS/choudoufu#2293). */
|
|
38
|
+
export declare const DERIVABLE_BACKENDS: ReadonlySet<string>;
|
|
39
|
+
/**
|
|
40
|
+
* The label of a `record_store "<kind>"` block in a live declaration body, or
|
|
41
|
+
* undefined when it declares none. hcl2json nests the label one level down,
|
|
42
|
+
* as it does for `backend` (see `backendTypes` in `./tf001.ts`).
|
|
43
|
+
*/
|
|
44
|
+
export declare function recordStoreKind(liveBody: BlockBody): string | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Resolve one live root's record store.
|
|
47
|
+
*
|
|
48
|
+
* `terraformBodies` are the bodies of every `terraform` block in the root (a
|
|
49
|
+
* backend can sit in a separate `backend.tf`). `liveBodies` are the root's
|
|
50
|
+
* live declarations: its `live` block and its sidecar, if any. choudoufu
|
|
51
|
+
* refuses a root that has both, so the first `record_store` found is the one.
|
|
52
|
+
*/
|
|
53
|
+
export declare function resolveRecordStore(terraformBodies: readonly BlockBody[], liveBodies: readonly BlockBody[]): ResolvedRecordStore;
|
|
54
|
+
//# sourceMappingURL=record-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-store.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/record-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,MAAM,iBAAiB,GAAG,cAAc,GAAG,SAAS,GAAG,SAAS,CAAC;AAEvE,MAAM,WAAW,mBAAmB;IAClC,yGAAyG;IACzG,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,iBAAiB,CAAC;IAC1B,oGAAoG;IACpG,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oGAAoG;IACpG,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,sFAAsF;AACtF,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAAqC,CAAC;AAOzF;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAMvE;AAmCD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,eAAe,EAAE,SAAS,SAAS,EAAE,EACrC,UAAU,EAAE,SAAS,SAAS,EAAE,GAC/B,mBAAmB,CAcrB"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The record store a live root resolves to, read from its HCL the way
|
|
3
|
+
* choudoufu resolves it (INTENTIUS/choudoufu#2293, `internal/configs/live_derive.go`
|
|
4
|
+
* at choudoufu 74ffde956bfd97f44b8ad444424584e23321adc2). Shared by TF024,
|
|
5
|
+
* which names where records go, and TF046, which guards a CI root that ends
|
|
6
|
+
* up on the local store, so the two never disagree.
|
|
7
|
+
*
|
|
8
|
+
* The order is choudoufu's:
|
|
9
|
+
*
|
|
10
|
+
* 1. A `record_store "<kind>"` block in the `live` block or the
|
|
11
|
+
* `estate.chdf.hcl` sidecar always wins (`source: "record_store"`).
|
|
12
|
+
* 2. Otherwise the backend block choudoufu ignores under live gives the store,
|
|
13
|
+
* s3 to s3, gcs to gcs, azurerm to azurerm (`source: "backend"`). s3 and gcs
|
|
14
|
+
* need a literal `bucket`; azurerm needs literal `storage_account_name`,
|
|
15
|
+
* `container_name` and `resource_group_name`. A value passed only with
|
|
16
|
+
* `-backend-config` is not in the configuration, so choudoufu does not see
|
|
17
|
+
* it either.
|
|
18
|
+
* 3. Otherwise the store is local (`source: "implied"`), with `note` saying
|
|
19
|
+
* why a backend that was there was not used.
|
|
20
|
+
*
|
|
21
|
+
* This mirrors `record_store.source` and `record_store.note` in
|
|
22
|
+
* `choudoufu live-check -json`. A literal here is a string hcl2json hands back
|
|
23
|
+
* with no `${...}` in it, the same "not determined" reading the Terragrunt
|
|
24
|
+
* rules use (`./terragrunt.ts`).
|
|
25
|
+
*/
|
|
26
|
+
import { backendTypes } from "./tf001.js";
|
|
27
|
+
import { isExpression } from "./terragrunt.js";
|
|
28
|
+
/** Backend types choudoufu derives a record store from (INTENTIUS/choudoufu#2293). */
|
|
29
|
+
export const DERIVABLE_BACKENDS = new Set(["s3", "gcs", "azurerm"]);
|
|
30
|
+
const asRecord = (v) => typeof v === "object" && v !== null && !Array.isArray(v) ? v : {};
|
|
31
|
+
const firstBody = (v) => asRecord(Array.isArray(v) ? v[0] : v);
|
|
32
|
+
/**
|
|
33
|
+
* The label of a `record_store "<kind>"` block in a live declaration body, or
|
|
34
|
+
* undefined when it declares none. hcl2json nests the label one level down,
|
|
35
|
+
* as it does for `backend` (see `backendTypes` in `./tf001.ts`).
|
|
36
|
+
*/
|
|
37
|
+
export function recordStoreKind(liveBody) {
|
|
38
|
+
const raw = liveBody["record_store"];
|
|
39
|
+
if (raw === undefined || raw === null)
|
|
40
|
+
return undefined;
|
|
41
|
+
if (typeof raw !== "object" || Array.isArray(raw))
|
|
42
|
+
return undefined;
|
|
43
|
+
const labels = Object.keys(raw);
|
|
44
|
+
return labels[0];
|
|
45
|
+
}
|
|
46
|
+
/** A top-level backend argument as a literal string, or undefined when it is absent, empty or an expression. */
|
|
47
|
+
function literal(body, name) {
|
|
48
|
+
const v = body[name];
|
|
49
|
+
if (typeof v !== "string" || v === "" || isExpression(v))
|
|
50
|
+
return undefined;
|
|
51
|
+
return v;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Why a backend block gives no record store, or undefined when it gives one.
|
|
55
|
+
* The wording follows choudoufu's `Live.RecordStoreNote`; an empty string
|
|
56
|
+
* means no store and nothing to say (a `local` backend).
|
|
57
|
+
*/
|
|
58
|
+
function derivationNote(type, body) {
|
|
59
|
+
const where = `backend "${type}"`;
|
|
60
|
+
switch (type) {
|
|
61
|
+
case "s3":
|
|
62
|
+
case "gcs":
|
|
63
|
+
return literal(body, "bucket") === undefined
|
|
64
|
+
? `${where} sets no literal bucket; values passed with -backend-config are not read`
|
|
65
|
+
: undefined;
|
|
66
|
+
case "azurerm":
|
|
67
|
+
for (const name of ["storage_account_name", "container_name", "resource_group_name"]) {
|
|
68
|
+
if (literal(body, name) === undefined)
|
|
69
|
+
return `${where} sets no literal ${name}, which the azurerm record store needs`;
|
|
70
|
+
}
|
|
71
|
+
return undefined;
|
|
72
|
+
case "local":
|
|
73
|
+
// choudoufu leaves no note here: a local backend and the local store agree.
|
|
74
|
+
return "";
|
|
75
|
+
default:
|
|
76
|
+
return `${where} has no record store counterpart`;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Resolve one live root's record store.
|
|
81
|
+
*
|
|
82
|
+
* `terraformBodies` are the bodies of every `terraform` block in the root (a
|
|
83
|
+
* backend can sit in a separate `backend.tf`). `liveBodies` are the root's
|
|
84
|
+
* live declarations: its `live` block and its sidecar, if any. choudoufu
|
|
85
|
+
* refuses a root that has both, so the first `record_store` found is the one.
|
|
86
|
+
*/
|
|
87
|
+
export function resolveRecordStore(terraformBodies, liveBodies) {
|
|
88
|
+
for (const live of liveBodies) {
|
|
89
|
+
const kind = recordStoreKind(live);
|
|
90
|
+
if (kind !== undefined)
|
|
91
|
+
return { kind, source: "record_store" };
|
|
92
|
+
}
|
|
93
|
+
for (const tf of terraformBodies) {
|
|
94
|
+
const type = backendTypes(tf)[0];
|
|
95
|
+
if (type === undefined)
|
|
96
|
+
continue;
|
|
97
|
+
const body = firstBody(asRecord(tf["backend"])[type]);
|
|
98
|
+
const note = derivationNote(type, body);
|
|
99
|
+
if (note === undefined)
|
|
100
|
+
return { kind: type, source: "backend", backend: type };
|
|
101
|
+
return { kind: "local", source: "implied", backend: type, ...(note ? { note } : {}) };
|
|
102
|
+
}
|
|
103
|
+
return { kind: "local", source: "implied" };
|
|
104
|
+
}
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
* module's `terraform` block is skipped here rather than read as if it were
|
|
31
31
|
* the root's.
|
|
32
32
|
*
|
|
33
|
-
* Does not fire on a live root (#2103): a `backend` block
|
|
34
|
-
*
|
|
33
|
+
* Does not fire on a live root (#2103): choudoufu ignores a `backend` block
|
|
34
|
+
* there (TF024 reports what it still does with it), and the fallback to local
|
|
35
35
|
* state this check warns about does not apply, since a live root keeps no
|
|
36
36
|
* state file at all, local or remote.
|
|
37
37
|
*/
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
* module's `terraform` block is skipped here rather than read as if it were
|
|
31
31
|
* the root's.
|
|
32
32
|
*
|
|
33
|
-
* Does not fire on a live root (#2103): a `backend` block
|
|
34
|
-
*
|
|
33
|
+
* Does not fire on a live root (#2103): choudoufu ignores a `backend` block
|
|
34
|
+
* there (TF024 reports what it still does with it), and the fallback to local
|
|
35
35
|
* state this check warns about does not apply, since a live root keeps no
|
|
36
36
|
* state file at all, local or remote.
|
|
37
37
|
*/
|
|
@@ -1,24 +1,48 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* TF024: a live root declares a `backend` or `cloud` block.
|
|
3
3
|
*
|
|
4
|
-
* choudoufu
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
4
|
+
* choudoufu used to refuse this pair at `init` (#1170). Since
|
|
5
|
+
* INTENTIUS/choudoufu#2213 it accepts both and ignores them with a warning
|
|
6
|
+
* (`internal/configs/module.go`, `ignoreStateStoreUnderLive`), because
|
|
7
|
+
* Terragrunt's `remote_state` and Atmos's `backend.tf.json` write a backend
|
|
8
|
+
* beside the live block on every run. What each block still does:
|
|
9
|
+
*
|
|
10
|
+
* - `backend "<type>"`: no state is read or written there, and
|
|
11
|
+
* `init -migrate-state` is refused. choudoufu keeps the block as
|
|
12
|
+
* `IgnoredBackend`: an apply publishes the estate's non-sensitive outputs
|
|
13
|
+
* to the location it names, so `terraform_remote_state` readers keep
|
|
14
|
+
* working, and when the live declaration has no `record_store` the record
|
|
15
|
+
* store is derived from the backend's bucket, s3 to s3, gcs to gcs, azurerm
|
|
16
|
+
* to azurerm (INTENTIUS/choudoufu#2293), when the bucket is a literal in
|
|
17
|
+
* the configuration. An explicit `record_store` always wins. The resolution
|
|
18
|
+
* is shared with TF046 in `./record-store.ts`.
|
|
19
|
+
* - `cloud {}`: dropped entirely. Nothing is published to it and no store is
|
|
20
|
+
* derived from it.
|
|
21
|
+
*
|
|
22
|
+
* So the backend case is reported as `info` (the block is doing a job the
|
|
23
|
+
* author may want, and is the derivation source the maintainer ruled for),
|
|
24
|
+
* and the cloud case as `warning` (the block does nothing at all). Neither
|
|
25
|
+
* fails a build at default severity. The guard against a CI root that ends
|
|
26
|
+
* up on the local store is TF046 (chant#4561).
|
|
27
|
+
*
|
|
28
|
+
* The live marker is the root's `mode`, stamped from either a `live` block or
|
|
29
|
+
* an `estate.chdf.hcl` sidecar (`hcl/parse.ts`), so a sidecar estate is
|
|
30
|
+
* covered. A `record_store` is read from whichever `Terraform::Live` entity
|
|
31
|
+
* carries it: the `live` block, or the sidecar's top level.
|
|
11
32
|
*
|
|
12
33
|
* TF001 is the equivalent check for a stock root (no remote backend is
|
|
13
|
-
* configured); it
|
|
14
|
-
*
|
|
15
|
-
* at most one of them.
|
|
34
|
+
* configured); it does not fire on a live root. A root is flagged by at most
|
|
35
|
+
* one of them.
|
|
16
36
|
*
|
|
17
37
|
* Scope: root modules only (#2112). A child module's backend or cloud block
|
|
18
38
|
* is TF015's finding, whatever binary the root runs.
|
|
19
39
|
*
|
|
20
40
|
* One diagnostic per root, fired from the root's `terraform` block.
|
|
21
41
|
*/
|
|
22
|
-
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
42
|
+
import type { PostSynthCheck, PostSynthContext } from "@intentius/chant/lint/post-synth";
|
|
43
|
+
import { type BlockBody } from "../../hcl/parse.js";
|
|
44
|
+
export { DERIVABLE_BACKENDS } from "./record-store.js";
|
|
45
|
+
/** Each root's live declarations (its `live` block and its sidecar), keyed by root. */
|
|
46
|
+
export declare function liveBodiesByRoot(ctx: PostSynthContext): Map<string, BlockBody[]>;
|
|
23
47
|
export declare const tf024: PostSynthCheck;
|
|
24
48
|
//# sourceMappingURL=tf024.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tf024.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/tf024.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"tf024.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/tf024.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EAEjB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAK5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAKpD,uFAAuF;AACvF,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,gBAAgB,GAAG,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,CAYhF;AAqCD,eAAO,MAAM,KAAK,EAAE,cA4CnB,CAAC"}
|
|
@@ -1,18 +1,38 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* TF024: a live root declares a `backend` or `cloud` block.
|
|
3
3
|
*
|
|
4
|
-
* choudoufu
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
4
|
+
* choudoufu used to refuse this pair at `init` (#1170). Since
|
|
5
|
+
* INTENTIUS/choudoufu#2213 it accepts both and ignores them with a warning
|
|
6
|
+
* (`internal/configs/module.go`, `ignoreStateStoreUnderLive`), because
|
|
7
|
+
* Terragrunt's `remote_state` and Atmos's `backend.tf.json` write a backend
|
|
8
|
+
* beside the live block on every run. What each block still does:
|
|
9
|
+
*
|
|
10
|
+
* - `backend "<type>"`: no state is read or written there, and
|
|
11
|
+
* `init -migrate-state` is refused. choudoufu keeps the block as
|
|
12
|
+
* `IgnoredBackend`: an apply publishes the estate's non-sensitive outputs
|
|
13
|
+
* to the location it names, so `terraform_remote_state` readers keep
|
|
14
|
+
* working, and when the live declaration has no `record_store` the record
|
|
15
|
+
* store is derived from the backend's bucket, s3 to s3, gcs to gcs, azurerm
|
|
16
|
+
* to azurerm (INTENTIUS/choudoufu#2293), when the bucket is a literal in
|
|
17
|
+
* the configuration. An explicit `record_store` always wins. The resolution
|
|
18
|
+
* is shared with TF046 in `./record-store.ts`.
|
|
19
|
+
* - `cloud {}`: dropped entirely. Nothing is published to it and no store is
|
|
20
|
+
* derived from it.
|
|
21
|
+
*
|
|
22
|
+
* So the backend case is reported as `info` (the block is doing a job the
|
|
23
|
+
* author may want, and is the derivation source the maintainer ruled for),
|
|
24
|
+
* and the cloud case as `warning` (the block does nothing at all). Neither
|
|
25
|
+
* fails a build at default severity. The guard against a CI root that ends
|
|
26
|
+
* up on the local store is TF046 (chant#4561).
|
|
27
|
+
*
|
|
28
|
+
* The live marker is the root's `mode`, stamped from either a `live` block or
|
|
29
|
+
* an `estate.chdf.hcl` sidecar (`hcl/parse.ts`), so a sidecar estate is
|
|
30
|
+
* covered. A `record_store` is read from whichever `Terraform::Live` entity
|
|
31
|
+
* carries it: the `live` block, or the sidecar's top level.
|
|
11
32
|
*
|
|
12
33
|
* TF001 is the equivalent check for a stock root (no remote backend is
|
|
13
|
-
* configured); it
|
|
14
|
-
*
|
|
15
|
-
* at most one of them.
|
|
34
|
+
* configured); it does not fire on a live root. A root is flagged by at most
|
|
35
|
+
* one of them.
|
|
16
36
|
*
|
|
17
37
|
* Scope: root modules only (#2112). A child module's backend or cloud block
|
|
18
38
|
* is TF015's finding, whatever binary the root runs.
|
|
@@ -20,15 +40,61 @@
|
|
|
20
40
|
* One diagnostic per root, fired from the root's `terraform` block.
|
|
21
41
|
*/
|
|
22
42
|
import { isResourceDeclarable } from "@intentius/chant/declarable";
|
|
23
|
-
import { TERRAFORM_TYPE } from "../../hcl/parse.js";
|
|
24
|
-
import { hasBlock } from "./tf001.js";
|
|
43
|
+
import { LIVE_TYPE, TERRAFORM_TYPE } from "../../hcl/parse.js";
|
|
44
|
+
import { backendTypes, hasBlock } from "./tf001.js";
|
|
25
45
|
import { isRootScoped } from "./scope.js";
|
|
46
|
+
import { DERIVABLE_BACKENDS, resolveRecordStore } from "./record-store.js";
|
|
47
|
+
export { DERIVABLE_BACKENDS } from "./record-store.js";
|
|
48
|
+
const bodyOf = (props) => (typeof props.body === "object" && props.body !== null ? props.body : {});
|
|
49
|
+
/** Each root's live declarations (its `live` block and its sidecar), keyed by root. */
|
|
50
|
+
export function liveBodiesByRoot(ctx) {
|
|
51
|
+
const roots = new Map();
|
|
52
|
+
for (const entity of ctx.entities.values()) {
|
|
53
|
+
if (entity.entityType !== LIVE_TYPE)
|
|
54
|
+
continue;
|
|
55
|
+
if (!isResourceDeclarable(entity) || !isRootScoped(entity))
|
|
56
|
+
continue;
|
|
57
|
+
const props = entity.props;
|
|
58
|
+
const root = typeof props.root === "string" ? props.root : "";
|
|
59
|
+
const list = roots.get(root) ?? [];
|
|
60
|
+
list.push(bodyOf(props));
|
|
61
|
+
roots.set(root, list);
|
|
62
|
+
}
|
|
63
|
+
return roots;
|
|
64
|
+
}
|
|
65
|
+
function backendMessage(root, type, store) {
|
|
66
|
+
const label = type ? `backend "${type}"` : "backend";
|
|
67
|
+
const head = `Root module "${root}" runs choudoufu with a declared estate and also declares a ${label} block. ` +
|
|
68
|
+
"choudoufu ignores it with a warning: no state is read or written there and `init -migrate-state` " +
|
|
69
|
+
"is refused. An apply publishes the estate's non-sensitive outputs to the location it names, so " +
|
|
70
|
+
"terraform_remote_state readers keep working.";
|
|
71
|
+
if (store.source === "record_store") {
|
|
72
|
+
return `${head} Records go to the record_store the live declaration names, which wins over the backend.`;
|
|
73
|
+
}
|
|
74
|
+
if (store.source === "backend") {
|
|
75
|
+
return (`${head} With no record_store declared, choudoufu derives the record store from this backend's ` +
|
|
76
|
+
"bucket and prints it on every init and plan (INTENTIUS/choudoufu#2293). Declare record_store to " +
|
|
77
|
+
"put records somewhere else.");
|
|
78
|
+
}
|
|
79
|
+
const why = DERIVABLE_BACKENDS.has(type) && store.note
|
|
80
|
+
? `No record store is derived from it: ${store.note}.`
|
|
81
|
+
: `No record store is derived from a ${type ? `"${type}"` : "backend of unknown type"} (only s3, gcs and azurerm are).`;
|
|
82
|
+
return (`${head} ${why} No record_store is declared, so records stay in the local ` +
|
|
83
|
+
"store. Declare record_store if more than one machine runs this root (TF046 guards this in CI).");
|
|
84
|
+
}
|
|
85
|
+
function cloudMessage(root) {
|
|
86
|
+
return (`Root module "${root}" runs choudoufu with a declared estate and also declares a cloud block. ` +
|
|
87
|
+
"choudoufu ignores it entirely: no state is read or written there, no outputs are published to it, " +
|
|
88
|
+
"and no record store is derived from it. Remove it, or use a backend block if " +
|
|
89
|
+
"terraform_remote_state readers need this estate's outputs.");
|
|
90
|
+
}
|
|
26
91
|
export const tf024 = {
|
|
27
92
|
id: "TF024",
|
|
28
|
-
description: "Live root declares a backend or cloud block, which choudoufu
|
|
93
|
+
description: "Live root declares a backend or cloud block, which choudoufu ignores",
|
|
29
94
|
check(ctx) {
|
|
30
95
|
const diagnostics = [];
|
|
31
96
|
const flagged = new Set();
|
|
97
|
+
let liveBodies;
|
|
32
98
|
for (const [name, entity] of ctx.entities) {
|
|
33
99
|
if (entity.entityType !== TERRAFORM_TYPE)
|
|
34
100
|
continue;
|
|
@@ -40,19 +106,25 @@ export const tf024 = {
|
|
|
40
106
|
const root = typeof props.root === "string" ? props.root : "";
|
|
41
107
|
if (flagged.has(root))
|
|
42
108
|
continue;
|
|
43
|
-
const body = (
|
|
44
|
-
const hasBackend = hasBlock(body, "backend");
|
|
109
|
+
const body = bodyOf(props);
|
|
45
110
|
const hasCloud = hasBlock(body, "cloud");
|
|
111
|
+
const hasBackend = hasBlock(body, "backend");
|
|
46
112
|
if (!hasBackend && !hasCloud)
|
|
47
113
|
continue;
|
|
48
114
|
flagged.add(root);
|
|
49
|
-
|
|
115
|
+
// A cloud block does nothing at all, so it is the one worth a warning
|
|
116
|
+
// when a (malformed) root somehow carries both.
|
|
117
|
+
if (hasCloud) {
|
|
118
|
+
diagnostics.push({ checkId: "TF024", severity: "warning", message: cloudMessage(root), entity: name, lexicon: "terraform" });
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
liveBodies ?? (liveBodies = liveBodiesByRoot(ctx));
|
|
122
|
+
const type = backendTypes(body)[0] ?? "";
|
|
123
|
+
const store = resolveRecordStore([body], liveBodies.get(root) ?? []);
|
|
50
124
|
diagnostics.push({
|
|
51
125
|
checkId: "TF024",
|
|
52
|
-
severity: "
|
|
53
|
-
message:
|
|
54
|
-
`${blockKind} block. choudoufu refuses this at init: "Both a ${blockKind} and a live ` +
|
|
55
|
-
`configuration are present." Remove the ${blockKind} block; a live root keeps no state to store.`,
|
|
126
|
+
severity: "info",
|
|
127
|
+
message: backendMessage(root, type, store),
|
|
56
128
|
entity: name,
|
|
57
129
|
lexicon: "terraform",
|
|
58
130
|
});
|