Skip to content

AWS::Events::Rule - Verify Targets is not iam #4505

Description

@r-heimann

Is this feature request related to a new rule or cfn-lint capabilities?

New capability

Describe the feature you'd like to request

Currently cfn-lint does not warn the user about a potential wrong Eventbridge Rule Target. The following CloudFormation template

AWSTemplateFormatVersion: 2010-09-09
Description: Test

Resources:
  Role:
    Type: AWS::IAM::Role
    Properties:
      AssumeRolePolicyDocument:
        Version: 2012-10-17
        Statement:
          - Effect: Allow
            Principal:
              Service: ec2.amazonaws.com
            Action: sts:AssumeRole

  Rule:
    Type: AWS::Events::Rule
    Properties:
      State: ENABLED
      ScheduleExpression: "cron(0/15 * * * ? *)"
      Targets:
        - Id: Test
          Arn: !GetAtt Role.Arn

will cause the error:

iam is not a supported service for a target.
(Service: EventBridge, Status Code: 400, Request ID: 9...f)
(SDK Attempt Count: 1)

Describe the solution you'd like

It would be great if cfn-lint could verify if !Refs/!GetAtts are valid targets for AWS::Events::Rule

Additional context

No response

Is this something that you'd be interested in working on?

  • 👋 I may be able to implement this feature request

Would this feature include a breaking change?

  • ⚠️ This feature might incur a breaking change

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions