-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Problem
The validation process needs to ensure that inputs defined in the variable.inputs block in variables.tf are correctly structured based on the output lookup tree of the output types specified in the inputs section of facets.yaml.
Currently, there's no validation to verify that when a module's facets.yaml defines inputs with specific output types, the corresponding variables.tf file's variable.inputs object structure matches the expected output schema.
Current State
facets.yamlcontains aninputssection defining input requirements with output typesvariables.tfcontains avariable "inputs"block with object type definition- No validation exists to ensure the Terraform inputs structure matches the expected output lookup tree
Expected Behavior
When running validation commands (like ftf validate-directory), the tool should:
- Parse the
inputssection fromfacets.yamlto identify required input output types - Fetch the output lookup tree/schema for each specified output type
- Parse the
variable.inputstype definition fromvariables.tf - Validate that the Terraform inputs structure matches the expected output schemas
- Report any mismatches or missing input definitions with clear error messages
Example
If facets.yaml defines:
inputs:
database:
type: "@outputs/postgres"
storage:
type: "@outputs/s3"Then variables.tf should have matching structure in the inputs variable that corresponds to the output schemas of postgres and s3 modules.
Impact
This validation will ensure that modules correctly define their input dependencies and prevent runtime errors due to mismatched input structures.