Table: aws_dynamodb_table_replica_auto_scalings

This table shows data for Amazon DynamoDB Table Replica Auto Scalings.

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

The primary key for this table is _cq_id.

Relations

This table depends on aws_dynamodb_tables.

Columns

NameType
_cq_id (PK)uuid
_cq_parent_iduuid
account_idutf8
regionutf8
table_arnutf8
global_secondary_indexesjson
region_nameutf8
replica_provisioned_read_capacity_auto_scaling_settingsjson
replica_provisioned_write_capacity_auto_scaling_settingsjson
replica_statusutf8

Example Queries

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

DynamoDB tables should automatically scale capacity with demand

SELECT
  'DynamoDB tables should automatically scale capacity with demand' AS title,
  t.account_id,
  pr.arn AS resource_id,
  CASE
  WHEN t.billing_mode_summary->>'BillingMode' IS DISTINCT FROM 'PAY_PER_REQUEST'
  AND (
      (
        s.replica_provisioned_read_capacity_auto_scaling_settings->>'AutoScalingDisabled'
      )::BOOL
      IS NOT false
      OR (
          s.replica_provisioned_write_capacity_auto_scaling_settings->>'AutoScalingDisabled'
        )::BOOL
        IS NOT false
    )
  AND (pr._cq_id IS NULL OR pw._cq_id IS NULL)
  THEN 'fail'
  ELSE 'pass'
  END
    AS status
FROM
  aws_dynamodb_tables AS t
  LEFT JOIN aws_dynamodb_table_replica_auto_scalings AS s ON s.table_arn = t.arn
  LEFT JOIN aws_applicationautoscaling_policies AS pr ON
      pr.service_namespace = 'dynamodb'
      AND pr.resource_id = concat('table/', t.table_name)
      AND pr.policy_type = 'TargetTrackingScaling'
      AND pr.scalable_dimension = 'dynamodb:table:ReadCapacityUnits'
  LEFT JOIN aws_applicationautoscaling_policies AS pw ON
      pw.service_namespace = 'dynamodb'
      AND pw.resource_id = concat('table/', t.table_name)
      AND pw.policy_type = 'TargetTrackingScaling'
      AND pw.scalable_dimension = 'dynamodb:table:WriteCapacityUnits';