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
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.
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.