Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

additionalRuncmdLines not padded correctly (missing 4 spaces) #568

Open
micahjon opened this issue Aug 20, 2020 · 0 comments
Open

additionalRuncmdLines not padded correctly (missing 4 spaces) #568

micahjon opened this issue Aug 20, 2020 · 0 comments
Labels
impact/usability Something that impacts users' ability to use the product easily and intuitively kind/bug Some behavior is incorrect or out of spec

Comments

@micahjon
Copy link

Looks like the collapseLines helper function was designed for additionalBootcmdLines (which have 12 spaces of padding), not additionalRuncmdLines, which requires 16 spaces of padding for the YAML to work.

userData += collapseLines(additionalRuncmdLines);

I had to manually add those 4 spaces to get it to work, e.g.

userData: awsx.autoscaling.AutoScalingUserData = {
      extraRuncmdLines() {
        return [
          {
            contents: `    yum install -y aws-cfn-bootstrap`,
          },
          {
            contents: `    echo "Hello, World!" > index.html`,
          },
          {
            contents: `    python -m SimpleHTTPServer 80 &> /dev/null &`,
          },
        ];
      },
    },

As a side note, it'd be really nice if extraRuncmdLines could return a multi-line string (like userData), but I realize this API is probably not used by many people, and appreciate that it is there at all!

@leezen leezen added impact/usability Something that impacts users' ability to use the product easily and intuitively kind/bug Some behavior is incorrect or out of spec labels Aug 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact/usability Something that impacts users' ability to use the product easily and intuitively kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

2 participants