Table: aws_rds_clusters

This table shows data for Amazon Relational Database Service (RDS) Clusters.

https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DBCluster.html (opens in a new tab)

The primary key for this table is arn.

Relations

The following tables depend on aws_rds_clusters:

Columns

NameType
_cq_iduuid
_cq_parent_iduuid
account_idutf8
regionutf8
arn (PK)utf8
tagsjson
activity_stream_kinesis_stream_nameutf8
activity_stream_kms_key_idutf8
activity_stream_modeutf8
activity_stream_statusutf8
allocated_storageint64
associated_rolesjson
auto_minor_version_upgradebool
automatic_restart_timetimestamp[us, tz=UTC]
availability_zoneslist<item: utf8, nullable>
backtrack_consumed_change_recordsint64
backtrack_windowint64
backup_retention_periodint64
capacityint64
character_set_nameutf8
clone_group_idutf8
cluster_create_timetimestamp[us, tz=UTC]
copy_tags_to_snapshotbool
cross_account_clonebool
custom_endpointslist<item: utf8, nullable>
db_cluster_arnutf8
db_cluster_identifierutf8
db_cluster_instance_classutf8
db_cluster_membersjson
db_cluster_option_group_membershipsjson
db_cluster_parameter_grouputf8
db_subnet_grouputf8
db_system_idutf8
database_nameutf8
db_cluster_resource_idutf8
deletion_protectionbool
domain_membershipsjson
earliest_backtrack_timetimestamp[us, tz=UTC]
earliest_restorable_timetimestamp[us, tz=UTC]
enabled_cloudwatch_logs_exportslist<item: utf8, nullable>
endpointutf8
engineutf8
engine_modeutf8
engine_versionutf8
global_write_forwarding_requestedbool
global_write_forwarding_statusutf8
hosted_zone_idutf8
http_endpoint_enabledbool
iam_database_authentication_enabledbool
io_optimized_next_allowed_modification_timetimestamp[us, tz=UTC]
iopsint64
kms_key_idutf8
latest_restorable_timetimestamp[us, tz=UTC]
local_write_forwarding_statusutf8
master_user_secretjson
master_usernameutf8
monitoring_intervalint64
monitoring_role_arnutf8
multi_azbool
network_typeutf8
pending_modified_valuesjson
percent_progressutf8
performance_insights_enabledbool
performance_insights_kms_key_idutf8
performance_insights_retention_periodint64
portint64
preferred_backup_windowutf8
preferred_maintenance_windowutf8
publicly_accessiblebool
read_replica_identifierslist<item: utf8, nullable>
reader_endpointutf8
replication_source_identifierutf8
scaling_configuration_infojson
serverless_v2_scaling_configurationjson
statusutf8
storage_encryptedbool
storage_typeutf8
vpc_security_groupsjson

Example Queries

These SQL queries are sampled from CloudQuery policies and are compatible with PostgreSQL.

Amazon Aurora clusters should have backtracking enabled

SELECT
  'Amazon Aurora clusters should have backtracking enabled' AS title,
  account_id,
  arn AS resource_id,
  CASE WHEN backtrack_window IS NULL THEN 'fail' ELSE 'pass' END AS status
FROM
  aws_rds_clusters
WHERE
  engine IN ('aurora', 'aurora-mysql', 'mysql');

IAM authentication should be configured for RDS clusters

SELECT
  'IAM authentication should be configured for RDS clusters' AS title,
  account_id,
  arn AS resource_id,
  CASE
  WHEN iam_database_authentication_enabled IS NOT true THEN 'fail'
  ELSE 'pass'
  END
    AS status
FROM
  aws_rds_clusters;

RDS clusters should have deletion protection enabled

SELECT
  'RDS clusters should have deletion protection enabled' AS title,
  account_id,
  arn AS resource_id,
  CASE
  WHEN deletion_protection IS NOT true THEN 'fail'
  ELSE 'pass'
  END
    AS status
FROM
  aws_rds_clusters;

RDS databases and clusters should not use a database engine default port

(
  SELECT
    'RDS databases and clusters should not use a database engine default port'
      AS title,
    account_id,
    arn AS resource_id,
    CASE
    WHEN (engine IN ('aurora', 'aurora-mysql', 'mysql') AND port = 3306)
    OR (engine LIKE '%postgres%' AND port = 5432)
    THEN 'fail'
    ELSE 'pass'
    END
      AS status
  FROM
    aws_rds_clusters
)
UNION
  (
    SELECT
      'RDS databases and clusters should not use a database engine default port'
        AS title,
      account_id,
      arn AS resource_id,
      CASE
      WHEN (
        engine IN ('aurora', 'aurora-mysql', 'mariadb', 'mysql')
        AND (endpoint->>'Port')::INT8 = 3306
      )
      OR (engine LIKE '%postgres%' AND (endpoint->>'Port')::INT8 = 5432)
      OR (engine LIKE '%oracle%' AND (endpoint->>'Port')::INT8 = 1521)
      OR (engine LIKE '%sqlserver%' AND (endpoint->>'Port')::INT8 = 1433)
      THEN 'fail'
      ELSE 'pass'
      END
        AS status
    FROM
      aws_rds_instances
  );

RDS DB clusters should be configured for multiple Availability Zones

SELECT
  'RDS DB clusters should be configured for multiple Availability Zones'
    AS title,
  account_id,
  arn AS resource_id,
  CASE WHEN multi_az IS NOT true THEN 'fail' ELSE 'pass' END AS status
FROM
  aws_rds_clusters;

RDS DB clusters should be configured to copy tags to snapshots

SELECT
  'RDS DB clusters should be configured to copy tags to snapshots' AS title,
  account_id,
  arn AS resource_id,
  CASE
  WHEN copy_tags_to_snapshot IS NOT true THEN 'fail'
  ELSE 'pass'
  END
    AS status
FROM
  aws_rds_clusters;

An RDS event notifications subscription should be configured for critical cluster events

WITH
  any_category
    AS (
      SELECT
        DISTINCT true AS any_category
      FROM
        aws_rds_event_subscriptions
      WHERE
        (source_type IS NULL OR source_type = 'db-cluster')
        AND event_categories_list IS NULL
    ),
  any_source_id
    AS (
      SELECT
        COALESCE(array_agg(category), '{}'::STRING[]) AS any_source_categories
      FROM
        aws_rds_event_subscriptions, unnest(event_categories_list) AS category
      WHERE
        source_type = 'db-cluster' AND event_categories_list IS NOT NULL
    ),
  specific_categories
    AS (
      SELECT
        source_id, array_agg(category) AS specific_cats
      FROM
        aws_rds_event_subscriptions,
        unnest(source_ids_list) AS source_id,
        unnest(event_categories_list) AS category
      WHERE
        source_type = 'db-cluster'
      GROUP BY
        source_id
    )
SELECT
  'An RDS event notifications subscription should be configured for critical cluster events'
    AS title,
  account_id,
  arn AS resource_id,
  CASE
  WHEN any_category IS NOT true
  AND NOT (any_source_categories @> '{"failure","maintenance"}')
  AND (
      specific_cats IS NULL
      OR NOT (specific_cats @> '{"failure","maintenance"}')
    )
  THEN 'fail'
  ELSE 'pass'
  END
    AS status
FROM
  aws_rds_clusters
  LEFT JOIN any_category ON true
  INNER JOIN any_source_id ON true
  LEFT JOIN specific_categories ON
      db_cluster_identifier = specific_categories.source_id;