Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cfn-lint incorrectly issues E1011 (FindInMap validation of configuration) with !Sub referencing AWS::AccountId #3847

Closed
Slooz opened this issue Dec 1, 2024 · 0 comments · Fixed by #3856

Comments

@Slooz
Copy link

Slooz commented Dec 1, 2024

CloudFormation Lint Version

1.20.1

What operating system are you using?

Mac

Describe the bug

cfn-lint incorrectly issues E1011 (FindInMap validation of configuration) with !Sub referencing AWS::AccountId.

$ cfn-lint --format pretty --regions us-east-2 --include-checks I --configure-rule E3012:strict=True I3042:region=True I3042:accountId=True -- template.yaml

template.yaml
16:11:              E1011     '123456789012AccountBucketName' is not one of ['234567890123AccountBucketName'] for mapping 'BucketMap' and key 'BucketGroup'

Cfn-lint scanned 1 templates against 234 rules and found 1 errors, 0 warnings, and 0 informational violations

Expected behavior

E1011 is not issued for the reproduction template

Reproduction template

%YAML 1.2
---
AWSTemplateFormatVersion: 2010-09-09
Mappings:
  BucketMap:
    BucketGroup:
      234567890123AccountBucketName: Bucket
Transform: AWS::LanguageExtensions
Resources:
  Resource:
    Type: AWS::S3::Bucket
    Properties:
      BucketName: !FindInMap
        - BucketMap
        - BucketGroup
        - !Sub ${AWS::AccountId}AccountBucketName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant