Certopolis

AWS Certified CloudOps Engineer – Associate

Why an EventBridge rule does not trigger its target

The EventBridge User Guide points to a short list of causes. The target may lack a resource-based permission for events.amazonaws.com. Scheduled rules run in UTC. API call events from global services such as IAM appear only in US East (N. Virginia). Read-only management events need a special rule state. Undelivered events are dropped unless a dead-letter queue is set.

Is the target allowed to be invoked?

For Lambda, Amazon SNS and Amazon SQS targets with no IAM execution role on the target, EventBridge relies on the resource-based policy of the target. A Lambda function policy must allow lambda:InvokeFunction for the principal events.amazonaws.com. If the policy contains a SourceAccount field, remove it: AWS says that setting prevents EventBridge from invoking the function.

An SNS topic policy must allow sns:Publish for events.amazonaws.com. If an SQS queue or SNS topic is encrypted, the KMS key policy must let events.amazonaws.com use kms:Decrypt and kms:GenerateDataKey.

The rule metrics help: check TriggeredRules, Invocations and FailedInvocations in CloudWatch. A rule that triggers but shows failed invocations points at the target, not the pattern.

Is the rule looking in the right place and time?

Schedule expressions on rules are set in UTC. The finest resolution of a cron rule is one minute.

Global services such as IAM and Amazon Route 53 are available only in US East (N. Virginia), so API call events from them are available only in that Region. A rule in another Region never sees them.

CloudTrail events are delivered to the default event bus only, and a trail with logging must be enabled. A rule in the default ENABLED state matches write management events but not read-only ones. Read-only management events are matched only when the rule state is ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS.

Event patterns match ARNs exactly, so a colon and a slash are not interchangeable. Some events, such as API call events from CloudTrail, have nothing in the resources field.

What happens to events that cannot be delivered?

By default EventBridge retries a failed delivery for 24 hours and up to 185 times. After that the event is dropped.

To keep such events, set a dead-letter queue on the target. It must be a standard SQS queue, not FIFO, in the same Region as the rule. Errors from missing permissions or a target that no longer exists are not retried; those events go straight to the DLQ if there is one.

Where the exam catches people

  • Writing a scheduled rule in local time: rule schedules are in UTC.
  • Creating a rule for IAM API calls in your home Region: events from global services are available only in US East (N. Virginia).
  • Expecting a default rule to match a read-only call such as a Get or Describe: that needs ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS.
  • Using a FIFO queue or a queue in another Region as the dead-letter queue: it must be a standard queue in the rule's Region.
  • Adding SourceAccount to a Lambda permission for EventBridge: that setting prevents EventBridge from invoking the function.

Written from these sources

Try 3 questions on this

Pick an answer to see why each option is right or wrong.

  1. An EventBridge rule in eu-west-1 sends order events to an AWS Step Functions state machine. During long maintenance windows, deliveries keep failing until EventBridge drops the events. The company keeps one SQS standard queue, failed-events, in us-east-1 for failures from every Region. Undelivered events from this rule must now be kept for reprocessing. Which action should the SysOps administrator take to meet this requirement?

    Right. In the game that’s Renown for your Deployment, Provisioning, and Automation building.

    Not that one: A is right. In the game your Deployment, Provisioning, and Automation building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    That queue must be a standard queue in the same Region as the rule. The central queue is in us-east-1 and the rule is in eu-west-1, so a new standard queue in eu-west-1, with a policy that lets EventBridge send to it, is the one that works.

    Written from docs.aws.amazon.com/eventbridge/latest/userguide/eb-rule-dlq.html

  2. A security team wants an alert whenever anyone reads the key policy of one AWS KMS key. A trail logs all read and write management events. An EventBridge rule on the default event bus in the key's Region matches AWS API Call via CloudTrail events for GetKeyPolicy and targets an SNS topic. A similar rule for PutKeyPolicy alerts correctly, but the GetKeyPolicy rule never fires. Which action should the SysOps administrator take to resolve this issue?

    Right. In the game that’s Renown for your Deployment, Provisioning, and Automation building.

    Not that one: B is right. In the game your Deployment, Provisioning, and Automation building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    Setting the GetKeyPolicy rule's state to ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS, which is done through the AWS CLI or CloudFormation, lets it match the reads the trail is already logging.

    Written from docs.aws.amazon.com/eventbridge/latest/userguide/eb-service-event-cloudtrail.html

  3. A company runs all of its workloads in eu-west-1. A trail created in eu-west-1 logs management events for all Regions. An EventBridge rule on the eu-west-1 default event bus matches AWS API Call via CloudTrail events for the IAM CreateAccessKey action and sends them to an SNS topic. New access keys are being created, but the rule never fires. Which action should the SysOps administrator take to resolve this issue?

    Right. In the game that’s Renown for your Deployment, Provisioning, and Automation building.

    Not that one: C is right. In the game your Deployment, Provisioning, and Automation building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    A rule in us-east-1 does see it, and targeting the eu-west-1 default bus brings the event back to where the existing SNS rule already runs.

    Written from docs.aws.amazon.com/eventbridge/latest/userguide/eb-troubleshooting.html

Ask for something