a single ' causes atmos to error out when using !template tojson
Describe the Bug
have an atmos setup that uses !template toJson.
within my json, I have a single ' inside a specific json field.
Expected Behavior
atmos should be able to handle the json field to have ' with no issue.
Steps to Reproduce
in stack, use _defaults.yaml
settings:
templates:
settings:
gomplate:
timeout: 5
datasources:
vars_defaults:
url: "../../Variables/defaults.json"
in top level overrides.yaml, include
vars:
bedrock_agent_configs: !template '{{ toJson (datasource "vars_merged_final").bedrock_agent_configs }}'
in enviornment level (dev), override.yaml:
settings:
templates:
settings:
gomplate:
timeout: 5
datasources:
vars_environment:
url: ../../Variables/dev.json
vars_merged_final:
url: merge:vars_environment|vars_defaults
Screenshots
No response
Environment
OS: Window version 26100.3915 module - n/a terraform: 1.11.3
Additional Context
No response
apparently ’ works okay, while ' doesnt
In general, I would take every single opportunity to avoid using Go templating when you can. Go templating is an escape hatch, and the more complex the expression or the scenario, the harder it is to reconcile.
Seeing as you're reading in a JSON file, why not use one of our YAML functions instead? These are first-class YAML citizens.
Something like this.
vars:
bedrock_agent_configs: !include "../../Variables/defaults.json" .bedrock_agent_configs