Repository navigation
Allow importing a file with specific overrides upon import without changing import #307
Description
Activity
osterman commented
on Jan 20, 2023 MemberMore actionsAlso, could be implemented using #267
osterman commented
on Jan 20, 2023 MemberMore actionsI like this syntax, borrowed/inspired from "Home Assistant"
This is
orgs/acme/plat/dev/us-east-1.yaml, which deploys 2 EKS clusters, blue and green.imports: - path: catalog/eks/cluster input: color: blue - path: catalog/eks/cluster input: color: greenThis is
catalog/eks/cluster.yamlinputs: color: type: string values: - blue - green description: The color of the cluster components: terraform: eks-{{ inputs.color }}/cluster: vars: enabled: true name: {{ inputs.color }}yes, this is a good idea. It can be implemented like the following:
- We add
importskeyword to have the following schema:
imports: - path: catalog/eks/cluster input: {} # Or context: {}
We have
import, but we don't want to change it for backwards compatibility- We add support for
Gotemplates into all files. If those files are imported, we process the templates with he data frominput/context
Reacted by Erik Osterman (Cloud Posse)- We add
Posting my proposal for reference https://cloudposse.slack.com/archives/CA4TC65HS/p1674832541932279
"Ansible-style" yaml for atmos
import: - catalog/eks/cluster - catalog/eks/karpenter - catalog/eks/karpenter-provisioner - catalog/eks/efs ... vars: region: us-east-2 region_short: ue2 tenant: plat stage: dev stack: "{{ tenant }}-{{ region_short }}" description: "Component instance {{ name }} at {{ stack }}" components: terraform: eks/reloader: vars: enabled: true name: reloader repository: "https://stakater.github.io/stakater-charts" chart: "{{ name }}" chart_version: "v1.0.1" create_namespace: true kubernetes_namespace: "{{ name }}" tags: Team: sre Service: "{{ name }}" Region: "{{ region }}" Tenant: "{{ Tenant }}" Stack: "{{ stack }}" Description: "{{ description }}" values: # https://github.com/stakater/Reloader/tree/master/deployments/kubernetes/chart/reloader rbac: enabled: true serviceAccount: create: true name: "{{ name }}" resources: limits: cpu: "20m" memory: "128Mi" requests: cpu: "10m" memory: "64Mi"note that vars defined on root level vars map (these are kind of global vars), and component level maps are both available at the component level. Both vars maps are self-defining - the map is rendered using itself:
- Deep meerge all vars maps up the tree
- vars_map.render(vars_map) - rendering the map using the map itself, so you can reuse vars in other vars
- pass rendered map to a component
Then we basically define component templates in a catalog, and only importing catalog + customizing vars down the tree. And of course you can still override the whole component like currently
I tried to put all possible relations in the example. Note how description is defined on top level uses name where name doesn’t exist yet. It means whenever you try to instantiate a component without name defined you will get a template error (undefined variable). So you can write templates using some variables that you assume will be defined later, in stack, in region, or down to component specific vars. In this way we can also standardize tags sets etc.
- added a commit that references this issue
on Oct 2, 2026
Have a question? Please checkout our Slack Community or visit our Slack Archive.
Describe the Feature
What we do currently which returns
datadog-agentandexamplecomponents inue1-devThis could prefix components with the same baseline which would return
eks-new/datadog-agentandeks-new/examplecomponents inue2-devExpected Behavior
Prefix component names from a catalog and/or override vars
Use Case
Add eks baseline multiple times without having to create duplicate baselines with new prefixes
Describe Ideal Solution
See above
Alternatives Considered
Status quo of duplicating baseline files
Additional Context
N/A