Skip to content

cmd/providers-schema: Read schemas from any init'd or bundled providers #24261

Open
@radeksimko

Description

@radeksimko

Terraform Version

Terraform v0.12.21

Terraform Configuration Files

provider "github" {
}
provider "aws" {
}
terraform init

Alternatively the user may have an empty config and supply providers bundled via terraform-bundle.

Expected Behavior

I would expect terraform providers schema -json to have a flag which allows us to just dump schemas of all providers available from a given plugin directory.

Actual Behavior

Terraform parses config to figure out what providers are actually in use and only returns schema for those which are.

Relatedly terraform providers schema -json will error out if the config is invalid, e.g.

provider "github" {
  org
}
provider "aws" {
}

Steps to Reproduce

terraform providers schema -json

Additional Context

This is somewhat necessary functionality for a Language Server as it may need to get/update schema of providers when config may be either invalid or non-existent.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions