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. |
||
---|---|---|
.. | ||
tfdyn | ||
apply.go | ||
convert.go | ||
convert_test.go | ||
destroy.go | ||
dir.go | ||
import.go | ||
init.go | ||
init_test.go | ||
interpolate.go | ||
interpolate_test.go | ||
load.go | ||
load_test.go | ||
pkg.go | ||
pkg_test.go | ||
plan.go | ||
state_pull.go | ||
state_pull_test.go | ||
state_push.go | ||
state_push_test.go | ||
state_test.go | ||
unbind.go | ||
util.go | ||
util_test.go | ||
write.go |