Cfn-python-lint: E3021 after upgrading to cfn_lint-0.44.0

Created on 16 Dec 2020  路  3Comments  路  Source: aws-cloudformation/cfn-python-lint

cfn-lint version: cfn_lint-0.44.0

Hi!

After upgrading to version cfn_lint 0.44.0 don't validate AWS::Events::Rule

This was reported valid since yesterday:

  TaskSchedule:
    Type: AWS::Events::Rule
    Properties:
      Description: xxxxxxxxx
      Name: !Join ["-", [!Ref EnvironmentName, scheduled, !Ref App]]
      ScheduleExpression: "cron(15 9 * * ? *)"
      State: "ENABLED"
      Targets:
        - Arn:
            Fn::ImportValue: !Sub ${EnvironmentName}-microservice-cluster-arn
          RoleArn: !GetAtt ServiceRole.Arn
          Id: my-task
          EcsParameters:
            TaskCount: 1
            TaskDefinitionArn: !Ref TaskDefinition

The error reported is: E3021 An Events Rule can have up to 5 Targets

There is one Target so should still be valid

Most helpful comment

@PatMyron is correct that PR is to blame. Fix is easy in the rule itself so I have submitted a PR to resolve this issue.

All 3 comments

That rule itself hasn't been touched in years and I'm unable to reproduce with just that template alone, so I'm inclined to think this is related to https://github.com/aws-cloudformation/cfn-python-lint/pull/1789 assuming you're linting multiple templates simultaneously

Can workaround with resource-level ignores until this fix is released:

  Resource:
    Type: AWS::Events::Rule
    Metadata:
      cfn-lint:
        config:
          ignore_checks:
          - E3021

Looking into it

@PatMyron is correct that PR is to blame. Fix is easy in the rule itself so I have submitted a PR to resolve this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ow-krioles picture ow-krioles  路  5Comments

Sergei-Rudenkov picture Sergei-Rudenkov  路  4Comments

adamchainz picture adamchainz  路  5Comments

mikecee picture mikecee  路  4Comments

flomotlik picture flomotlik  路  3Comments