parse

package
v1.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package parse determines what resources and datasources a Terraform provider exposes, and writes the result to {provider}-members.json in the current working directory. The rest of pike consumes that JSON at runtime to validate mapping coverage.

There are two extraction strategies. The schema-based path (default) runs `terraform providers schema -json` against a throwaway init'd workspace and reads the provider's declared resource and datasource schemas directly. It is fast, authoritative, and requires terraform (or a tofu binary symlinked as terraform) plus network access to the provider registry.

The docs-based path walks a local checkout of the provider's source repository and greps the markdown documentation for resource and datasource declarations. It's slower, inferred rather than authoritative, and kept as a fallback for offline/airgapped use or for providers that don't publish a registry schema.

Parse tries the schema path first. If that fails AND a codebase directory was supplied, it falls back to the docs path. If the schema path fails and no codebase was supplied, the schema error is returned verbatim.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmbeddedMembers

func EmbeddedMembers(name string) []byte

EmbeddedMembers returns the raw members JSON for a provider by its short name (aws, azurerm/azure, google/gcp). Unknown names return nil; empty byte slices indicate an embedded-but-empty file, which in practice only happens if the members JSON was deleted before build.

func Parse

func Parse(codebase string, name string) error

Parse is the package entrypoint. It writes {name}-members.json to the current working directory.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL