Add file() directive support for modularizing manifest values#11
Merged
jeffreyaven merged 1 commit intomainfrom Feb 23, 2026
Merged
Add file() directive support for modularizing manifest values#11jeffreyaven merged 1 commit intomainfrom
jeffreyaven merged 1 commit intomainfrom
Conversation
Introduces a `file()` directive that can be used in manifest property values to include contents from external JSON or YAML files. This allows large, complex values (e.g., IAM policy statements) to be extracted into separate files for better readability and reuse. File paths are resolved relative to the `resources/` directory, consistent with how `file:` on resources resolves query files. Supports JSON (.json) and YAML (.yml/.yaml) files, with recursive resolution of nested file() directives. https://claude.ai/code/session_01FikwxWpZdvhtNbECVWJiqK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for
file()directives in manifest property values, enabling users to modularize large manifest values (such as IAM policy statements) into separate JSON or YAML files.Key Changes
FileIncludeErrortoManifestErrorenum for file resolution failuresparse_file_directive()to extract file paths fromfile(path)syntax with flexible whitespace handlingresolve_file_directives()to recursively traverse and resolvefile()directives in YAML/JSON value trees (strings, sequences, and mappings)load_file_contents()to read and parse referenced files with support for:.jsonextension).yml,.yamlextensions)resolve_manifest_file_directives()to process all globals and resource properties in a manifestManifest::load_from_file()to automatically resolve file directives relative to<stack_dir>/resources/directoryImplementation Details
file()directives are resolved relative to theresources/subdirectory under the manifest's parent directoryfile()directives{{ stack_name }}) are left untouchedhttps://claude.ai/code/session_01FikwxWpZdvhtNbECVWJiqK