aws-cloudformation / cfn-lint

CloudFormation Linter
MIT No Attribution
2.4k stars 576 forks source link

E1031 Fn::ToJsonString is not supported without 'AWS::LanguageExtensions' transform #3415

Closed Zippy1999 closed 6 days ago

Zippy1999 commented 6 days ago

CloudFormation Lint Version

1.3.6

What operating system are you using?

Mac

Describe the bug

Since upgrading to 1> I am getting the following error:

E1031 Fn::ToJsonString is not supported without 'AWS::LanguageExtensions' transform

At the top of cloud-formation.yaml we have the transform defined

AWSTemplateFormatVersion: 2010-09-09
Transform: 
  - AWS::Serverless-2016-10-31
  - AWS::LanguageExtensions

This was working fine in versions prior to 1.. (works with 0.87.7)

Expected behavior

Linting should pass

Reproduction template

  EventBusSchedule:
    Type: AWS::Scheduler::Schedule
    .......
    Properties:
      ......
      Target:
        Arn: !GetAtt Queue.Arn
        RoleArn: !GetAtt SomeRole.Arn
        Input:
          Fn::ToJsonString:
            somId: mysecret/idnfo
            eventType: success
kddejong commented 6 days ago

SAM is removing all the transforms from the template so this will work. Thinking about how to resolve this correctly.

Transform: 
  - AWS::LanguageExtensions

Also according to the docs you should flip your transform order.

Zippy1999 commented 5 days ago

Great work @kddejong - confirmed all OK now in 1.3.7