aws-cloudformation/aws-cloudformation-macros

Received malformed response from transform <account-id>:count

Closed this issue · 3 comments

If there is % anywhere in CloudFormation template, it gives below error.

Received malformed response from transform 12345XXXXX::Count

For example:

  DiskSpaceAlarm:
    Type: AWS::CloudWatch::Alarm
    Count: !Ref Instancescount
    Properties:
      AlarmDescription: Over 95 of volume space is in use
      AlarmActions:
      - !Ref SNSTopicEc2
      MetricName: "% Free Space"

There should be either some 'delimiter' or lambda should consider only specific (e.g. %d) as a placeholder not all %.

This issue does not appear to be related to the use of % in the template but instead the use of a !Ref to supply the value of the Count property. The Count property only supports specific values and not references, I believe if you re-test using your example and just change Count: !Ref Instancescount to Count: 2 you should find the error does not occur. Could you please confirm this?

Also, there is a more up to date version of this macro in this repo here, that version of the Macro does support using !Ref so perhaps it might be worth deplying that version instead?