Coder Social home page Coder Social logo

Comments (5)

simpsora avatar simpsora commented on August 12, 2024

👍 to this idea -- it would be nice to have UserData content extracted to a separate file.

For this to be most useful, the content of the would still need to be parsed by CloudFormation, in order to resolve intrinsic functions (Fn::Ref, Fn::GetAtt, etc.). Use of those functions may introduce some strange requirements when it comes to quoting the content.

from stack_master.

stevehodgkiss avatar stevehodgkiss commented on August 12, 2024

I saw an interesting solution to this in a sparkleformation issue: sparkleformation/sparkle_formation#54 (comment)

It enables separate user data files while being able to use ERB to call sparkle functions inside that file like <%= region! %>.

from stack_master.

simpsora avatar simpsora commented on August 12, 2024

@stevehodgkiss that's an interesting approach, although it's a shame that it only works with Sparkle. I'd love to see a more generic approach if possible (though I don't currently see how).

cloud-init has quite a bit more functionality than just user-data shell scripts, see here:
https://help.ubuntu.com/community/CloudInit

About the only idea I have is to create a grammar of some kind to allow embedding CF references/functions inline in the script, then replacing them with closequote-var-openquote:
...", { "Ref" : "Foo" }, "...

from stack_master.

simpsora avatar simpsora commented on August 12, 2024

@mhussain: 0.6.0 has been released, which contains user_data_file!. See #117 for details.

from stack_master.

stevehodgkiss avatar stevehodgkiss commented on August 12, 2024

I think the approach/code used in #117 could be used in JSON/YAML templates quite easily too, we'd just need to run it through the same Erubis context. It could look like this:

  "UserData": <%= user_data_file!('app.erb') %>

from stack_master.

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.