-
-
Notifications
You must be signed in to change notification settings - Fork 117
Update !include
YAML function. Add unit tests. Update docs
#1179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Warning This PR exceeds the recommended limit of 1,000 lines.Large PRs are difficult to review and may be rejected due to their size. Please verify that this PR does not address multiple issues. |
Important Cloud Posse Engineering Team Review RequiredThis pull request modifies files that require Cloud Posse's review. Please be patient, and a core maintainer will review your changes. To expedite this process, reach out to us on Slack in the |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1179 +/- ##
==========================================
+ Coverage 28.34% 28.69% +0.34%
==========================================
Files 182 182
Lines 21284 21301 +17
==========================================
+ Hits 6034 6112 +78
+ Misses 14280 14199 -81
- Partials 970 990 +20
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
These changes were released in v1.169.0. |
what
!include
YAML function!include
functions)why
Make Atmos to resolve the
!include
functions during the initial phase of YAML stack manifest processing (in contrast to the other YAML functions, which are processed during the very last stage of stack processing).At this initial stage, the
!include
functions evaluate and substitute the contents of included files, converting them into the appropriate data types (e.g., string, boolean, map, or list) before assigning them to the corresponding sections or attributes in the Atmos stack configurations.Key implications of this behavior:
The
!include
functions facilitate stack configuration reuse by enabling modularization of common configurations.These configurations can reside in separate local or remote files and be referenced in multiple stack definitions,
promoting a DRY approach.
The functions preprocess YAML files before Atmos resolves stacks and components.
This enables configuration Inheritance and deep-merging of stack parameters after the
!include
directives are expanded.When transitioning from plain Terraform/OpenTofu to Atmos,
!include
allows seamless reuse of existing variablefiles (
varfiles
) by referencing them in thevars
sections of Atmos components: