FAQ
Hey folks, I'm working on a tool to enable the generation of AWS
CloudFormation templates using a Clojure-based syntax kind of like
leiningen's project.clj. I'm working on how the syntax should look to be
most clojurey, and I wonder if anyone has some input:
https://gist.github.com/bellkev/7653342

I should add that I'm very new to Clojure and using this project as an
opportunity to learn more about the language internals. So please forgive
any particularly non-idiomatic Clojure...

Thanks!!

--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Craig at Nov 26, 2013 at 7:49 am
    I don't know much about CF templates, but stripping some detail from your
    middle fragment moves further from data and to a DSL:

    (deftemplate my-template
       :aws-template-format-version "2010-09-09"
       :description "My description"

       (param my-parameter :type :string :description "My string parameter")

       (mapping my-mapping
                :first-level-key-one {:second-level-key-one "Value"}
                :first-level-key-two {:second-level-key-two "Another Value"})

       (condition my-condition (not my-parameter))
       (condition my-second-condition (= (-> my-mapping :first-level-key-one
    :second-level-key-one) my-parameter))

       (resource my-instance aws.ec2/instance :image-id "ami-79fd7eee")

       (output my-first-output (:instance-type my-instance))
       (output my-second-output my-parameter))

    Craig

    On Tuesday, November 26, 2013 3:41:29 PM UTC+11, Kevin Bell wrote:

    Hey folks, I'm working on a tool to enable the generation of AWS
    CloudFormation templates using a Clojure-based syntax kind of like
    leiningen's project.clj. I'm working on how the syntax should look to be
    most clojurey, and I wonder if anyone has some input:
    https://gist.github.com/bellkev/7653342<https://www.google.com/url?q=https%3A%2F%2Fgist.github.com%2Fbellkev%2F7653342&sa=D&sntz=1&usg=AFQjCNF5RUFgHxpojQ1x0EPxJFQ09ibA3A>

    I should add that I'm very new to Clojure and using this project as an
    opportunity to learn more about the language internals. So please forgive
    any particularly non-idiomatic Clojure...

    Thanks!!
    --
    --
    You received this message because you are subscribed to the Google
    Groups "Clojure" group.
    To post to this group, send email to clojure@googlegroups.com
    Note that posts from new members are moderated - please be patient with your first post.
    To unsubscribe from this group, send email to
    clojure+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/clojure?hl=en
    ---
    You received this message because you are subscribed to the Google Groups "Clojure" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Kevin Bell at Nov 26, 2013 at 8:11 am
    Hey Craig,

    Thanks for the input. Forgive my naiveté, but I gather you're implying that
    the DSL-ishness is desirable? That makes sense, and it seems to be inline
    with what I'm learning about the lisp mindset.

    You're suggestion is actually a lot more like an option that I was
    considering but didn't do because it seemed to depart from things like
    project.clj that I was emulating. But it might actually make sense to take
    it a step further to make the scoping within CloudFormation templates more
    explicit.

    I updated my gist with an even more DSL-like
    concept: https://gist.github.com/bellkev/7653342
    On Monday, November 25, 2013 11:49:20 PM UTC-8, Craig wrote:


    I don't know much about CF templates, but stripping some detail from your
    middle fragment moves further from data and to a DSL:

    (deftemplate my-template
    :aws-template-format-version "2010-09-09"
    :description "My description"

    (param my-parameter :type :string :description "My string parameter")

    (mapping my-mapping
    :first-level-key-one {:second-level-key-one "Value"}
    :first-level-key-two {:second-level-key-two "Another Value"})

    (condition my-condition (not my-parameter))
    (condition my-second-condition (= (-> my-mapping :first-level-key-one
    :second-level-key-one) my-parameter))

    (resource my-instance aws.ec2/instance :image-id "ami-79fd7eee")

    (output my-first-output (:instance-type my-instance))
    (output my-second-output my-parameter))

    Craig

    On Tuesday, November 26, 2013 3:41:29 PM UTC+11, Kevin Bell wrote:

    Hey folks, I'm working on a tool to enable the generation of AWS
    CloudFormation templates using a Clojure-based syntax kind of like
    leiningen's project.clj. I'm working on how the syntax should look to be
    most clojurey, and I wonder if anyone has some input:
    https://gist.github.com/bellkev/7653342<https://www.google.com/url?q=https%3A%2F%2Fgist.github.com%2Fbellkev%2F7653342&sa=D&sntz=1&usg=AFQjCNF5RUFgHxpojQ1x0EPxJFQ09ibA3A>

    I should add that I'm very new to Clojure and using this project as an
    opportunity to learn more about the language internals. So please forgive
    any particularly non-idiomatic Clojure...

    Thanks!!
    --
    --
    You received this message because you are subscribed to the Google
    Groups "Clojure" group.
    To post to this group, send email to clojure@googlegroups.com
    Note that posts from new members are moderated - please be patient with your first post.
    To unsubscribe from this group, send email to
    clojure+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/clojure?hl=en
    ---
    You received this message because you are subscribed to the Google Groups "Clojure" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Jeroen van Dijk at Nov 26, 2013 at 10:29 am
    Hi Kevin,

    I've created some kind of wrapper around CF templates too. It is too
    immature (and ugly) to open source it, but I think it has some nice
    features, like Ref checking, templating for userdata and schema validation
    of the CF resources via Prismatic Schema.

    Can you elaborate on what kind of features you would like to support? Are
    you just deciding on DSL syntax or do you have already some kind of Clojure
    layer working?

    About the DSL, in the end I decided to stick closer to the CF syntax to
    avoid confusion and documentation mismatches. So for instance, all my
    parameters for a CF resource are CamelCase. One of the most important
    features for me is the validation on missing fields and Reference checking.

    If you are interested in collaborating in this, please let me know.

    Cheers,
    Jeroen




    On Tue, Nov 26, 2013 at 9:11 AM, Kevin Bell wrote:

    Hey Craig,

    Thanks for the input. Forgive my naiveté, but I gather you're implying
    that the DSL-ishness is desirable? That makes sense, and it seems to be
    inline with what I'm learning about the lisp mindset.

    You're suggestion is actually a lot more like an option that I was
    considering but didn't do because it seemed to depart from things like
    project.clj that I was emulating. But it might actually make sense to take
    it a step further to make the scoping within CloudFormation templates more
    explicit.

    I updated my gist with an even more DSL-like concept:
    https://gist.github.com/bellkev/7653342

    On Monday, November 25, 2013 11:49:20 PM UTC-8, Craig wrote:


    I don't know much about CF templates, but stripping some detail from your
    middle fragment moves further from data and to a DSL:

    (deftemplate my-template
    :aws-template-format-version "2010-09-09"
    :description "My description"

    (param my-parameter :type :string :description "My string parameter")

    (mapping my-mapping
    :first-level-key-one {:second-level-key-one "Value"}
    :first-level-key-two {:second-level-key-two "Another Value"})

    (condition my-condition (not my-parameter))
    (condition my-second-condition (= (-> my-mapping :first-level-key-one
    :second-level-key-one) my-parameter))

    (resource my-instance aws.ec2/instance :image-id "ami-79fd7eee")

    (output my-first-output (:instance-type my-instance))
    (output my-second-output my-parameter))

    Craig

    On Tuesday, November 26, 2013 3:41:29 PM UTC+11, Kevin Bell wrote:

    Hey folks, I'm working on a tool to enable the generation of AWS
    CloudFormation templates using a Clojure-based syntax kind of like
    leiningen's project.clj. I'm working on how the syntax should look to be
    most clojurey, and I wonder if anyone has some input:
    https://gist.github.com/bellkev/7653342<https://www.google.com/url?q=https%3A%2F%2Fgist.github.com%2Fbellkev%2F7653342&sa=D&sntz=1&usg=AFQjCNF5RUFgHxpojQ1x0EPxJFQ09ibA3A>

    I should add that I'm very new to Clojure and using this project as an
    opportunity to learn more about the language internals. So please forgive
    any particularly non-idiomatic Clojure...

    Thanks!!
    --
    --
    You received this message because you are subscribed to the Google
    Groups "Clojure" group.
    To post to this group, send email to clojure@googlegroups.com
    Note that posts from new members are moderated - please be patient with
    your first post.
    To unsubscribe from this group, send email to
    clojure+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/clojure?hl=en
    ---
    You received this message because you are subscribed to the Google Groups
    "Clojure" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to clojure+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    --
    You received this message because you are subscribed to the Google
    Groups "Clojure" group.
    To post to this group, send email to clojure@googlegroups.com
    Note that posts from new members are moderated - please be patient with your first post.
    To unsubscribe from this group, send email to
    clojure+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/clojure?hl=en
    ---
    You received this message because you are subscribed to the Google Groups "Clojure" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Craig at Nov 26, 2013 at 11:07 am
    Kevin,

    Typical advice is to not use macros (implicitly used in the gists to build
    a CF DSL) when functions or data will suffice. Sometimes however the
    syntactic sugar is quite tasty and hard to overlook. I do not have enough
    knowledge of the domain to suggest what might be the correct approach in
    this case.

    Some additional comments:
    - your use of with-foo pattern is not idiomatic afaics; this pattern is
    typically used to scope run-time resource usage
    - in relation to parameters: the means by which defrecord introduces record
    attributes may be instructive (if you go the DSL route)

    rgds
    Craig
    On Tuesday, November 26, 2013 7:11:42 PM UTC+11, Kevin Bell wrote:

    Hey Craig,

    Thanks for the input. Forgive my naiveté, but I gather you're implying
    that the DSL-ishness is desirable? That makes sense, and it seems to be
    inline with what I'm learning about the lisp mindset.

    You're suggestion is actually a lot more like an option that I was
    considering but didn't do because it seemed to depart from things like
    project.clj that I was emulating. But it might actually make sense to take
    it a step further to make the scoping within CloudFormation templates more
    explicit.

    I updated my gist with an even more DSL-like concept:
    https://gist.github.com/bellkev/7653342<https://www.google.com/url?q=https%3A%2F%2Fgist.github.com%2Fbellkev%2F7653342&sa=D&sntz=1&usg=AFQjCNF5RUFgHxpojQ1x0EPxJFQ09ibA3A>
    On Monday, November 25, 2013 11:49:20 PM UTC-8, Craig wrote:


    I don't know much about CF templates, but stripping some detail from your
    middle fragment moves further from data and to a DSL:

    (deftemplate my-template
    :aws-template-format-version "2010-09-09"
    :description "My description"

    (param my-parameter :type :string :description "My string parameter")

    (mapping my-mapping
    :first-level-key-one {:second-level-key-one "Value"}
    :first-level-key-two {:second-level-key-two "Another Value"})

    (condition my-condition (not my-parameter))
    (condition my-second-condition (= (-> my-mapping :first-level-key-one
    :second-level-key-one) my-parameter))

    (resource my-instance aws.ec2/instance :image-id "ami-79fd7eee")

    (output my-first-output (:instance-type my-instance))
    (output my-second-output my-parameter))

    Craig

    On Tuesday, November 26, 2013 3:41:29 PM UTC+11, Kevin Bell wrote:

    Hey folks, I'm working on a tool to enable the generation of AWS
    CloudFormation templates using a Clojure-based syntax kind of like
    leiningen's project.clj. I'm working on how the syntax should look to be
    most clojurey, and I wonder if anyone has some input:
    https://gist.github.com/bellkev/7653342<https://www.google.com/url?q=https%3A%2F%2Fgist.github.com%2Fbellkev%2F7653342&sa=D&sntz=1&usg=AFQjCNF5RUFgHxpojQ1x0EPxJFQ09ibA3A>

    I should add that I'm very new to Clojure and using this project as an
    opportunity to learn more about the language internals. So please forgive
    any particularly non-idiomatic Clojure...

    Thanks!!
    --
    --
    You received this message because you are subscribed to the Google
    Groups "Clojure" group.
    To post to this group, send email to clojure@googlegroups.com
    Note that posts from new members are moderated - please be patient with your first post.
    To unsubscribe from this group, send email to
    clojure+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/clojure?hl=en
    ---
    You received this message because you are subscribed to the Google Groups "Clojure" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Kevin Bell at Nov 26, 2013 at 7:02 pm
    Hey Craig and Jeroen,

    Jeroen:

    Can you elaborate on what kind of features you would like to support? Are
    you just deciding on DSL syntax or do you have already some kind of Clojure
    layer working?

    -My main goals are to create as "pretty" of a format for defining CF
    templates within Clojure syntax and support compiling/decompiling to/from
    JSON templates. I would definitely like to do some amount of validation,
    taking advantage of the schema<http://vstoolkit.amazonwebservices.com/CloudFormationSchema/CloudFormationV1.schema> and
    perhaps some of the logic from the eclipse plugin<https://github.com/aws/aws-toolkit-eclipse/blob/master/com.amazonaws.eclipse.cloudformation/src/com/amazonaws/eclipse/cloudformation/templates/schema/TemplateSchemaRules.java>,
    though I'm not sure yet how rigorous the validation should be.

    -I think some really nice additional features would be some kind of
    launcher, perhaps done as a leiningen plugin and using amazonica, and
    simplified creation of custom CF resources, which are incredibly powerful
    and I think fit well with the principles of Clojure, as they are meant to
    be small, idempotent modules of functionality that follow a certain protocol

    About the DSL, in the end I decided to stick closer to the CF syntax to
    avoid confusion and documentation mismatches. So for instance, all my
    parameters for a CF resource are CamelCase. One of the most important
    features for me is the validation on missing fields and Reference checking.

    -I was thinking about this too and started with camel case, but I've been
    using AngularJS a lot lately, and I actually love the fact that it converts
    to/from hyphen-case and CamelCase as convention dictates, so I think I want
    to implement that. It shouldn't be too hard to do using some autocorrection
    of case based on the schema (above)

    If you are interested in collaborating in this, please let me know.
    -I'd love too. Please feel free to contact me at kevin.a.bell (at) gmail

    Craig:

    Typical advice is to not use macros (implicitly used in the gists to build
    a CF DSL) when functions or data will suffice. Sometimes however the
    syntactic sugar is quite tasty and hard to overlook. I do not have enough
    knowledge of the domain to suggest what might be the correct approach in
    this case.
    -That makes sense, and I was thinking about using functions for things like
    the mappings, resources, etc. However, it seems nice to have variables that
    can be reused later in the template. Keywords could work for this, but I
    feel like that gets a bit awkward if you look at what I was trying to do in
    the keyword-heavy version. One thing that struck me about the version using
    macro-defined variables though is that, since the whole template syntax
    ultimately just produces a big map, defining/using variables within it is
    equivalent to doing (def mymap {:first-key (def mystring "a") :second-key
    mystring}), which works, but is that weird?

    Some additional comments:
    - your use of with-foo pattern is not idiomatic afaics; this pattern is
    typically used to scope run-time resource usage
    -This is something I've been struggling with a bit. The thing is that while
    CF templates are just JSON files, they actually have an explicit execution
    path and various scope considerations at runtime. So on the one hand, this
    is just a tool to produce JSON data, but on the other hand there would be a
    real meaning to the scoping implied by the with-foo syntax

    - in relation to parameters: the means by which defrecord introduces record
    attributes may be instructive (if you go the DSL route)
    -I like that idea of having the parameters simply being defined in square
    brackets "[]" at the top as in defrecord. However, each parameter does
    require a potentially large map of properties (type and validation
    information), which may be hard to fit into that syntax

    Thanks a lot for the feedback so far!

    --
    --
    You received this message because you are subscribed to the Google
    Groups "Clojure" group.
    To post to this group, send email to clojure@googlegroups.com
    Note that posts from new members are moderated - please be patient with your first post.
    To unsubscribe from this group, send email to
    clojure+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/clojure?hl=en
    ---
    You received this message because you are subscribed to the Google Groups "Clojure" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Gary Verhaegen at Nov 26, 2013 at 7:50 pm
    Before you decide on the question of macros/dsl versus data api, I would
    recommend watching the "(not= DSL macro)" talk from a few years ago. It
    nicely illustrates the tradeoffs involved, and hints at the reasons why the
    Clojure community, as opposed to traditional lisps, tends to gravitate more
    towards data-based than macro-based.

    The "one ring to bind them all" talk was also quite enlightening in this
    regard.

    (Please do not misunderstand me: I am not advising against a DSL, I just
    want to help you choose knowingly.)
    On Tuesday, 26 November 2013, Kevin Bell wrote:

    Hey Craig and Jeroen,

    Jeroen:

    Can you elaborate on what kind of features you would like to support? Are
    you just deciding on DSL syntax or do you have already some kind of Clojure
    layer working?

    -My main goals are to create as "pretty" of a format for defining CF
    templates within Clojure syntax and support compiling/decompiling to/from
    JSON templates. I would definitely like to do some amount of validation,
    taking advantage of the schema<http://vstoolkit.amazonwebservices.com/CloudFormationSchema/CloudFormationV1.schema> and
    perhaps some of the logic from the eclipse plugin<https://github.com/aws/aws-toolkit-eclipse/blob/master/com.amazonaws.eclipse.cloudformation/src/com/amazonaws/eclipse/cloudformation/templates/schema/TemplateSchemaRules.java>,
    though I'm not sure yet how rigorous the validation should be.

    -I think some really nice additional features would be some kind of
    launcher, perhaps done as a leiningen plugin and using amazonica, and
    simplified creation of custom CF resources, which are incredibly powerful
    and I think fit well with the principles of Clojure, as they are meant to
    be small, idempotent modules of functionality that follow a certain protocol

    About the DSL, in the end I decided to stick closer to the CF syntax to
    avoid confusion and documentation mismatches. So for instance, all my
    parameters for a CF resource are CamelCase. One of the most important
    features for me is the validation on missing fields and Reference checking.

    -I was thinking about this too and started with camel case, but I've been
    using AngularJS a lot lately, and I actually love the fact that it converts
    to/from hyphen-case and CamelCase as convention dictates, so I think I want
    to implement that. It shouldn't be too hard to do using some autocorrection
    of case based on the schema (above)

    If you are interested in collaborating in this, please let me know.
    -I'd love too. Please feel free to contact me at kevin.a.bell (at) gmail

    Craig:

    Typical advice is to not use macros (implicitly used in the gists to build
    a CF DSL) when functions or data will suffice. Sometimes however the
    syntactic sugar is quite tasty and hard to overlook. I do not have enough
    knowledge of the domain to suggest what might be the correct approach in
    this case.
    -That makes sense, and I was thinking about using functions for things
    like the mappings, resources, etc. However, it seems nice to have variables
    that can be reused later in the template. Keywords could work for this, but
    I feel like that gets a bit awkward if you look at what I was trying to do
    in the keyword-heavy version. One thing that struck me about the version
    using macro-defined variables though is that, since the whole template
    syntax ultimately just produces a big map, defining/using variables within
    it is equivalent to doing (def mymap {:first-key (def mystring "a")
    :second-key mystring}), which works, but is that weird?

    Some additional comments:
    - your use of with-foo pattern is not idiomatic afaics; this pattern is
    typically used to scope run-time resource usage
    -This is something I've been struggling with a bit. The thing is that
    while CF templates are just JSON files, they actually have an explicit
    execution path and various scope considerations at runtime. So on the one
    hand, this is just a tool to produce JSON data, but on the other hand there
    would be a real meaning to the scoping implied by the with-foo syntax

    - in relation to parameters: the means by which defrecord introduces
    record attributes may be instructive (if you go the DSL route)
    -I like that idea of having the parameters simply being defined in square
    brackets "[]" at the top as in defrecord. However, each parameter does
    require a potentially large map of properties (type and validation
    information), which may be hard to fit into that syntax

    Thanks a lot for the feedback so far!

    --
    --
    You received this message because you are subscribed to the Google
    Groups "Clojure" group.
    To post to this group, send email to clojure@googlegroups.com<javascript:_e({}, 'cvml', 'clojure@googlegroups.com');>
    Note that posts from new members are moderated - please be patient with
    your first post.
    To unsubscribe from this group, send email to
    clojure+unsubscribe@googlegroups.com <javascript:_e({}, 'cvml',
    'clojure%2bunsubscribe@googlegroups.com');>
    For more options, visit this group at
    http://groups.google.com/group/clojure?hl=en
    ---
    You received this message because you are subscribed to the Google Groups
    "Clojure" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to clojure+unsubscribe@googlegroups.com <javascript:_e({}, 'cvml',
    'clojure%2Bunsubscribe@googlegroups.com');>.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    --
    You received this message because you are subscribed to the Google
    Groups "Clojure" group.
    To post to this group, send email to clojure@googlegroups.com
    Note that posts from new members are moderated - please be patient with your first post.
    To unsubscribe from this group, send email to
    clojure+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/clojure?hl=en
    ---
    You received this message because you are subscribed to the Google Groups "Clojure" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Kevin Bell at Nov 27, 2013 at 12:10 am
    Hey Gary,

    Thanks for the references. Those videos were awesome!

    I think Cristophe definitely hit the nail on the head with this slide<http://www.slideshare.net/cgrand/dsl-5537797/21> about
    the challenges of binding. Though, I'm not sure I fully get what he meant
    by "binding specs" and "capturing specs". Do you happen to know of any more
    resources on that topic?

    I took another attempt <https://gist.github.com/bellkev/7653342> at my
    "deftemplate" syntax with a gradual progression from
    data->functions->macros as discussed by Cristophe. This approach left me
    with something similar to one of my earlier samples that copied leiningen's
    "defproject" syntax very heavily.

    The only issue I have with this new syntax it seems overly
    data-like/keyword-heavy. For example this section:

    :my-second-condition [:cfn=
                            [:cfn-inmap :my-mapping :first-level-key-one :second-level-key-two]
                            [:cfn-ref :my-parameter]]


    Could be replaced by this:

    my-second-condition (cfn= (cfn-inmap my-mapping :first-level-key-one :second-level-key-two)
                                    (cfn-ref my-parameter))

    Which I feel is much more readable, with the cfn-whatever functions simply returning specially-formatted string maps. Except, my-mapping and my-parameter aren't defined as vars in the data-structure-like syntax, so I would have to do some of that funky symbol-grabbing/walking in a macro that people seem to be cautioning against...

    --
    --
    You received this message because you are subscribed to the Google
    Groups "Clojure" group.
    To post to this group, send email to clojure@googlegroups.com
    Note that posts from new members are moderated - please be patient with your first post.
    To unsubscribe from this group, send email to
    clojure+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/clojure?hl=en
    ---
    You received this message because you are subscribed to the Google Groups "Clojure" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Marshall Brekka at Nov 28, 2013 at 3:42 am
    I recently wrote a CF template building tool for my company. its part of a
    larger project that we want to eventually open source, but the CF template
    stuff is small enough that I can put most of it into a gist.
    https://gist.github.com/marshallbrekka/7686151
    This was basically copied and pasted from a single namespace with a few
    things left out that weren't terribly relevant.

    Take a look at the resource fn . Its the most used fn for all of our stack.
    Basically every single thing we create is defined as a resource.
    You probably noticed that I didn't try to create wrappers around any of the
    CF primitives (ec2, elb, subnet, etc).
    This was a design decision, mostly because it makes doing complex template
    generation much easier because you are just dealing with maps and lists.
    Finally, we didn't try to accommodate parameters because, this being
    clojure, we could just generate a template dynamically with all of the
    things that would have been parameters hardcoded right into the template.
    Obviously if you did need that ability it wouldn't be to hard to add it to
    the system we created.

    Hope its helpful.
    On Monday, November 25, 2013 8:41:29 PM UTC-8, Kevin Bell wrote:

    Hey folks, I'm working on a tool to enable the generation of AWS
    CloudFormation templates using a Clojure-based syntax kind of like
    leiningen's project.clj. I'm working on how the syntax should look to be
    most clojurey, and I wonder if anyone has some input:
    https://gist.github.com/bellkev/7653342

    I should add that I'm very new to Clojure and using this project as an
    opportunity to learn more about the language internals. So please forgive
    any particularly non-idiomatic Clojure...

    Thanks!!
    --
    --
    You received this message because you are subscribed to the Google
    Groups "Clojure" group.
    To post to this group, send email to clojure@googlegroups.com
    Note that posts from new members are moderated - please be patient with your first post.
    To unsubscribe from this group, send email to
    clojure+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/clojure?hl=en
    ---
    You received this message because you are subscribed to the Google Groups "Clojure" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Kevin Bell at Nov 28, 2013 at 4:57 am
    Cool, thanks Marshall!

    I do think it would be nice to have an option to more or less
    compile/decompile between Clojure and CloudFormation templates. That would
    help lower the barrier to entry for people currently heavily using CF but
    not so much Clojure. (I'm kind of trying to use this project as a "Trojan
    Horse" to get some Clojure into my "Java shop" company...)

    That said, after the discussion on this thread as well as with some folks
    on the IRC channel, I think I DEFINITELY want keep 99% of the
    logic/functionality in my project as pure Clojure data/functions, with with
    perhaps just one or two light macro wrappers around things if it makes
    sense.

    I look forward seeing what else you come up with in this area. You, Jeroen
    (from earlier in this thread), and I should definitely keep in touch as we
    come up with more functionality.

    --
    --
    You received this message because you are subscribed to the Google
    Groups "Clojure" group.
    To post to this group, send email to clojure@googlegroups.com
    Note that posts from new members are moderated - please be patient with your first post.
    To unsubscribe from this group, send email to
    clojure+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/clojure?hl=en
    ---
    You received this message because you are subscribed to the Google Groups "Clojure" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupclojure @
categoriesclojure
postedNov 26, '13 at 4:42a
activeNov 28, '13 at 4:57a
posts10
users5
websiteclojure.org
irc#clojure

People

Translate

site design / logo © 2022 Grokbase