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

W8003 False positive #3130

Closed
gabelton opened this issue Apr 3, 2024 · 1 comment · Fixed by #3131
Closed

W8003 False positive #3130

gabelton opened this issue Apr 3, 2024 · 1 comment · Fixed by #3131

Comments

@gabelton
Copy link

gabelton commented Apr 3, 2024

CloudFormation Lint Version

0.86.0

What operating system are you using?

mac

Describe the bug

lint raises a W8003 for the below template, but I don't think it's true that it will always return True or False. It checks whether the value obtained from the mapping for the specified environment (!Ref Env) matches the string "No retention". If it does, then the condition evaluates to false, and if it doesn't, it evaluates to true.

Expected behavior

W8003 isn't raised

Reproduction template

Mappings:
  dwS3BucketEnvironmentConfigMap:
    # Create an entry for each environment

    prod:
      BucketName: 'digital-workspace-v2-prod'
      DeletionPolicy: Delete
    hotfix:
      BucketName: 'digital-workspace-v2-hotfix'
      DeletionPolicy: Delete
    staging:
      BucketName: 'digital-workspace-v2-staging'
      DeletionPolicy: Delete
    training:
      BucketName: 'digital-workspace-v2-training'
      DeletionPolicy: Delete
    dev:
      BucketName: 'digital-workspace-v2-dev'
      DeletionPolicy: Delete

Conditions:
  dwS3BucketApplyRetentionPolicy: !Not
    - !Equals
      - !FindInMap
        - dwS3BucketEnvironmentConfigMap
        - !Ref Env
        - RetentionMode
        - DefaultValue: No retention
      - No retention
  dwS3BucketRetentionPolicyDurationIsInDays: !Equals
    - !FindInMap
      - dwS3BucketEnvironmentConfigMap
      - !Ref Env
      - RetentionDurationType
      - DefaultValue: Days
    - Days
@kddejong
Copy link
Contributor

kddejong commented Apr 4, 2024

Fix is in. Closing and will be released today or tomorrow.

@kddejong kddejong closed this as completed Apr 4, 2024
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.

2 participants