10000 `terraform validate` to output the full list of errors · Issue #37198 · hashicorp/terraform · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
terraform validate to output the full list of errors #37198
Open
@wuxu92

Description

@wuxu92

Terraform Version

Terraform v1.11.3
on linux_amd64

Use Cases

Currently the terraform validate will:

  1. skip the validation of the resource when any dependency resource has validation error
  2. skip the validation from provider if any required attribute is missing or non-support attribute exists

In this case, if there is an error in the provider block, all resources of this provider is not validated, or other cases can cause resources are not validated. so customers may need to fix one error and then run terraform validate again to get new errors, and continue this work until all errors to be fixed.

Attempted Solutions

As the state is not required and each step in the validation command operates independently, it remains possible to validate the configuration even if errors exist in the dependencies.

By adding a new argument to validate command, like -all or something like it. we don't skip validate if dependencies has errors, and don't skip provider validate if schema check has errors (required attributes not exists and unsupported attributes exists). So we can run terraform validate -all to get as many errors as possible of my configuration.

Proposal

No proposal has been made yet, but if this is feasible and valuable to you, I would be glad to submit a pull request for it.

References

if depsSuccess {
diags = w.Callback(v)
} else {
log.Printf("[TRACE] dag/walk: upstream of %q errored, so skipping", VertexName(v))

configVal, _, valDiags := ctx.EvaluateBlock(n.Config.Config, schema.Body, nil, keyData)
diags = diags.Append(valDiags)
if valDiags.HasErrors() {
return diags

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0