shalb / cluster.dev

Cloud-native infrastructure templating. Creating cloud installers for SaaS. Replication of complex cloud-native infrastructures.
https://docs.cluster.dev/
GNU Affero General Public License v3.0
401 stars 36 forks source link

Variables in Project and Stack do not support nested objects #281

Closed kinseii closed 3 months ago

kinseii commented 3 months ago

What would you like to add If I try to use a variable as {{ .variables.network.dev }}, cdev gives an error: [FATAL] Fatal error: load project configuration: prepare objects: template: main:9: bad character U+002D '-'

---
kind: StackTemplate
name: qwerty
units:
  - name: qwerty
    type: tfmodule
    source: ../../../qwerty
    inputs:
      network: {{ insertYAML .variables.network.dev }}
---
kind: Stack
name: qwerty-aks-us-1
template: ./qwerty/aks-us-1
backend: qwerty
variables:
  network:
    dev: 
      ip: 1.1.1.1
      mask: 1.1.1.1
    prod:
      ip: 2.2.2.2
      mask: 2.2.2.2
kinseii commented 3 months ago

It seems the problem was the presence of the variable name hyphen, I will close the Problem and reopen if there is any news. https://github.com/shalb/cluster.dev/issues/284