Comments (5)
One thing that makes this more complicated is deciding precisely when to expand templates.
If we do it after parsing happens, then the YAML/JSON parsers will encounter syntax errors.
If we do it before parsing, on the other hand, we don't yet have type information about the stack's properties; as such, the context object's parameters will be weakly typed during the template's execution (a map[string]interface{}
or somesuch). This seems messy.
Catch-22, kinda sorta. More thinking required ...
from pulumi.
After noodling on this more, I wonder whether templates are the right solution. The more I dig into the design/implementation, the more C++ deja vu I get, complete with all the problems known to afflict the preprocessor. (Clang's modules doc lays out many of them.) The challenge is that it's less obvious how JSON/YAML could be used in a more "module-like" way without devolving into template substitution, and without us basically reinventing our own templating system.
from pulumi.
For YAML, it's possible some combination of anchors (&
), references (*
), and associative array merges (<<
) can do part of this. But this would be YAML-specific and obscure and still not as expressive as we may need (e.g., you can't do concatenation, call arbitrary functions, etc).
from pulumi.
Another thought on this. If we think about the metadata, there are actually two discrete sections:
- the true metadata about the name, description, properties, and so on;
- the blueprint for service construction.
As we consider the DSL extensions (#22), we would still consider 1 to be metadata (in a Mu.yaml
file), while 2 would be taken from source code.
And this is the key insight. Perhaps templating should only be allowed within the service blueprint section (services
) of the Mu.yaml
file, just as "code execution" in the DSL sense is limited to the code we run to create the services. If we took that approach, we could do the templating in a sensible way, although it requires incremental parsing/semantic analysis of multiple artifacts.
from pulumi.
We've decided to move away from templating and instead use a real language approach. Therefore, this work item is obsolete. Closing.
from pulumi.
Related Issues (20)
- v3.112.0 release blocked on Python package publish HOT 2
- Workflow failure: On Push HOT 2
- Allow destroy to proceed for resources that are dependent on undeletable resources
- Refactor ProgressDisplay to remove circular dependencies and make modes explicit
- Change plugin download and installation to use engine events for progress
- Change policy pack installation to use events to record completion
- unknown provider after upgrading Pulumi urn:pulumi:dev::api::pulumi:providers:aws::default_6_25_0 HOT 8
- Control AWS Lambda Function source code update with custom hash in Dynamic Resource Provider
- unable to open bucket HOT 1
- Display Fully Qualified Type Names in Go Generated Documentation
- xTransforms does not work to set custom timeouts for awsx.ecs.FargateService HOT 1
- Retrieve stack outputs programatically without running pulumi up
- Azure DevOps pipelines - support colors in pulumi CLI output HOT 2
- pulumi-nodejs: Docker tag 3.112.0 is missing HOT 1
- `pulumi new` half-created a stack
- Example converter adds trailing whitespace HOT 1
- "Error: provider resources may not be read" in Pulumi Inline Program with Automation API
- Support count meta-argument HOT 1
- Panic in pulumi new --ai
- `FileArchive` state does not survive `refresh` operations HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pulumi.