Giter VIP home page Giter VIP logo

cloudformation-extensions's People

Contributors

andyneville avatar joshbalfour avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

andyneville

cloudformation-extensions's Issues

Add a .cfnex file

If it could search up for a .cfnex to load any settings such as extensions directry, template directory and dist directory. So i can at anytime call cfnex to rebuild, and if im in the folder with the .cfnex file then it knows where to build (and everything is relative to the .cfnex file)

Include-file extension does not pass <%cfnex tag contents through as objects

When using the include-file extension, it parses <%cfnex tags so that it can pass the contents of those tags back to the outer template. However, the <%cfnex parsing simply passes the contents of the tag through as a string instead of parsing it as an object, which doesn't seem to provide the value that is intended by this feature.

For example, using the e2e test which pulls in example/ec2/boot.sh:

#!/bin/bash
echo ECS_CLUSTER=<%cfnex { "Ref": "EcsCluster" } cfnex%>  >> /etc/ecs/ecs.config

When pulled in by example/cfnex-cloudformation.json this generates:

...
        "UserData": {
          "Fn::Base64": {
            "Fn::Join": [
              "\n",
              [
                "#!/bin/bash",
                {
                  "Fn::Join": [
                    "",
                    [
                      "echo ECS_CLUSTER=",
                      " { \"Ref\": \"EcsCluster\" } ",
                      "  >> /etc/ecs/ecs.config"
                    ]
                  ]
                },
                ""
              ]
            ]
          }
        }
...

which the CloudFront template will not recognize for parameterization, since it sees the Ref as just part of a string. The expected output is:

        "UserData": {
          "Fn::Base64": {
            "Fn::Join": [
              "\n",
              [
                "#!/bin/bash",
                {
                  "Fn::Join": [
                    "",
                    [
                      "echo ECS_CLUSTER=",
                      {
                        "Ref": "EcsCluster"
                      },
                      "  >> /etc/ecs/ecs.config"
                    ]
                  ]
                },
                ""
              ]
            ]
          }
        }

so that CloudFront will actually insert the parameter inline. I will be submitting a PR with this fix shortly.

Tests

  • Cloudformation Extensions
    • init & properties
    • parseCfnex
      • exists
      • returns a promise
      • positive test case
      • negative test case
    • E2E
      • positive
      • negative
  • cfnex.js
    • init & properties
    • loadExtensions
      • positive test case
      • negative test case
    • parse
      • positive test case
      • negative test case
    • parseStatement
      • positive test case
      • negative test case
  • utils.js
    • init & properties
    • readJSON
      • positive test case
      • negative test case
    • readFile
      • positive test case
      • negative test case
    • writeFile
      • positive test case
      • negative test case
    • listDirectory
      • positive test case
      • negative test case
    • readConfig
      • positive test case
      • negative test case
  • built in extensions
    • include file
      • inits correctly
      • returns correctly
      • positive test case
      • negative test case
    • include
      • inits correctly
      • returns correctly
      • positive test case
      • negative test case
  • CLI
    • inits correctly
    • positive correct arguments
    • negative correct arguments
    • positive test case
    • negative test case
    • no debug console if debug argument not specified
    • debug console if debug argument is specified

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.