Open
Description
Context
Currently whenever there are "dependent body mismatches", such as in the examples below, we silently suppress the validation:
Core Schema
resource "aws_instance" "name" {
provisioner "non-existent" {
}
}
data "terraform_remote_state" "name" {
backend = "nonsense"
}
terraform {
backend "nonsense" {
}
}
Provider Schema
provider "non-sense" {
}
resource "non-sense" "foo" {
}
In the case of provider schemas, there is additional complexity to be aware of. We may not have a reliable way of knowing whether or not is a resource type is valid or not. Providers are a little easier but we'd still have to rely heavily on what is declared in required_providers
. Implied hashicorp/
providers may be a bit trickier.
Proposal
- hcl-lang: Update body merging logic to ensure that validation logic can tell when there's an obvious mismatch
- Bear in mind there can be still edge cases like interpolation which is worth investigating separately as part of Introduce attribute (interpolated) value based validation #1483