steampipe plugin install aws

Table: aws_eventbridge_rule - Query AWS EventBridge Rule using SQL

The AWS EventBridge Rule is a component of Amazon EventBridge, a serverless event bus service that makes it easy to connect applications together using data from your own applications, integrated Software-as-a-Service (SaaS) applications, and AWS services. EventBridge delivers a stream of real-time data from event sources and routes that data to targets like AWS Lambda. It primarily ingests, filters, and delivers events so you can build new applications quickly, and get to market faster.

Table Usage Guide

The aws_eventbridge_rule table in Steampipe provides you with information about EventBridge rules within AWS EventBridge. This table allows you, as a DevOps engineer, to query rule-specific details, including the rule name, ARN, state, description, schedule expression, and associated metadata. You can utilize this table to gather insights on rules, such as the rules associated with a specific event bus, the state of the rules (whether they are enabled or disabled), and more. The schema outlines the various attributes of the EventBridge rule for you, including the rule ARN, event bus name, description, state, and associated tags.

Examples

Basic info

Gain insights into the status and origins of your AWS EventBridge rules. This query is particularly useful for auditing and maintaining an overview of your EventBridge settings.

select
name,
arn,
state,
created_by,
event_bus_name
from
aws_eventbridge_rule;
select
name,
arn,
state,
created_by,
event_bus_name
from
aws_eventbridge_rule;

List disabled rules

Determine the areas in which AWS EventBridge rules are not active. This is useful for identifying potential gaps in event-driven workflows or areas where automation may have been turned off.

select
name,
arn,
state,
created_by
from
aws_eventbridge_rule
where
state != 'ENABLED';
select
name,
arn,
state,
created_by
from
aws_eventbridge_rule
where
state != 'ENABLED';

Get the target information for each rule

This query allows you to identify the target details for each rule in your AWS EventBridge service. It's useful for auditing and understanding the relationships and dependencies between different rules and their targets within your AWS infrastructure.

select
name,
cd ->> 'Id' as target_id,
cd ->> 'Arn' as target_arn,
cd ->> 'RoleArn' as role_arn
from
aws_eventbridge_rule,
jsonb_array_elements(targets) as cd;
select
name,
json_extract(cd.value, '$.Id') as target_id,
json_extract(cd.value, '$.Arn') as target_arn,
json_extract(cd.value, '$.RoleArn') as role_arn
from
aws_eventbridge_rule,
json_each(targets) as cd;

Schema for aws_eventbridge_rule

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
account_idtext=, !=, ~~, ~~*, !~~, !~~*The AWS Account ID in which the resource is located.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
arntextThe Amazon Resource Name (ARN) of the rule.
created_bytextThe account ID of the user that created the rule.
descriptiontextThe description of the rule.
event_bus_nametext=The name or ARN of the event bus associated with the rule.
event_patternjsonbThe event pattern of the rule.
managed_bytextIf this is a managed rule, created by an AWS service on your behalf, this field displays the principal name of the AWS service that created the rule.
nametext=The name of the rule.
name_prefixtext=Specifying this limits the results to only those event rules with names that start with the specified prefix.
partitiontextThe AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov).
regiontextThe AWS Region in which the resource is located.
role_arntextThe Amazon Resource Name (ARN) of the IAM role associated with the rule.
schedule_expressiontextThe scheduling expression. For example, 'cron(0 20 * * ? *)', 'rate(5 minutes)'.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
statetextThe state of the rule.
tagsjsonbA map of tags for the resource.
tags_srcjsonbA list of tags assigned to the rule.
targetsjsonbThe targets assigned to the rule.
titletextTitle of the resource.

Export

This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- aws

You can pass the configuration to the command with the --config argument:

steampipe_export_aws --config '<your_config>' aws_eventbridge_rule