Code Monkey home page Code Monkey logo

Comments (6)

doctornkz avatar doctornkz commented on July 30, 2024 1

@marcsauter take a look here: https://github.com/doctornkz/signalfx2terraform/blob/master/builder/dashboard.go#L79-L84
it gives me possibility generate that example:

  chart {                  
    chart_id = "${signalfx_time_chart.sfx-XXXXXX.id}"
    column   = 0    
    row      = 1
    width    = 6
    height   = 1                                                      
  }

with ${} inside the structure

from go-cty.

doctornkz avatar doctornkz commented on July 30, 2024

I found the tricky solution. If I use cty.StringVal("$${world}") I am receiving hello = "$$${world}" and doubled $$ compensate each other and it works like one $. But I think it's not good way to fix.

from go-cty.

apparentlymart avatar apparentlymart commented on July 30, 2024

Hi @doctornkz,

What you are seeing here seems to be an HCL behavior, not a cty behavior. With that said, I believe it's working as intended because it's escaping the ${ sequence in your literal string so that the HCL parser would then see it as a literal ${ rather than the beginning of an interpolation sequence. If you'd like to discuss this more, please open an issue in the HCL repository.

from go-cty.

doctornkz avatar doctornkz commented on July 30, 2024

I solved problem with hcl.Traversal() .Now, I can create templated config file. Ugly, but works good for me.

from go-cty.

marcsauter avatar marcsauter commented on July 30, 2024

@doctornkz do you have an example of your solution?

from go-cty.

marcsauter avatar marcsauter commented on July 30, 2024

Thank you so much, that solves out problem.

from go-cty.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.