Appliscale / perun

A command-line validation tool for AWS Cloud Formation that allows to conquer the cloud faster!
https://perun-for-aws.appliscale.io
Apache License 2.0
92 stars 8 forks source link

Not parsing yaml user data before validation #159

Closed mwpolcik closed 6 years ago

mwpolcik commented 6 years ago

Template example:

AWSTemplateFormatVersion: '2010-09-09'

Resources:

  MyEC2:
    Type: "AWS::EC2::Instance"
    Properties:
      ImageId: ami-1111111
      InstanceType: t2.medium
      SubnetId: subnet-1231231
      KeyName: something
      SecurityGroupIds:
      - sg-123123
      IamInstanceProfile: some-profile
      UserData:
        Fn::Base64: !Sub |
          #!/bin/bash

          # Set hostname
          /usr/bin/cfn-init -v --stack ${AWS::StackName} --resource MyEC2 --configsets All --region ${AWS::Region}
          # Signal the status from cfn-init
          /usr/bin/cfn-signal -e $? --stack ${AWS::StackName} --resource MyEC2 --region ${AWS::Region}
    Metadata:
      AWS::CloudFormation::Init:
        configSets:
          All:
            - DoSomething
        DoSomething:
          commands:
            a_Start:
              command: echo 'buba'

After running:

[1] % perun validate test.yml INFO: Configuration file from the following location will be used: /Users/mpolcik16/.config/perun/main.yaml INFO: Creating new session. Profile: aol Region: us-east-1 ERROR: invalid YAML template: yaml: line 21: could not find expected ':' ERROR: Template test.yml is invalid!


This template is valid, so expected behaviour is to pass validation. 
maxiwoj commented 6 years ago

Not parsing yaml user data before validation

maxiwoj commented 6 years ago

closed by https://github.com/Appliscale/perun/pull/171