mirror of https://github.com/databricks/cli.git
153141d3ea
`terraform show -json` (`terraform.Show()`) fails if the state file contains resources with fields that non longer conform to the provider schemas. This can happen when you deploy a bundle with one version of the CLI, then updated the CLI to a version that uses different databricks terraform provider, and try to run `bundle run` or `bundle summary`. Those commands don't recreate local terraform state (only `terraform apply` or `plan` do) and terraform itself fails while parsing it. [Terraform docs](https://developer.hashicorp.com/terraform/language/state#format) point out that it's best to use `terraform show` after successful `apply` or `plan`. Here we parse the state ourselves. The state file format is internal to terraform, but it's more stable than our resource schemas. We only parse a subset of fields from the state, and only update ID and ModifiedStatus of bundle resources in the `terraform.Load` mutator. |
||
---|---|---|
.. | ||
artifacts | ||
config | ||
deploy | ||
deployer | ||
env | ||
internal | ||
libraries | ||
metadata | ||
permissions | ||
phases | ||
python | ||
run | ||
schema | ||
scripts | ||
tests | ||
bundle.go | ||
bundle_read_only.go | ||
bundle_test.go | ||
context.go | ||
context_test.go | ||
deferred.go | ||
deferred_test.go | ||
log_string.go | ||
mutator.go | ||
mutator_read_only.go | ||
mutator_test.go | ||
parallel.go | ||
parallel_test.go | ||
root.go | ||
root_test.go | ||
seq.go | ||
seq_test.go |