aws-cloudformation / cfn-lint

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

v1: E1050 'dynamic references' is too long (4) #3324

Closed mahyess closed 2 weeks ago

mahyess commented 2 weeks ago

CloudFormation Lint Version

1.3.0

What operating system are you using?

mac

Describe the bug

  MyS3Bucket:
    Type: 'AWS::S3::Bucket'
    Properties:
      AccessControl: '{{resolve:ssm:${AWS::AccountId}/${AWS::Region}/ac}}' 

result in

E1050 ['resolve', 'ssm', '${AWS', '', 'AccountId}/${AWS', '', 'Region}/ac'] is too long (4)
E1050 '' does not match '\\d+'

Expected behavior

I thinking : inside ${} should be ignored while checking this rule.

Reproduction template

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

Resources:
  S3Storage:
    Properties:
      LoggingConfiguration:
        AccessControl: !Sub "{{resolve:ssm:${AWS::AccountId}/${AWS::Region}/ac}}"