@intentius/chant-lexicon-terraform 0.124.52 → 0.124.55
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 +14 -10
- package/dist/__fixtures__/pr-loop/estate.component.d.ts +7 -0
- package/dist/__fixtures__/pr-loop/estate.component.d.ts.map +1 -0
- package/dist/__fixtures__/pr-loop/estate.component.js +7 -0
- package/dist/__fixtures__/report/generate.d.ts +26 -0
- package/dist/__fixtures__/report/generate.d.ts.map +1 -0
- package/dist/__fixtures__/report/generate.js +58 -0
- package/dist/applied-state.d.ts +27 -0
- package/dist/applied-state.d.ts.map +1 -0
- package/dist/applied-state.js +44 -0
- package/dist/backend-config.d.ts +53 -0
- package/dist/backend-config.d.ts.map +1 -0
- package/dist/backend-config.js +136 -0
- package/dist/behaviour/kinds.d.ts.map +1 -1
- package/dist/behaviour/kinds.js +4 -0
- package/dist/behaviour/predict.d.ts.map +1 -1
- package/dist/behaviour/predict.js +6 -2
- package/dist/behaviour/reference-catalog.d.ts +16 -5
- package/dist/behaviour/reference-catalog.d.ts.map +1 -1
- package/dist/behaviour/reference-catalog.js +16 -5
- package/dist/behaviour/request.d.ts.map +1 -1
- package/dist/behaviour/request.js +3 -2
- package/dist/changed-roots.d.ts +6 -4
- package/dist/changed-roots.d.ts.map +1 -1
- package/dist/changed-roots.js +14 -18
- 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/commands.d.ts.map +1 -1
- package/dist/commands.js +4 -3
- package/dist/components/capability-plugin.d.ts +105 -9
- package/dist/components/capability-plugin.d.ts.map +1 -1
- package/dist/components/capability-plugin.js +357 -36
- package/dist/components/compose-group.d.ts +145 -0
- package/dist/components/compose-group.d.ts.map +1 -0
- package/dist/components/compose-group.js +407 -0
- package/dist/components/placeholder-preview.d.ts +78 -0
- package/dist/components/placeholder-preview.d.ts.map +1 -0
- package/dist/components/placeholder-preview.js +254 -0
- 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/compose/apply-events.d.ts +46 -0
- package/dist/compose/apply-events.d.ts.map +1 -0
- package/dist/compose/apply-events.js +77 -0
- package/dist/compose/estate.d.ts +194 -0
- package/dist/compose/estate.d.ts.map +1 -0
- package/dist/compose/estate.js +363 -0
- package/dist/compose/hcl.d.ts +99 -0
- package/dist/compose/hcl.d.ts.map +1 -0
- package/dist/compose/hcl.js +302 -0
- package/dist/compose/module-address.d.ts +24 -0
- package/dist/compose/module-address.d.ts.map +1 -0
- package/dist/compose/module-address.js +43 -0
- package/dist/compose/root.d.ts +127 -0
- package/dist/compose/root.d.ts.map +1 -0
- package/dist/compose/root.js +586 -0
- package/dist/compose/run.d.ts +183 -0
- package/dist/compose/run.d.ts.map +1 -0
- package/dist/compose/run.js +447 -0
- package/dist/compose/slice.d.ts +102 -0
- package/dist/compose/slice.d.ts.map +1 -0
- package/dist/compose/slice.js +249 -0
- package/dist/compose/state-address.d.ts +28 -0
- package/dist/compose/state-address.d.ts.map +1 -0
- package/dist/compose/state-address.js +154 -0
- package/dist/compose/state-merge.d.ts +52 -0
- package/dist/compose/state-merge.d.ts.map +1 -0
- package/dist/compose/state-merge.js +135 -0
- package/dist/compose.d.ts +179 -0
- package/dist/compose.d.ts.map +1 -0
- package/dist/compose.js +482 -0
- package/dist/composites/terraform-apply-op.d.ts.map +1 -1
- package/dist/composites/terraform-apply-op.js +7 -3
- package/dist/cone.d.ts +53 -0
- package/dist/cone.d.ts.map +1 -0
- package/dist/cone.js +119 -0
- package/dist/config.d.ts +59 -13
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +43 -9
- 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/describe-resources.d.ts +74 -12
- package/dist/describe-resources.d.ts.map +1 -1
- package/dist/describe-resources.js +374 -66
- package/dist/drift-read.d.ts +33 -0
- package/dist/drift-read.d.ts.map +1 -0
- package/dist/drift-read.js +243 -0
- package/dist/drift-record.d.ts +147 -0
- package/dist/drift-record.d.ts.map +1 -0
- package/dist/drift-record.js +383 -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/hcl/edges.d.ts.map +1 -1
- package/dist/hcl/edges.js +24 -1
- package/dist/hcl/files.d.ts +61 -0
- package/dist/hcl/files.d.ts.map +1 -0
- package/dist/hcl/files.js +221 -0
- package/dist/hcl/instances.d.ts +82 -0
- package/dist/hcl/instances.d.ts.map +1 -0
- package/dist/hcl/instances.js +390 -0
- package/dist/hcl/parse.d.ts +81 -9
- package/dist/hcl/parse.d.ts.map +1 -1
- package/dist/hcl/parse.js +114 -16
- package/dist/hcl/roots.d.ts.map +1 -1
- package/dist/hcl/roots.js +5 -0
- package/dist/hcl/suppressions.d.ts.map +1 -1
- package/dist/hcl/suppressions.js +8 -2
- package/dist/index.d.ts +13 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +24 -2
- package/dist/integrity.json +8 -5
- 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/live-plan-reasons.d.ts +21 -0
- package/dist/live-plan-reasons.d.ts.map +1 -0
- package/dist/live-plan-reasons.js +47 -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/lsp/option-keys.d.ts.map +1 -1
- package/dist/lsp/option-keys.js +2 -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/index.d.ts +6 -2
- package/dist/op/activities/index.d.ts.map +1 -1
- package/dist/op/activities/index.js +5 -1
- package/dist/op/activities/live-detect.d.ts +4 -3
- package/dist/op/activities/live-detect.d.ts.map +1 -1
- package/dist/op/activities/live-detect.js +57 -32
- package/dist/op/activities/pin-rollout.d.ts +2 -0
- package/dist/op/activities/pin-rollout.d.ts.map +1 -1
- package/dist/op/activities/pin-rollout.js +1 -0
- package/dist/op/activities/terraform.d.ts +182 -5
- package/dist/op/activities/terraform.d.ts.map +1 -1
- package/dist/op/activities/terraform.js +224 -24
- package/dist/op/activity-contracts.d.ts +27 -0
- package/dist/op/activity-contracts.d.ts.map +1 -1
- package/dist/op/activity-contracts.js +19 -1
- package/dist/op/builders.d.ts +7 -1
- package/dist/op/builders.d.ts.map +1 -1
- package/dist/op/builders.js +9 -0
- 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/pin/edit.d.ts.map +1 -1
- package/dist/pin/edit.js +35 -0
- package/dist/pin/rollout.d.ts +2 -0
- package/dist/pin/rollout.d.ts.map +1 -1
- package/dist/pin/rollout.js +14 -11
- package/dist/plan-shape.d.ts +30 -0
- package/dist/plan-shape.d.ts.map +1 -0
- package/dist/plan-shape.js +125 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +37 -18
- 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/report.d.ts +15 -6
- package/dist/report.d.ts.map +1 -1
- package/dist/report.js +28 -55
- 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/skills/chant-terraform.md +1 -1
- package/dist/state/azure-blob.d.ts +9 -0
- package/dist/state/azure-blob.d.ts.map +1 -0
- package/dist/state/azure-blob.js +8 -0
- package/dist/state/backend.d.ts +158 -0
- package/dist/state/backend.d.ts.map +1 -0
- package/dist/state/backend.js +406 -0
- package/dist/state/exec.d.ts +39 -0
- package/dist/state/exec.d.ts.map +1 -0
- package/dist/state/exec.js +80 -0
- package/dist/state/gcs.d.ts +8 -0
- package/dist/state/gcs.d.ts.map +1 -0
- package/dist/state/gcs.js +7 -0
- package/dist/state/index.d.ts +15 -0
- package/dist/state/index.d.ts.map +1 -0
- package/dist/state/index.js +14 -0
- package/dist/state/locks.d.ts +105 -0
- package/dist/state/locks.d.ts.map +1 -0
- package/dist/state/locks.js +130 -0
- package/dist/state/object-store.d.ts +8 -0
- package/dist/state/object-store.d.ts.map +1 -0
- package/dist/state/object-store.js +7 -0
- package/dist/state/root-states.d.ts +131 -0
- package/dist/state/root-states.d.ts.map +1 -0
- package/dist/state/root-states.js +241 -0
- package/dist/state/s3.d.ts +21 -0
- package/dist/state/s3.d.ts.map +1 -0
- package/dist/state/s3.js +19 -0
- package/dist/state/store.d.ts +51 -0
- package/dist/state/store.d.ts.map +1 -0
- package/dist/state/store.js +185 -0
- 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/terragrunt/affected.d.ts.map +1 -1
- package/dist/terragrunt/affected.js +2 -1
- 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 +24 -4
- package/src/__fixtures__/ACCEPTANCE.md +69 -7
- package/src/__fixtures__/compose/apply-failed-in-app.jsonl +12 -0
- package/src/__fixtures__/compose/state-app.json +66 -0
- package/src/__fixtures__/compose/state-edge.json +40 -0
- package/src/__fixtures__/compose/state-net.json +58 -0
- package/src/__fixtures__/compose/three-app.plan.json +184 -0
- package/src/__fixtures__/compose/three-composed.plan.json +509 -0
- package/src/__fixtures__/compose/three-edge.plan.json +144 -0
- package/src/__fixtures__/compose/three-net.plan.json +174 -0
- package/src/__fixtures__/compose/unknown-composed.plan.json +228 -0
- package/src/__fixtures__/compose/working-after-apply.json +145 -0
- package/src/__fixtures__/config-blocks/app/main.tf +61 -0
- package/src/__fixtures__/config-blocks/app/modules/network/main.tf +4 -0
- package/src/__fixtures__/config-blocks/app-json/main.tf.json +39 -0
- package/src/__fixtures__/config-files/shadow/main.tf +3 -0
- package/src/__fixtures__/config-files/shadow/main.tofu +3 -0
- package/src/__fixtures__/config-files/shadow/other.tf +3 -0
- package/src/__fixtures__/config-files/tf/main.tf +11 -0
- package/src/__fixtures__/config-files/tf-json/main.tf.json +18 -0
- package/src/__fixtures__/config-files/tofu/main.tofu +11 -0
- package/src/__fixtures__/config-files/tofu-json/main.tofu.json +18 -0
- package/src/__fixtures__/config-files/tofu-only/main.tofu +3 -0
- package/src/__fixtures__/drift-record/README.md +16 -0
- package/src/__fixtures__/drift-record/live-plan-sections.json +27 -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__/instance-forms/app/main.tf +110 -0
- package/src/__fixtures__/instance-forms/app/modules/svc/main.tf +3 -0
- package/src/__fixtures__/instance-vars/app/main.tf +52 -0
- package/src/__fixtures__/instance-vars/app/modules/app/main.tf +12 -0
- package/src/__fixtures__/instance-vars/app/modules/edge/main.tf +3 -0
- package/src/__fixtures__/instance-vars/app/terraform.tfvars +1 -0
- package/src/__fixtures__/live-module-keyed/live-graph.json +259 -0
- package/src/__fixtures__/live-module-keyed/live-plan.json +87 -0
- package/src/__fixtures__/live-module-keyed/root/estate.chdf.hcl +1 -0
- package/src/__fixtures__/live-module-keyed/root/main.tf +21 -0
- package/src/__fixtures__/live-module-keyed/root/modules/app/main.tf +17 -0
- package/src/__fixtures__/live-module-keyed/root/modules/edge/main.tf +7 -0
- package/src/__fixtures__/live-module-keyed/root/versions.tf +30 -0
- package/src/__fixtures__/live-module-keyed/show-state.json +146 -0
- package/src/__fixtures__/pr-loop/README.md +50 -0
- package/src/__fixtures__/pr-loop/chant.config.json +13 -0
- package/src/__fixtures__/pr-loop/estate.component.ts +10 -0
- package/src/__fixtures__/pr-loop/roots/a/main.tf +11 -0
- package/src/__fixtures__/pr-loop/roots/app/main.tf +19 -0
- package/src/__fixtures__/pr-loop/roots/b/main.tf +7 -0
- package/src/__fixtures__/pr-loop/roots/dns/main.tf +3 -0
- package/src/__fixtures__/pr-loop/roots/net/main.tf +7 -0
- package/src/__fixtures__/report/applied.show.json +51 -0
- package/src/__fixtures__/report/generate.ts +63 -0
- package/src/__fixtures__/report/plan.show.json +200 -0
- package/src/__fixtures__/report/tf-apply/change-set.json +170 -0
- package/src/__fixtures__/report/tf-apply/report.json +338 -0
- package/src/__fixtures__/report/tf-plan/change-set.json +170 -0
- package/src/__fixtures__/report/tf-plan/report.json +320 -0
- package/src/__fixtures__/three-cloud-azure.graph.json +290 -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/applied-state.ts +52 -0
- package/src/backend-config.test.ts +105 -0
- package/src/backend-config.ts +133 -0
- package/src/behaviour/kinds.ts +4 -0
- package/src/behaviour/predict.ts +5 -2
- package/src/behaviour/reference-catalog.plugin.test.ts +65 -0
- package/src/behaviour/reference-catalog.ts +16 -5
- package/src/behaviour/request.ts +3 -2
- package/src/change-set-instances.test.ts +98 -0
- package/src/changed-roots.ts +14 -16
- package/src/ci-setup.ts +42 -0
- package/src/commands.ts +4 -3
- package/src/components/capability-plugin.test.ts +198 -19
- package/src/components/capability-plugin.ts +383 -35
- package/src/components/change-set-graph.e2e.test.ts +11 -5
- package/src/components/compose-group.test.ts +486 -0
- package/src/components/compose-group.ts +489 -0
- package/src/components/demo-composed-roots.e2e.test.ts +440 -0
- package/src/components/member-outputs.test.ts +76 -0
- package/src/components/placeholder-preview.test.ts +147 -0
- package/src/components/placeholder-preview.ts +257 -0
- package/src/components/pr-loop-compose.tofu.e2e.test.ts +363 -0
- package/src/components/pr-loop.tofu.test.ts +113 -57
- 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/compose/apply-events.test.ts +62 -0
- package/src/compose/apply-events.ts +100 -0
- package/src/compose/estate.choudoufu.e2e.test.ts +112 -0
- package/src/compose/estate.test.ts +421 -0
- package/src/compose/estate.ts +443 -0
- package/src/compose/hcl.ts +311 -0
- package/src/compose/module-address.ts +49 -0
- package/src/compose/root.test.ts +416 -0
- package/src/compose/root.ts +592 -0
- package/src/compose/run.test.ts +440 -0
- package/src/compose/run.tofu.test.ts +176 -0
- package/src/compose/run.ts +527 -0
- package/src/compose/slice.test.ts +184 -0
- package/src/compose/slice.ts +290 -0
- package/src/compose/state-address.ts +157 -0
- package/src/compose/state-merge.test.ts +131 -0
- package/src/compose/state-merge.ts +148 -0
- package/src/compose.test.ts +248 -0
- package/src/compose.ts +627 -0
- package/src/composites/terraform-apply-op.test.ts +9 -0
- package/src/composites/terraform-apply-op.ts +7 -3
- package/src/cone.ts +138 -0
- package/src/config-file-listers.test.ts +265 -0
- package/src/config.ts +44 -9
- package/src/cost-hold.ts +29 -0
- package/src/describe-resources.engine-facts.test.ts +411 -0
- package/src/describe-resources.live-module-keyed.test.ts +290 -0
- package/src/describe-resources.ts +416 -70
- package/src/drift-read.ts +284 -0
- package/src/drift-record.test.ts +223 -0
- package/src/drift-record.ts +455 -0
- 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/hcl/config-blocks.test.ts +174 -0
- package/src/hcl/edges.ts +21 -1
- package/src/hcl/files.ts +234 -0
- package/src/hcl/instance-forms.test.ts +94 -0
- package/src/hcl/instances.test.ts +137 -0
- package/src/hcl/instances.ts +422 -0
- package/src/hcl/parse.test.ts +139 -1
- package/src/hcl/parse.ts +149 -16
- package/src/hcl/roots.ts +6 -0
- package/src/hcl/suppressions.ts +8 -2
- package/src/index.ts +79 -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/live-plan-reasons.ts +54 -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/lsp/completions.test.ts +1 -1
- package/src/lsp/option-keys.ts +2 -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/choudoufu-plan-set-op.test.ts +111 -0
- package/src/op/activities/index.ts +9 -0
- package/src/op/activities/live-detect.ts +55 -26
- package/src/op/activities/pin-rollout.ts +3 -0
- package/src/op/activities/registry.test.ts +2 -1
- package/src/op/activities/terraform.test.ts +55 -0
- package/src/op/activities/terraform.ts +312 -27
- package/src/op/activity-contracts.test.ts +1 -0
- package/src/op/activity-contracts.ts +24 -1
- package/src/op/builders.ts +14 -0
- 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/bundle.test.ts +2 -0
- package/src/pin/consumers.test.ts +57 -0
- package/src/pin/consumers.ts +95 -0
- package/src/pin/edit.ts +30 -0
- package/src/pin/rollout.ts +16 -11
- package/src/plan-shape.test.ts +148 -0
- package/src/plan-shape.ts +128 -0
- package/src/plugin.ts +39 -19
- 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/report.test.ts +82 -1
- package/src/report.ts +31 -54
- package/src/signal-only-root.test.ts +72 -0
- package/src/skills/chant-terraform.md +1 -1
- package/src/state/azure-blob.ts +8 -0
- package/src/state/backend-verdict.test.ts +187 -0
- package/src/state/backend.test.ts +127 -0
- package/src/state/backend.ts +488 -0
- package/src/state/exec.ts +111 -0
- package/src/state/gcs.ts +7 -0
- package/src/state/index.ts +15 -0
- package/src/state/locks.test.ts +84 -0
- package/src/state/locks.ts +201 -0
- package/src/state/object-store.ts +7 -0
- package/src/state/root-states-floci.e2e.test.ts +66 -0
- package/src/state/root-states.test.ts +462 -0
- package/src/state/root-states.ts +309 -0
- package/src/state/s3.ts +21 -0
- package/src/state/store.ts +225 -0
- package/src/state-ops.test.ts +182 -0
- package/src/state-ops.ts +462 -0
- package/src/state-reads.ts +116 -0
- package/src/terragrunt/affected.ts +2 -1
- package/src/used-sources.test.ts +75 -0
- package/src/used-sources.ts +204 -0
- package/src/workspace-kinds.test.ts +4 -17
- package/workspace-kinds.json +1 -24
- package/dist/workspace-member.d.ts +0 -30
- package/dist/workspace-member.d.ts.map +0 -1
- package/dist/workspace-member.js +0 -91
- package/schemas/pulumi.schema.json +0 -34
- package/src/testdata/pulumi-member/Pulumi.yaml +0 -2
- package/src/testdata/pulumi-member/stack-export.json +0 -53
- package/src/testdata/pulumi-unexported/Pulumi.yaml +0 -2
- package/src/workspace-member.test.ts +0 -89
- package/src/workspace-member.ts +0 -126
|
@@ -44,10 +44,14 @@ import { tmpdir } from "node:os";
|
|
|
44
44
|
import { promisify } from "node:util";
|
|
45
45
|
import { resolve, dirname, join, relative, sep } from "node:path";
|
|
46
46
|
import { loadChantConfigUpward } from "@intentius/chant/config";
|
|
47
|
+
import { findWorkspaceRoot } from "@intentius/chant/project-root";
|
|
47
48
|
import { liveReadKey, memoLiveRead } from "@intentius/chant/live-read-session";
|
|
48
49
|
import { terraformPlanDigest } from "../../plan-digest.js";
|
|
49
50
|
import { choudoufuSetPlanParts, plannerForBinary, terraformChangeSetPart } from "../../change-set.js";
|
|
50
51
|
import { detectLiveEstate } from "./live-detect.js";
|
|
52
|
+
import { backendConfigValues } from "../../backend-config.js";
|
|
53
|
+
import { lockTimeoutArgs } from "../../lock-timeout.js";
|
|
54
|
+
import { coneArgs, readPlanCone } from "../../cone.js";
|
|
51
55
|
import { parseAdoptionCommands, readAdoptionLedger, renderAdoptionLedger, } from "../adoption.js";
|
|
52
56
|
const execAsync = promisify(exec);
|
|
53
57
|
/**
|
|
@@ -100,6 +104,34 @@ export const MIN_CHOUDOUFU_VERSION = "0.15.0";
|
|
|
100
104
|
* choudoufu#1754, and {@link choudoufuPlanSet} refuses it.
|
|
101
105
|
*/
|
|
102
106
|
export const MIN_CHOUDOUFU_WAVES_VERSION = "0.22.0";
|
|
107
|
+
/**
|
|
108
|
+
* The choudoufu release a composed run of estates needs (#4445): a root with
|
|
109
|
+
* no `live` block that calls estate directories as modules, planned and
|
|
110
|
+
* applied as one walk, with a `terraform_estate_outputs` read of another
|
|
111
|
+
* estate in the run answered inside it (choudoufu#2059, first released in
|
|
112
|
+
* v0.31.0). Only the composed estate run (`compose/estate.ts`) checks it;
|
|
113
|
+
* below it the members plan wave by wave. A dev build names no release and
|
|
114
|
+
* passes, as for the other floors.
|
|
115
|
+
*/
|
|
116
|
+
export const MIN_CHOUDOUFU_ESTATES_VERSION = "0.31.0";
|
|
117
|
+
/**
|
|
118
|
+
* The choudoufu release whose `live-graph -json -from-plan=<file>` prints the
|
|
119
|
+
* engine graph document (chant#4520's design section 4, choudoufu#2285), the
|
|
120
|
+
* one `describeResources()` reads engine facts from on a live root
|
|
121
|
+
* (chant#4528). choudoufu's changelog lists the command under
|
|
122
|
+
* `v0.32.0 (Unreleased)`, so this is the version it releases as. The chant
|
|
123
|
+
* side of the same contract, the first chant that writes those facts, is
|
|
124
|
+
* `ENGINE_FACTS_FLOOR` in core's engine-facts.ts, which is NEXT_RELEASE
|
|
125
|
+
* until the cut.
|
|
126
|
+
*
|
|
127
|
+
* Not a refusal. Facts are for people and never feed a decision, so a
|
|
128
|
+
* choudoufu without the command (a usage error, see
|
|
129
|
+
* {@link classifyLiveGraphFailure}) leaves `facts` absent with one note
|
|
130
|
+
* naming this version, and the rest of the read is unchanged. The check is
|
|
131
|
+
* the capability, not the version string: a local or dev build names a
|
|
132
|
+
* version below this or none at all, and still carries the command.
|
|
133
|
+
*/
|
|
134
|
+
export const MIN_CHOUDOUFU_GRAPH_VERSION = "0.32.0";
|
|
103
135
|
/**
|
|
104
136
|
* Where a choudoufu root's wave files live, relative to the project root:
|
|
105
137
|
* `<root>/plan-set.json` (the set plan document chant planned and the
|
|
@@ -151,16 +183,21 @@ export function terraformEnvironment(root) {
|
|
|
151
183
|
...(root?.workspace ? { TF_WORKSPACE: root.workspace } : {}),
|
|
152
184
|
};
|
|
153
185
|
}
|
|
154
|
-
/**
|
|
186
|
+
/**
|
|
187
|
+
* `terraform init`, with the root's `backendConfigFiles` as
|
|
188
|
+
* `-backend-config=<path>` flags and then its `backendConfig` as
|
|
189
|
+
* `-backend-config=k=v` flags (chant#4459): init applies later flags over
|
|
190
|
+
* earlier ones, so a pair overrides a file. A path is passed as written; init
|
|
191
|
+
* runs in the root's directory, which a relative one resolves against.
|
|
192
|
+
*/
|
|
155
193
|
export function terraformInitCommand(opts) {
|
|
156
194
|
const parts = [opts.binary, "init", "-input=false"];
|
|
157
195
|
if (opts.upgrade)
|
|
158
196
|
parts.push("-upgrade");
|
|
159
197
|
if (opts.reconfigure)
|
|
160
198
|
parts.push("-reconfigure");
|
|
161
|
-
for (const
|
|
162
|
-
parts.push(`-backend-config=${quoteArg(
|
|
163
|
-
}
|
|
199
|
+
for (const value of backendConfigValues(opts))
|
|
200
|
+
parts.push(`-backend-config=${quoteArg(value)}`);
|
|
164
201
|
return parts.join(" ");
|
|
165
202
|
}
|
|
166
203
|
/**
|
|
@@ -172,6 +209,8 @@ export function terraformPlanCommand(opts) {
|
|
|
172
209
|
const parts = [opts.binary, "plan", "-input=false", "-detailed-exitcode"];
|
|
173
210
|
if (opts.destroy)
|
|
174
211
|
parts.push("-destroy");
|
|
212
|
+
for (const flag of opts.extra ?? [])
|
|
213
|
+
parts.push(quoteArg(flag));
|
|
175
214
|
for (const target of [...new Set(opts.targets ?? [])].sort())
|
|
176
215
|
parts.push(`-target=${quoteArg(target)}`);
|
|
177
216
|
for (const varFile of opts.varFiles ?? [])
|
|
@@ -191,7 +230,8 @@ export function terraformPlanCommand(opts) {
|
|
|
191
230
|
* own `apply <planfile>` does, so no `-auto-approve` is needed or passed.
|
|
192
231
|
*/
|
|
193
232
|
export function terraformApplyCommand(opts) {
|
|
194
|
-
|
|
233
|
+
const extra = (opts.extra ?? []).map((f) => ` ${quoteArg(f)}`).join("");
|
|
234
|
+
return `${opts.binary} apply -input=false${extra} ${quoteArg(opts.planFile)}`;
|
|
195
235
|
}
|
|
196
236
|
/**
|
|
197
237
|
* `live-plan -detailed-exitcode [-json] [-estate=<estate>]`. `-json` is what
|
|
@@ -229,6 +269,39 @@ export function choudoufuLivePlanCommand(opts) {
|
|
|
229
269
|
parts.push(`-estate=${quoteArg(opts.estate)}`);
|
|
230
270
|
return parts.join(" ");
|
|
231
271
|
}
|
|
272
|
+
/**
|
|
273
|
+
* `live-graph -json -from-plan=<file> [-estate=<estate>]` (choudoufu#2285).
|
|
274
|
+
* No `DIR` argument: like {@link choudoufuLiveCheckCommand}, the activity
|
|
275
|
+
* runs in the root directory, which is DIR's default. `-estate` follows
|
|
276
|
+
* {@link choudoufuLivePlanCommand}'s rule: only for a root that does not
|
|
277
|
+
* name its own estate. `-history` is never passed: record versions take a
|
|
278
|
+
* listing per record and `s3:ListBucketVersions`, and an observation read
|
|
279
|
+
* has no use for them (the #4520 ruling, Q6: opt-in).
|
|
280
|
+
*/
|
|
281
|
+
export function choudoufuLiveGraphCommand(opts) {
|
|
282
|
+
const parts = [opts.binary, "live-graph", "-json", `-from-plan=${quoteArg(opts.fromPlan)}`];
|
|
283
|
+
if (opts.estate !== undefined)
|
|
284
|
+
parts.push(`-estate=${quoteArg(opts.estate)}`);
|
|
285
|
+
return parts.join(" ");
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Whether a failed `live-graph` run is a choudoufu that has no such command
|
|
289
|
+
* or flag (`"unsupported"`), or a real failure (`"failed"`). Older builds
|
|
290
|
+
* answer an unknown command two ways: the new CLI prints `OpenTofu has no
|
|
291
|
+
* command named "live-graph"` and exits 1 (cmd/choudoufu/command_main.go),
|
|
292
|
+
* and the older mitchellh/cli path prints its usage and exits 127. A build
|
|
293
|
+
* whose `live-graph` predates `-from-plan` fails the flag parse with `flag
|
|
294
|
+
* provided but not defined`.
|
|
295
|
+
*/
|
|
296
|
+
export function classifyLiveGraphFailure(code, output) {
|
|
297
|
+
if (code === 127)
|
|
298
|
+
return "unsupported";
|
|
299
|
+
if (/no command named "?live-graph"?/i.test(output))
|
|
300
|
+
return "unsupported";
|
|
301
|
+
if (/flag provided but not defined: -(?:from-plan|json|estate)\b/.test(output))
|
|
302
|
+
return "unsupported";
|
|
303
|
+
return "failed";
|
|
304
|
+
}
|
|
232
305
|
/** `live-ls -estate=<estate> -json [-consistent]`. */
|
|
233
306
|
export function choudoufuLiveLsCommand(opts) {
|
|
234
307
|
const parts = [opts.binary, "live-ls", `-estate=${quoteArg(opts.estate)}`, "-json"];
|
|
@@ -428,7 +501,7 @@ async function resolveRoot(args, signal) {
|
|
|
428
501
|
(known.length > 0 ? `known roots: ${known.join(", ")}` : "the namespace declares no roots"));
|
|
429
502
|
}
|
|
430
503
|
const binary = terraformBinary(namespace);
|
|
431
|
-
const dir = resolve(projectRoot, root.dir);
|
|
504
|
+
const dir = resolve(projectRoot, args.dir ?? root.dir);
|
|
432
505
|
await ensureChoudoufuVersion(binary, signal);
|
|
433
506
|
const estate = binary === "choudoufu" ? detectLiveEstate(dir) : undefined;
|
|
434
507
|
// `estate` stays what it has always been: the estate the root's own HCL
|
|
@@ -477,8 +550,8 @@ function report(stdout, stderr) {
|
|
|
477
550
|
}
|
|
478
551
|
// ── Activities ──────────────────────────────────────────────────────────────
|
|
479
552
|
/**
|
|
480
|
-
* `terraform init` in the named root, with the root's `
|
|
481
|
-
* as `-backend-config` flags. Uses the longInfra profile: init downloads
|
|
553
|
+
* `terraform init` in the named root, with the root's `backendConfigFiles` and
|
|
554
|
+
* `backendConfig` supplied as `-backend-config` flags. Uses the longInfra profile: init downloads
|
|
482
555
|
* providers and modules, a network call of unpredictable size.
|
|
483
556
|
*/
|
|
484
557
|
export async function terraformInit(args, signal) {
|
|
@@ -486,16 +559,53 @@ export async function terraformInit(args, signal) {
|
|
|
486
559
|
const cmd = terraformInitCommand({
|
|
487
560
|
binary,
|
|
488
561
|
...(root.backendConfig ? { backendConfig: root.backendConfig } : {}),
|
|
562
|
+
...(root.backendConfigFiles ? { backendConfigFiles: root.backendConfigFiles } : {}),
|
|
489
563
|
...(args.upgrade ? { upgrade: true } : {}),
|
|
490
564
|
...(args.reconfigure ? { reconfigure: true } : {}),
|
|
491
565
|
});
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
566
|
+
// Known once the root resolves, before init runs (chant#4512), so a failed
|
|
567
|
+
// init still publishes them and the ledger names the root it was for.
|
|
568
|
+
const rootPath = workspaceRelativePath(dir);
|
|
569
|
+
const result = { dir, ...(root.workspace ? { workspace: root.workspace } : {}), ...(rootPath !== undefined ? { rootPath } : {}) };
|
|
570
|
+
let out;
|
|
571
|
+
try {
|
|
572
|
+
out = await run(cmd, dir, terraformEnvironment(root), signal);
|
|
573
|
+
}
|
|
574
|
+
catch (err) {
|
|
575
|
+
throw withKnownOutputs(err, result);
|
|
576
|
+
}
|
|
577
|
+
report(out.stdout, out.stderr);
|
|
578
|
+
return result;
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* `err` carrying `outputs` as the outputs the activity knew when it failed
|
|
582
|
+
* (chant#4512): the `knownOutputs` property core's executor reads a failed
|
|
583
|
+
* step's outcome attributes from (core's `withKnownOutputs`). It is set here
|
|
584
|
+
* rather than imported so the lexicon needs no newer core; an older executor
|
|
585
|
+
* reads the error as any other failure.
|
|
586
|
+
*/
|
|
587
|
+
function withKnownOutputs(err, outputs) {
|
|
588
|
+
const e = err instanceof Error ? err : new Error(String(err));
|
|
589
|
+
return Object.assign(e, { knownOutputs: outputs });
|
|
590
|
+
}
|
|
591
|
+
/**
|
|
592
|
+
* `dir` relative to the chant workspace that holds it, `/`-separated, or
|
|
593
|
+
* undefined outside a workspace or outside its root (chant#4482). The
|
|
594
|
+
* workspace root `"."` stands for itself.
|
|
595
|
+
*/
|
|
596
|
+
export function workspaceRelativePath(dir) {
|
|
597
|
+
const found = findWorkspaceRoot(dir);
|
|
598
|
+
if (!found)
|
|
599
|
+
return undefined;
|
|
600
|
+
const rel = relative(found.dir, dir);
|
|
601
|
+
if (rel.startsWith(".."))
|
|
602
|
+
return undefined;
|
|
603
|
+
return rel === "" ? "." : rel.split(sep).join("/");
|
|
495
604
|
}
|
|
496
605
|
/**
|
|
497
606
|
* `terraform plan -detailed-exitcode -out=<planFile>` in the named root, then
|
|
498
|
-
* `terraform show` over the written plan in both `-json` and `-no-color` form
|
|
607
|
+
* `terraform show` over the written plan in both `-json` and `-no-color` form
|
|
608
|
+
* (`-json` alone with `text: false`).
|
|
499
609
|
*
|
|
500
610
|
* The exit code is the answer, not an error condition: 0 is a plan with no
|
|
501
611
|
* changes, 2 is a plan with changes, and anything else, 1 included, is a
|
|
@@ -507,9 +617,13 @@ export async function terraformInit(args, signal) {
|
|
|
507
617
|
* provider.
|
|
508
618
|
*/
|
|
509
619
|
export async function terraformPlan(args, signal) {
|
|
510
|
-
const { binary, root, dir } = await resolveRoot(args, signal);
|
|
620
|
+
const { binary, root, dir, live } = await resolveRoot(args, signal);
|
|
511
621
|
const planFile = args.planFile ?? DEFAULT_PLAN_FILE;
|
|
512
622
|
const env = terraformEnvironment(root);
|
|
623
|
+
const lock = args.lockTimeout !== undefined ? lockTimeoutArgs("plan", args.lockTimeout) : [];
|
|
624
|
+
// #4545: a cone only on a live root that is not an estate file; -target and -destroy plan in full.
|
|
625
|
+
const fixed = [...(args.destroy ? ["-destroy"] : []), ...((args.targets ?? []).length > 0 ? ["-target"] : [])];
|
|
626
|
+
const cone = args.cone !== undefined ? coneArgs(binary, args.cone, fixed, live && !existsSync(join(dir, "estate.chdf.hcl"))) : [];
|
|
513
627
|
const cmd = terraformPlanCommand({
|
|
514
628
|
binary,
|
|
515
629
|
planFile,
|
|
@@ -517,11 +631,14 @@ export async function terraformPlan(args, signal) {
|
|
|
517
631
|
...(args.vars ? { vars: args.vars } : {}),
|
|
518
632
|
...(args.destroy ? { destroy: true } : {}),
|
|
519
633
|
...(args.targets && args.targets.length > 0 ? { targets: args.targets } : {}),
|
|
634
|
+
...(cone.length + lock.length > 0 ? { extra: [...cone, ...lock] } : {}),
|
|
520
635
|
});
|
|
521
636
|
let changed;
|
|
637
|
+
let output = "";
|
|
522
638
|
try {
|
|
523
639
|
const { stdout, stderr } = await run(cmd, dir, env, signal);
|
|
524
640
|
report(stdout, stderr);
|
|
641
|
+
output = `${stdout}\n${stderr}`;
|
|
525
642
|
changed = false;
|
|
526
643
|
}
|
|
527
644
|
catch (err) {
|
|
@@ -535,17 +652,18 @@ export async function terraformPlan(args, signal) {
|
|
|
535
652
|
throw new Error(`${binary} plan failed in ${dir} (exit ${failure.code})${detail ? `\n${detail}` : ""}`);
|
|
536
653
|
}
|
|
537
654
|
report(failure.stdout ?? "", failure.stderr ?? "");
|
|
655
|
+
output = `${failure.stdout ?? ""}\n${failure.stderr ?? ""}`;
|
|
538
656
|
changed = true;
|
|
539
657
|
}
|
|
540
658
|
const jsonRun = await run(terraformShowCommand({ binary, json: true, planFile }), dir, env, signal);
|
|
541
|
-
const
|
|
659
|
+
const text = args.text === false ? "" : (await run(terraformShowCommand({ binary, json: false, planFile }), dir, env, signal)).stdout;
|
|
542
660
|
const json = JSON.parse(jsonRun.stdout);
|
|
543
661
|
return {
|
|
544
662
|
changed,
|
|
545
663
|
planFile,
|
|
546
664
|
dir,
|
|
547
665
|
json,
|
|
548
|
-
text
|
|
666
|
+
text,
|
|
549
667
|
planDigest: terraformPlanDigest(json),
|
|
550
668
|
changeSet: terraformChangeSetPart({
|
|
551
669
|
member: args.root,
|
|
@@ -554,6 +672,7 @@ export async function terraformPlan(args, signal) {
|
|
|
554
672
|
...((root.estate ?? root.workspace) ? { scope: root.estate ?? root.workspace } : {}),
|
|
555
673
|
}),
|
|
556
674
|
...countPlanChanges(json),
|
|
675
|
+
...(cone.length > 0 ? { cone: readPlanCone(output, join(dir, planFile), args.cone) } : {}),
|
|
557
676
|
};
|
|
558
677
|
}
|
|
559
678
|
/**
|
|
@@ -598,7 +717,8 @@ export async function terraformApply(args, signal) {
|
|
|
598
717
|
"Pass the Plan step's own output (`plan.out.planFile`).");
|
|
599
718
|
}
|
|
600
719
|
const planFile = args.planFile;
|
|
601
|
-
const
|
|
720
|
+
const lock = args.lockTimeout !== undefined ? lockTimeoutArgs("apply", args.lockTimeout) : [];
|
|
721
|
+
const cmd = terraformApplyCommand({ binary, planFile, ...(lock.length > 0 ? { extra: lock } : {}) });
|
|
602
722
|
try {
|
|
603
723
|
const { stdout, stderr } = await run(cmd, dir, terraformEnvironment(root), signal);
|
|
604
724
|
report(stdout, stderr);
|
|
@@ -629,7 +749,10 @@ export async function terraformApply(args, signal) {
|
|
|
629
749
|
* asked for the values to hand them on.
|
|
630
750
|
*/
|
|
631
751
|
export async function terraformOutputs(args, signal) {
|
|
632
|
-
|
|
752
|
+
return outputsIn(await resolveRoot(args, signal), signal);
|
|
753
|
+
}
|
|
754
|
+
/** `<binary> output -json` in a resolved root, as `{ name: value }`. */
|
|
755
|
+
async function outputsIn({ binary, root, dir }, signal) {
|
|
633
756
|
const { stdout } = await run(`${binary} output -json`, dir, terraformEnvironment(root), signal);
|
|
634
757
|
const parsed = JSON.parse(stdout || "{}");
|
|
635
758
|
return Object.fromEntries(Object.entries(parsed).map(([name, entry]) => [name, entry?.value]));
|
|
@@ -694,7 +817,7 @@ export async function choudoufuWaveRoot(args, signal) {
|
|
|
694
817
|
if (resolved.root.varFiles && resolved.root.varFiles.length > 0) {
|
|
695
818
|
return { wave: false, reason: "the root has var files, which live-plan-set does not take" };
|
|
696
819
|
}
|
|
697
|
-
if (resolved.root.backendConfig && Object.keys(resolved.root.backendConfig).length > 0) {
|
|
820
|
+
if ((resolved.root.backendConfig && Object.keys(resolved.root.backendConfig).length > 0) || (resolved.root.backendConfigFiles?.length ?? 0) > 0) {
|
|
698
821
|
return { wave: false, reason: "the root has backend config, which live-plan-set does not take" };
|
|
699
822
|
}
|
|
700
823
|
const root = choudoufuSetRootPath(resolved.projectRoot, resolved.dir);
|
|
@@ -764,15 +887,18 @@ function fromProject(projectRoot, path) {
|
|
|
764
887
|
* `live-wave-apply` hands back to choudoufu with the set digest.
|
|
765
888
|
*/
|
|
766
889
|
export async function choudoufuPlanSet(args, signal) {
|
|
767
|
-
|
|
890
|
+
return planSetIn(await resolveRoot(args, signal), args.root, signal);
|
|
891
|
+
}
|
|
892
|
+
/** {@link choudoufuPlanSet} over a resolved root, `key` naming it in errors, in the waves directory and as the change-set member. */
|
|
893
|
+
async function planSetIn(resolved, key, signal) {
|
|
768
894
|
const { binary, root, dir, projectRoot } = resolved;
|
|
769
895
|
if (binary !== "choudoufu")
|
|
770
|
-
throw new Error(`choudoufuPlanSet: root "${
|
|
896
|
+
throw new Error(`choudoufuPlanSet: root "${key}" runs ${binary}, not choudoufu`);
|
|
771
897
|
await ensureChoudoufuWavesVersion(binary, signal);
|
|
772
898
|
const rootPath = choudoufuSetRootPath(projectRoot, dir);
|
|
773
899
|
if (rootPath === undefined)
|
|
774
|
-
throw new Error(`choudoufuPlanSet: root "${
|
|
775
|
-
const wavesDir = choudoufuWavesDir(projectRoot,
|
|
900
|
+
throw new Error(`choudoufuPlanSet: root "${key}" (${dir}) is not inside ${projectRoot}`);
|
|
901
|
+
const wavesDir = choudoufuWavesDir(projectRoot, key);
|
|
776
902
|
mkdirSync(wavesDir, { recursive: true });
|
|
777
903
|
const cmd = choudoufuPlanSetCommand({ binary, root: rootPath, outDir: fromProject(projectRoot, join(wavesDir, "out")) });
|
|
778
904
|
let stdout;
|
|
@@ -790,11 +916,42 @@ export async function choudoufuPlanSet(args, signal) {
|
|
|
790
916
|
report("", failure.stderr ?? "");
|
|
791
917
|
stdout = failure.stdout ?? "";
|
|
792
918
|
}
|
|
793
|
-
const parsed = parseChoudoufuPlanSet(stdout, { member:
|
|
919
|
+
const parsed = parseChoudoufuPlanSet(stdout, { member: key, root: rootPath });
|
|
794
920
|
const planSetFile = join(wavesDir, "plan-set.json");
|
|
795
921
|
writeFileSync(planSetFile, stdout);
|
|
796
922
|
return { ...parsed, planSetFile, root: rootPath };
|
|
797
923
|
}
|
|
924
|
+
async function resolveMemberRoot(args, signal) {
|
|
925
|
+
const binary = "choudoufu";
|
|
926
|
+
await ensureChoudoufuVersion(binary, signal);
|
|
927
|
+
const dir = resolve(args.dir);
|
|
928
|
+
const estate = detectLiveEstate(dir);
|
|
929
|
+
return { binary, root: { dir }, dir, ...(estate !== undefined ? { estate } : {}), live: estate !== undefined, projectRoot: resolve(args.projectRoot) };
|
|
930
|
+
}
|
|
931
|
+
/**
|
|
932
|
+
* The member's outputs as applied (#4455): `choudoufu init`, then `choudoufu
|
|
933
|
+
* output -json` in its directory, the read the `terraform-apply` capability's
|
|
934
|
+
* `outputs` makes for a root. A live estate's outputs come from its record
|
|
935
|
+
* store.
|
|
936
|
+
*/
|
|
937
|
+
export async function choudoufuMemberOutputs(args, signal) {
|
|
938
|
+
const resolved = await resolveMemberRoot(args, signal);
|
|
939
|
+
const { stdout, stderr } = await run(terraformInitCommand({ binary: resolved.binary }), resolved.dir, terraformEnvironment(resolved.root), signal);
|
|
940
|
+
report(stdout, stderr);
|
|
941
|
+
return outputsIn(resolved, signal);
|
|
942
|
+
}
|
|
943
|
+
/**
|
|
944
|
+
* The member planned as a one-root set (#4455), the way a choudoufu root in
|
|
945
|
+
* a gated wave is ({@link choudoufuPlanSet}): `live-plan-set -json` from
|
|
946
|
+
* `projectRoot`. The document's embedded plan carries `planned_values` and
|
|
947
|
+
* `output_changes`, which say what the member's outputs will be.
|
|
948
|
+
*/
|
|
949
|
+
export async function choudoufuMemberPlanSet(args, signal) {
|
|
950
|
+
const resolved = await resolveMemberRoot(args, signal);
|
|
951
|
+
if (!resolved.live)
|
|
952
|
+
throw new Error(`choudoufu member "${args.member}" (${resolved.dir}) declares no live estate, so live-plan-set cannot plan it`);
|
|
953
|
+
return planSetIn(resolved, args.member, signal);
|
|
954
|
+
}
|
|
798
955
|
/**
|
|
799
956
|
* The resume file to hand choudoufu for `setDigest`, from what an earlier
|
|
800
957
|
* attempt carried, or `undefined`. choudoufu refuses a resume file written
|
|
@@ -958,6 +1115,7 @@ export function terraformInitLine(opts) {
|
|
|
958
1115
|
const init = terraformInitCommand({
|
|
959
1116
|
binary: opts.binary,
|
|
960
1117
|
...(opts.backendConfig ? { backendConfig: opts.backendConfig } : {}),
|
|
1118
|
+
...(opts.backendConfigFiles ? { backendConfigFiles: opts.backendConfigFiles } : {}),
|
|
961
1119
|
});
|
|
962
1120
|
return init.replace(`${opts.binary} init`, `${opts.binary} -chdir=${quoteArg(opts.dir)} init`);
|
|
963
1121
|
}
|
|
@@ -1019,7 +1177,12 @@ export function rootIsInitialised(dir, env = process.env) {
|
|
|
1019
1177
|
export async function terraformPlanRead(args, signal) {
|
|
1020
1178
|
const { binary, root, dir } = await resolveRoot(args, signal);
|
|
1021
1179
|
const env = terraformEnvironment(root);
|
|
1022
|
-
const initLine = terraformInitLine({
|
|
1180
|
+
const initLine = terraformInitLine({
|
|
1181
|
+
binary,
|
|
1182
|
+
dir,
|
|
1183
|
+
...(root.backendConfig ? { backendConfig: root.backendConfig } : {}),
|
|
1184
|
+
...(root.backendConfigFiles ? { backendConfigFiles: root.backendConfigFiles } : {}),
|
|
1185
|
+
});
|
|
1023
1186
|
const notInitialised = (detail) => new TerraformPlanReadError("not-initialised", `terraform.roots.${args.root} (${dir}) ${detail}: run \`${initLine}\` first. chant never runs init on a read, since init writes into the root.`, dir, initLine);
|
|
1024
1187
|
if (!rootIsInitialised(dir, { ...process.env, ...env }))
|
|
1025
1188
|
throw notInitialised("has never been initialised");
|
|
@@ -1255,6 +1418,43 @@ export async function choudoufuLivePlan(args, signal) {
|
|
|
1255
1418
|
...parseChoudoufuPlanSummary(text),
|
|
1256
1419
|
};
|
|
1257
1420
|
}
|
|
1421
|
+
/**
|
|
1422
|
+
* `choudoufu live-graph -json -from-plan=<file>` (choudoufu#2285, read by
|
|
1423
|
+
* chant#4528): the root's graph as one engine graph document, its facts taken
|
|
1424
|
+
* from a `live-plan -json` document this process already read. No second live
|
|
1425
|
+
* read: choudoufu builds the graph from the configuration and that file
|
|
1426
|
+
* alone, starts no provider and calls no cloud, so facts and verdicts come
|
|
1427
|
+
* from the same refresh (choudoufu #1014).
|
|
1428
|
+
*
|
|
1429
|
+
* A usage error ({@link classifyLiveGraphFailure}) resolves `supported:
|
|
1430
|
+
* false` rather than throwing, since the caller degrades to no facts; any
|
|
1431
|
+
* other failure throws with choudoufu's output. Warnings (an empty scope
|
|
1432
|
+
* estate, a plan without `observed_at`) go to stderr and are echoed like
|
|
1433
|
+
* every other activity's.
|
|
1434
|
+
*/
|
|
1435
|
+
export async function choudoufuLiveGraph(args, signal) {
|
|
1436
|
+
const resolved = await resolveRoot(args, signal);
|
|
1437
|
+
const { binary, dir } = resolved;
|
|
1438
|
+
const env = terraformEnvironment(resolved.root);
|
|
1439
|
+
const estateFlag = resolved.estate === undefined && args.estate !== undefined ? { estate: args.estate } : {};
|
|
1440
|
+
const cmd = choudoufuLiveGraphCommand({ binary, fromPlan: args.fromPlan, ...estateFlag });
|
|
1441
|
+
try {
|
|
1442
|
+
const { stdout, stderr } = await run(cmd, dir, env, signal);
|
|
1443
|
+
if (stderr)
|
|
1444
|
+
console.error(stderr);
|
|
1445
|
+
return { supported: true, json: JSON.parse(liveDocumentFrom(stdout)), dir };
|
|
1446
|
+
}
|
|
1447
|
+
catch (err) {
|
|
1448
|
+
const failure = err;
|
|
1449
|
+
if (typeof failure.code !== "number")
|
|
1450
|
+
throw err;
|
|
1451
|
+
const output = `${failure.stderr ?? ""}\n${failure.stdout ?? ""}`;
|
|
1452
|
+
const detail = output.trim().split("\n").find((line) => line.trim() !== "")?.trim() ?? `exit ${failure.code}`;
|
|
1453
|
+
if (classifyLiveGraphFailure(failure.code, output) === "unsupported")
|
|
1454
|
+
return { supported: false, detail, dir };
|
|
1455
|
+
throw new Error(`${binary} live-graph failed in ${dir} (exit ${failure.code})${detail ? `\n${output.trim()}` : ""}`);
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1258
1458
|
/**
|
|
1259
1459
|
* `choudoufu live-ls -estate=<estate> -json [-consistent]`: every resource
|
|
1260
1460
|
* the account holds under the estate, read straight from the Resource Groups
|
|
@@ -37,6 +37,7 @@ export declare const terraformInitContract: import("@intentius/chant/op").Activi
|
|
|
37
37
|
}, {
|
|
38
38
|
dir: string;
|
|
39
39
|
workspace?: string | undefined;
|
|
40
|
+
rootPath?: string | undefined;
|
|
40
41
|
}>;
|
|
41
42
|
export declare const terraformPlanContract: import("@intentius/chant/op").ActivityContract<{
|
|
42
43
|
root: string;
|
|
@@ -155,6 +156,32 @@ export declare const choudoufuAdoptContract: import("@intentius/chant/op").Activ
|
|
|
155
156
|
ambiguous: number;
|
|
156
157
|
dir: string;
|
|
157
158
|
}>;
|
|
159
|
+
/**
|
|
160
|
+
* `choudoufuPlanSet` (#4483): one live choudoufu root planned as a one-root
|
|
161
|
+
* set. `changeSet` is the root's part, the field an Op hands to
|
|
162
|
+
* `composeChangeSet`; `planDigest` is what a gate binds; `planSetFile` and
|
|
163
|
+
* `setDigest` are what a later `live-wave-apply` takes.
|
|
164
|
+
*/
|
|
165
|
+
export declare const choudoufuPlanSetContract: import("@intentius/chant/op").ActivityContract<{
|
|
166
|
+
root: string;
|
|
167
|
+
cwd?: string | undefined;
|
|
168
|
+
}, {
|
|
169
|
+
setDigest: string;
|
|
170
|
+
rootDigest: string;
|
|
171
|
+
planDigest: string;
|
|
172
|
+
changed: boolean;
|
|
173
|
+
json: unknown;
|
|
174
|
+
changeSet: {
|
|
175
|
+
member: {
|
|
176
|
+
[x: string]: unknown;
|
|
177
|
+
member: string;
|
|
178
|
+
planDigest: string | null;
|
|
179
|
+
};
|
|
180
|
+
entries: unknown[];
|
|
181
|
+
};
|
|
182
|
+
planSetFile: string;
|
|
183
|
+
root: string;
|
|
184
|
+
}>;
|
|
158
185
|
/**
|
|
159
186
|
* `terraformPinRollout` (#3189). It names no `terraform.roots` key: a rollout
|
|
160
187
|
* moves a module's pin across many roots, found by directory, so it carries no
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity-contracts.d.ts","sourceRoot":"","sources":["../../src/op/activity-contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AA+BH,eAAO,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"activity-contracts.d.ts","sourceRoot":"","sources":["../../src/op/activity-contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AA+BH,eAAO,MAAM,qBAAqB;;;;;;;;;EAUjC,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;EAoBjC,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;EAWlC,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;EAYjC,CAAC;AAEF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;EAwBrC,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;EASnC,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;EAKtC,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;EAgBlC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;EAcpC,CAAC;AAKF;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BvC,CAAC"}
|
|
@@ -57,7 +57,9 @@ export const terraformInitContract = activityContract("terraformInit", z.strictO
|
|
|
57
57
|
...rootArgs,
|
|
58
58
|
upgrade: z.boolean().optional(),
|
|
59
59
|
reconfigure: z.boolean().optional(),
|
|
60
|
-
}),
|
|
60
|
+
}),
|
|
61
|
+
// `rootPath` (#4482) is what TerraformApplyOp's Init step publishes as `TerraformRootPath`; OPS012 checks it here.
|
|
62
|
+
z.object({ dir: z.string(), workspace: z.string().optional(), rootPath: z.string().optional() }), rootEntity);
|
|
61
63
|
export const terraformPlanContract = activityContract("terraformPlan", z.strictObject({
|
|
62
64
|
...rootArgs,
|
|
63
65
|
planFile: z.string().optional(),
|
|
@@ -127,6 +129,22 @@ export const choudoufuAdoptContract = activityContract("choudoufuAdopt", z.stric
|
|
|
127
129
|
ambiguous: z.number(),
|
|
128
130
|
dir: z.string(),
|
|
129
131
|
}), rootEntity);
|
|
132
|
+
/**
|
|
133
|
+
* `choudoufuPlanSet` (#4483): one live choudoufu root planned as a one-root
|
|
134
|
+
* set. `changeSet` is the root's part, the field an Op hands to
|
|
135
|
+
* `composeChangeSet`; `planDigest` is what a gate binds; `planSetFile` and
|
|
136
|
+
* `setDigest` are what a later `live-wave-apply` takes.
|
|
137
|
+
*/
|
|
138
|
+
export const choudoufuPlanSetContract = activityContract("choudoufuPlanSet", z.strictObject({ ...rootArgs }), z.object({
|
|
139
|
+
setDigest: z.string(),
|
|
140
|
+
rootDigest: z.string(),
|
|
141
|
+
planDigest: z.string(),
|
|
142
|
+
changed: z.boolean(),
|
|
143
|
+
json: z.unknown(),
|
|
144
|
+
changeSet: z.object({ member: z.object({ member: z.string(), planDigest: z.string().nullable() }).passthrough(), entries: z.array(z.unknown()) }),
|
|
145
|
+
planSetFile: z.string(),
|
|
146
|
+
root: z.string(),
|
|
147
|
+
}), rootEntity);
|
|
130
148
|
/** One root of a pin-bump rollout ({@link PinRoot} in `../pin/waves.ts`). */
|
|
131
149
|
const pinRoot = z.strictObject({ root: z.string(), dependsOn: z.array(z.string()).optional(), tsSource: z.string().optional() });
|
|
132
150
|
/**
|
package/dist/op/builders.d.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* path a second time.
|
|
16
16
|
*/
|
|
17
17
|
import { type ActivityStep, type NamedActivityStep, type WithStepRefs } from "@intentius/chant/op";
|
|
18
|
-
import type { TerraformInitArgs, TerraformPlanArgs, TerraformApplyArgs, TerraformShowArgs, ChoudoufuLivePlanArgs, ChoudoufuLiveLsArgs, ChoudoufuLiveCheckArgs, ChoudoufuAdoptArgs } from "./activities/terraform.js";
|
|
18
|
+
import type { TerraformInitArgs, TerraformPlanArgs, TerraformApplyArgs, TerraformShowArgs, ChoudoufuLivePlanArgs, ChoudoufuLiveLsArgs, ChoudoufuLiveCheckArgs, ChoudoufuAdoptArgs, TerraformRootArgs } from "./activities/terraform.js";
|
|
19
19
|
import type { TerraformPinRolloutArgs } from "./activities/pin-rollout.js";
|
|
20
20
|
/** Extra opts every wrapper below accepts alongside its activity's own fields. */
|
|
21
21
|
type StepOpts = {
|
|
@@ -95,6 +95,12 @@ export declare const choudoufuAdopt: (root: string, opts: WithStepRefs<Omit<Chou
|
|
|
95
95
|
* provider.
|
|
96
96
|
*/
|
|
97
97
|
export declare const terraformShow: (root: string, opts?: WithStepRefs<Omit<TerraformShowArgs, "root">> & StepOpts) => NamedActivityStep;
|
|
98
|
+
/**
|
|
99
|
+
* `choudoufuPlanSet` (#4483): `live-plan-set -json` over one live choudoufu
|
|
100
|
+
* root. Hand `step.out.changeSet` from each root's step to `composeChangeSet`
|
|
101
|
+
* to make one change-set document over several roots, such as one per cloud.
|
|
102
|
+
*/
|
|
103
|
+
export declare const choudoufuPlanSet: (root: string, opts?: WithStepRefs<Omit<TerraformRootArgs, "root">> & StepOpts) => NamedActivityStep;
|
|
98
104
|
/**
|
|
99
105
|
* One run of a pin-bump rollout (#3189). `opts` is
|
|
100
106
|
* {@link TerraformPinRolloutArgs} itself. It names no root: the rollout finds
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builders.d.ts","sourceRoot":"","sources":["../../src/op/builders.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"builders.d.ts","sourceRoot":"","sources":["../../src/op/builders.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAExE,kFAAkF;AAClF,KAAK,QAAQ,GAAG;IAAE,OAAO,CAAC,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnE;;;;;GAKG;AACH,eAAO,MAAM,aAAa,SAClB,MAAM,SACL,YAAY,CAAC,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC,GAAG,QAAQ,KAC9D,iBAGF,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,SAClB,MAAM,SACL,YAAY,CAAC,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC,GAAG,QAAQ,KAC9D,iBAGF,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,SACnB,MAAM,SACL,YAAY,CAAC,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC,GAAG,QAAQ,KAC/D,iBAGF,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,iBAAiB,SACtB,MAAM,SACL,YAAY,CAAC,IAAI,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC,GAAG,QAAQ,KAClE,iBAOF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,SACpB,MAAM,SACL,YAAY,CAAC,IAAI,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC,GAAG,QAAQ,KAChE,iBAOF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,SACvB,MAAM,SACL,YAAY,CAAC,IAAI,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAAC,GAAG,QAAQ,KACnE,iBAOF,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,SACnB,MAAM,QACN,YAAY,CAAC,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC,GAAG,QAAQ,KAC9D,iBAOF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,SAClB,MAAM,SACL,YAAY,CAAC,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC,GAAG,QAAQ,KAC9D,iBAOF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,SACrB,MAAM,SACL,YAAY,CAAC,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC,GAAG,QAAQ,KAC9D,iBAGF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,SAAU,YAAY,CAAC,uBAAuB,CAAC,GAAG,QAAQ,KAAG,iBAG5F,CAAC"}
|
package/dist/op/builders.js
CHANGED
|
@@ -112,6 +112,15 @@ export const terraformShow = (root, opts) => {
|
|
|
112
112
|
const { args, profile, id } = takeProfileAndId(opts);
|
|
113
113
|
return activity("terraformShow", { root, ...args }, { profile: profile ?? "fastIdempotent", ...(id ? { id } : {}) });
|
|
114
114
|
};
|
|
115
|
+
/**
|
|
116
|
+
* `choudoufuPlanSet` (#4483): `live-plan-set -json` over one live choudoufu
|
|
117
|
+
* root. Hand `step.out.changeSet` from each root's step to `composeChangeSet`
|
|
118
|
+
* to make one change-set document over several roots, such as one per cloud.
|
|
119
|
+
*/
|
|
120
|
+
export const choudoufuPlanSet = (root, opts) => {
|
|
121
|
+
const { args, profile, id } = takeProfileAndId(opts);
|
|
122
|
+
return activity("choudoufuPlanSet", { root, ...args }, { profile: profile ?? "longInfra", ...(id ? { id } : {}) });
|
|
123
|
+
};
|
|
115
124
|
/**
|
|
116
125
|
* One run of a pin-bump rollout (#3189). `opts` is
|
|
117
126
|
* {@link TerraformPinRolloutArgs} itself. It names no root: the rollout finds
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Hcl2Json } from "@intentius/chant/terraform/hcl2json";
|
|
2
|
+
import { normalizeModuleSource, PUBLIC_REGISTRY_HOST } from "../registry/source-forms.js";
|
|
3
|
+
import { type ModuleCallPin } from "./source.js";
|
|
4
|
+
export { normalizeModuleSource, PUBLIC_REGISTRY_HOST };
|
|
5
|
+
/** One module call in a consuming repo. */
|
|
6
|
+
export interface ModuleConsumer {
|
|
7
|
+
/** The root (or Terragrunt unit) directory, from the repo's top, `/`-separated. */
|
|
8
|
+
root: string;
|
|
9
|
+
/** The file holding the call, from the repo's top. */
|
|
10
|
+
file: string;
|
|
11
|
+
/** The block: `module.<name>`, or `terragrunt.terraform` for a unit's source. */
|
|
12
|
+
address: string;
|
|
13
|
+
/** `terraform` for a module block, `terragrunt` for a unit's `terraform { source }`. */
|
|
14
|
+
kind: "terraform" | "terragrunt";
|
|
15
|
+
/** The `source` as written. */
|
|
16
|
+
source: string;
|
|
17
|
+
/** The module the call names: the source with the pin taken out, normalised. */
|
|
18
|
+
module: string;
|
|
19
|
+
/** The pinned version, tag, digest or ref, or null when the call pins none. */
|
|
20
|
+
pin: string | null;
|
|
21
|
+
/** Where the pin is, as `readModulePin` reads it. */
|
|
22
|
+
at: ModuleCallPin["at"];
|
|
23
|
+
param?: ModuleCallPin["param"];
|
|
24
|
+
/** Why there is no pin, when `pin` is null. */
|
|
25
|
+
unpinned?: string;
|
|
26
|
+
}
|
|
27
|
+
/** A source names a local directory, not a published module. */
|
|
28
|
+
export declare function isLocalSource(source: string): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Every module call in `roots` (directories from `repo`), sorted by root,
|
|
31
|
+
* file and address. A root whose files cannot be parsed throws, naming the
|
|
32
|
+
* root, so a check job fails loudly instead of listing fewer consumers.
|
|
33
|
+
*/
|
|
34
|
+
export declare function moduleConsumers(repo: string, roots: readonly string[], parser?: Hcl2Json): Promise<ModuleConsumer[]>;
|
|
35
|
+
//# sourceMappingURL=consumers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consumers.d.ts","sourceRoot":"","sources":["../../src/pin/consumers.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAEpE,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACvF,OAAO,EAAiB,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAE7D,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,CAAC;AAEvD,2CAA2C;AAC3C,MAAM,WAAW,cAAc;IAC7B,mFAAmF;IACnF,IAAI,EAAE,MAAM,CAAC;IACb,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,iFAAiF;IACjF,OAAO,EAAE,MAAM,CAAC;IAChB,wFAAwF;IACxF,IAAI,EAAE,WAAW,GAAG,YAAY,CAAC;IACjC,+BAA+B;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,gFAAgF;IAChF,MAAM,EAAE,MAAM,CAAC;IACf,+EAA+E;IAC/E,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,qDAAqD;IACrD,EAAE,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;IACxB,KAAK,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IAC/B,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,gEAAgE;AAChE,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAErD;AAMD;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAgC1H"}
|