-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Description
Currently, there is no command to extract and display the outputs section from a module's facets.yaml file. While we have get-output-types for listing control plane output types and get-resources for listing Terraform resources, we lack a way to quickly view what outputs a module exposes without manually opening and reading the facets.yaml file.
Current Behavior
ftf get-resources <path>- Lists Terraform resources from .tf filesftf get-output-types- Lists output types registered in control planeftf get-output-type-details -o <type>- Shows control plane output type detailsftf preview-module <path>- Reads outputs.tf and generates output.facets.yaml- ❌ No command to view the outputs section from facets.yaml
Requested Enhancement
Add a new command to extract and display the outputs section from a module's facets.yaml file.
Proposed Command
ftf get-module-outputs <module_path> [OPTIONS]Options
<module_path>: Path to the module directory (required)--output-name: (Optional) Filter to show specific output only--format: Output format (yaml/json, default: yaml)
Use Cases
- Module Interface Discovery: Quickly understand what outputs a module exposes without opening files
- Input Compatibility Checking: Verify output types before wiring as inputs to other modules
- Documentation: Generate output documentation for modules
- Module Comparison: Compare output definitions across different module flavors
- Validation: Verify output configurations during development
- CI/CD: Programmatic access to module output metadata
Example Output
outputs:
default:
type: "@facets/postgres"
title: "PostgreSQL Database"
providers:
postgresql:
source: "hashicorp/postgresql"
version: ">= 1.0"
attributes:
host: attributes.endpoint
port: attributes.port
attributes.connection_string:
type: "@facets/postgres-connection-string"
title: "Database Connection String"With --output-name default:
type: "@facets/postgres"
title: "PostgreSQL Database"
providers:
postgresql:
source: "hashicorp/postgresql"
version: ">= 1.0"
attributes:
host: attributes.endpoint
port: attributes.portImplementation Notes
- Use existing
load_facets_yaml(path)utility from ftf_cli/utils.py - Extract the
outputssection from the loaded YAML - Support both YAML and JSON output formats
- Handle cases where outputs section is missing or empty
- Optional filtering by specific output name using dot notation
- Should work offline (no control plane API calls needed)
Related Files
ftf_cli/utils.py- Containsload_facets_yaml()helperftf_cli/commands/get_resources.py- Similar pattern for reading module infoftf_cli/commands/validate_facets.py- Uses facets.yaml reading
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request