Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DynamoDB table auto scaling should be enabled fails. Closes #312 #319

Merged
merged 2 commits into from
Nov 18, 2021

Conversation

khushboo9024
Copy link
Contributor

@khushboo9024 khushboo9024 commented Nov 18, 2021

Checklist

  • Issue(s) linked
> with target_count as (
  select
    t.resource_id as resource_id,
    count(t.resource_id) as count
  from
    aws_appautoscaling_target as t where service_namespace = 'dynamodb'
    group by t.resource_id
)
select
  -- Required Columns
  d.arn as resource,
  case
    when t.resource_id is null then 'alarm'
    when t.count < 2 then 'alarm'
    else 'ok'
  end as status,
  case
    when t.resource_id is null then d.title || ' autoscaling not enabled.'
    when t.count < 2 then d.title || ' auto scaling not enabled for both read and write capacity.'
    else d.title || ' autoscaling enabled for both read and write capacity.'
  end as reason,
  -- Additional Dimensions
  d.region,
  d.account_id
from
  aws_dynamodb_table as d
  left join target_count as t on concat('table/', d.name) = t.resource_id;

+-------------------------------------------------------------------+--------+-------------------------------------------------------------------------+-----------+--------------+
| resource                                                          | status | reason                                                                  | region    | account_id   |
+-------------------------------------------------------------------+--------+-------------------------------------------------------------------------+-----------+--------------+
| arn:aws:dynamodb:us-east-1:1234567891:table/no-autoscalling-tab | alarm  | no-autoscalling-tab autoscaling not enabled.                            | us-east-1 | 1234567891 |
| arn:aws:dynamodb:us-east-1:1234567891:table/test_table_target   | ok     | test_table_target autoscaling enabled for both read and write capacity. | us-east-1 | 1234567891 |
| arn:aws:dynamodb:us-east-1:1234567891:table/tets56              | ok     | tets56 autoscaling enabled for both read and write capacity.            | us-east-1 | 1234567891 |
| arn:aws:dynamodb:us-east-1:1234567891:table/tets67              | ok     | tets67 autoscaling enabled for both read and write capacity.            | us-east-1 | 1234567891 |
+-------------------------------------------------------------------+--------+-------------------------------------------------------------------------+-----------+--------------+

@khushboo9024 khushboo9024 self-assigned this Nov 18, 2021
@rajlearner17 rajlearner17 linked an issue Nov 18, 2021 that may be closed by this pull request
Copy link
Contributor

@rajlearner17 rajlearner17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@misraved misraved merged commit 117cb71 into release/v0.20 Nov 18, 2021
@misraved misraved deleted the issue-312 branch November 18, 2021 14:38
@misraved misraved changed the title DynamoDB table auto scaling should be enabled fails. Closes #31 DynamoDB table auto scaling should be enabled fails. Closes #312 Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DynamoDB table auto scaling should be enabled fails
3 participants