Troubleshooting AWS Event Handlers in the AWS Console
When to use this guide?
Use this guide to verify that the Turbot Guardrails Event Handling infrastructure in AWS is present, enabled and properly configured. This guide focuses on a single region in an account. In most cases, fixes identified by this guide will apply to other regions.
Common scenarios
- An individual event was missed: Pick an event that you expected to cause a change to a resource in the Guardrails console but didn’t. This event must be recent enough to show up in Cloudtrail search.
- Overall event handling isn’t working: A new resource or change on an existing resource doesn’t show up in the Guardrails console.
Prep Work
- Choose an account and region to investigate.
- Choose a specific event or type of event. If necessary, generate a new event by creating, updating or deleting the resource of interest. (For example, if troubleshooting an RDS instance update, change the RDS instance so as to create a new event in CloudTrail. This will make troubleshooting much easier.)
- Log into the AWS console for the region from step 1.
Verify Infrastructure using the AWS Console
CloudTrail Service
- Navigate to the CloudTrail service in the AWS console.
- Check that an Org, Global or Regional trail is present and logging. Guardrails
does not need its own dedicated trail. As long as at least one Regional,
Global or Org trail is functioning in a region then Guardrails will use it.
- If not present then one will need to be created. Create trails automatically using Guardrails Audit Trails or any other method that results in the creation of a functional cloudtrail.
- If a trail is present, use the CloudTrail console to search for the specific
event that should have been captured by Guardrails.
- If the event cannot be found, then try to reproduce a similar event. If the event continues to not show up in the CloudTrail console, please contact AWS support.
- If found, save a copy of the entire event. Guardrails Support will need this information to determine if the event was handled properly.
- Troubleshooting steps in the Events, SNS and IAM consoles will determine whether the event could have made it to Guardrails for processing.
EventBridge Service
- Navigate to the Eventbridge service in the AWS console.
- Browse to "Rules". Check that the
turbot_aws_api_events
Event Rule is present. In most environments there will also be a set of other Event Rules that follow the pattern of:turbot_aws_api_events_{aws_service}
. Please document a list of all Guardrails event rules to provide to Guardrails Support.- If no Guardrails Event Rules are present, it’s possible that event handlers have never been deployed in this region. Refer to the AWS Event Handler Deployment guide for next steps.
- In the Rules search bar, enter the name of the service associated with the
event of interest. For our RDS example, we would search for "rds". We expect
to see an Event Rule called
turbot_aws_api_events_rds
.- Many, but not all, AWS services have their own Event Rule.
- If no service specific event rule exists then look for the service inside the “turbot_aws_api_events” rule.
- If there is no service specific rule and no entry in the “turbot_aws_api_events” rule then the Guardrails mod for that service is not installed. Install the appropriate mod, let the event handlers run then test again.
- If a service specific event rule exists, examine the event pattern. An event pattern should match up with the event type previously identified. If missing, report this to Guardrails Support.
- The Target for all Guardrails Event Rules should be the
turbot_aws_api_handler
SNS Topic.
SNS Service
- Navigate to the SNS service in the AWS console.
- Check that the
turbot_api_event_handler
SNS topic is present and enabled.- If SNS topic isn’t present then it either was never deployed in the first place (access denied errors are the common cause), or something/someone has removed it. To fix, please follow the steps in the companion guide: Guardrails Troubleshooting: Event Handlers - Guardrails Console
- If the SNS topic was removed, identify the source of the removal and educate the user or fix the automation that performed the removal.
- Check that an HTTPS subscription is present for the Event Handler topic. The
subscription should be confirmed.
- If not confirmed then note down the entire URL that the subscription points to. Guardrails Support will need this information for further troubleshooting.
- To fix, please follow the steps in the companion guide: Guardrails Troubleshooting: Event Handlers - Guardrails Console
IAM Service
- Navigate to the IAM service in the AWS console.
- Find the Turbot Guardrails IAM role.
- Verify that it has sufficient permissions to deploy SNS topics, SNS subscriptions, Event Rules and Event Targets in the desired regions. See What Permissions to Grant for more info.
- If using SCPs, ensure they grant sufficient permissions for Guardrails to manage event handlers in the desired regions.
Still not working
If the above steps haven't fixed the problem, follow the companion guide: Guardrails Troubleshooting: Event Handlers - Guardrails Console