aws-cloudformation / cfn-lint

CloudFormation Linter
MIT No Attribution
2.43k stars 590 forks source link

New version v1.3.0 not recognizing AWS ARN Transform Serverless and thus throwing an error E1019 #3334

Closed ssi-edarbonnens closed 3 months ago

ssi-edarbonnens commented 3 months ago

CloudFormation Lint Version

1.3.0

What operating system are you using?

Ubuntu

Describe the bug

[cfn-lint] E1019: {'Fn::Sub': 'arn:aws:cloudformation:${AWS::Region}:aws:transform/Serverless-2016-10-31'} does not match '^(arn:(aws|aws-cn|aws-us-gov):[^:]+:[^:]*:(?:\\d{12}|\\*)?:.+|\\*)$' when 'Fn::Sub' is resolved

Expected behavior

No errors. When the value is substituted by the AWS Region the result ARN is valid.

Reproduction template

AWSTemplateFormatVersion: 2010-09-09
Resources:
  MyPolicy:
    Type: AWS::IAM::ManagedPolicy
    Properties:
      ManagedPolicyName: MyPolicyName
      PolicyDocument:
        Version: '2012-10-17'
        Statement:
          - Sid: ServerlessCFNTransform
            Effect: Allow
            Action:
              - cloudformation:CreateChangeSet
            Resource:
              - !Sub arn:aws:cloudformation:${AWS::Region}:aws:transform/Serverless-2016-10-31