Description:

DynamoDB Auto Scaling makes use of the AWS Application Auto Scaling service which implements a target tracking algorithm to adjust the provisioned throughput of the DynamoDB tables/indexes upward or downward in response to the actual workload. Once DynamoDB Auto Scaling is enabled, all you have to do is to define the desired target utilization and provide upper and lower bounds for reading and write capacity. Then the feature will monitor throughput consumption using AWS Cloud Watch and will adjust provisioned capacity up or down as needed.


Rational:

When we use the AWS Management Console to create a new table, Amazon DynamoDB auto-scaling is enabled for that table by default. You can also use the console to enable auto-scaling for existing tables, modify auto-scaling settings, or disable auto-scaling.


Impact:

Once enabled, DynamoDB Auto Scaling will start monitoring your tables and indexes to automatically adjust throughput in response to changes in application workload. This can make it easier to administer your DynamoDB data, help you maximize your application(s) availability, and help reduce your DynamoDB costs.


Default Value:

By default, auto-scaling is disabled.  


Pre-Requisites:

In AWS Identity and Access Management (IAM), the AWS managed policy DynamoDBFullAccess provides the required permissions for using the DynamoDB console.


Remediation:


Test Plan:

  1. Sign in to the AWS Management Console.
  2. Navigate to DynamoDB dashboard at https://console.ahow ws.amazon.com/dynamodb/.
  3. In the left navigation panel, click on Tables.
  4. Select the DynamoDB table that you want to examine.
  5. Select the Additional Settings tab from the right panel to access the table configuration. 
  6. Click Scaling activities to show the panel with information about the auto-scaling activities.

Using AWS CLI:

To know about the auto scaling 

aws application-autoscaling describe-scaling-activities 
--service-namespace dynamodb

Implementation Steps:

Step 1: Sign to the AWS Management Console.

Step 2:Navigate to the DynamoDB dashboard at https://console.aws.amazon.com/dynamodb/.

Step 3:In the left navigation panel, under Dashboard, click Tables.

Step 4:Select the DynamoDB table that you want to reconfigure (see the Audit section part to identify the right resource).

Step 5:Select the Additional Settings tab from the right panel to access the table configuration. 

Step 6:Inside Auto Scaling section, perform the following actions:

  1. Check the Read capacity and Write capacity checkboxes to display the Application Auto Scaling settings panel.

  2. In the Target utilization box, provide the target utilization for the table (percentage).

  3. For Minimum provisioned capacity, type your lower boundary for the auto-scaling range based on your application workload.

  4. For Maximum provisioned capacity, type your upper boundary for the auto-scaling range.

  5. Check Apply the same settings to the global secondary indexes checkbox. This option allows DynamoDB Auto Scaling to uniformly scale all the global secondary indexes on the base table selected. 
  6. In the IAM Role section, ensure that AWS Service Role For Application Auto Scaling Dynamo DB Table is selected.


Step 7: Click Save to apply the configuration changes and to enable Auto Scaling for the selected DynamoDB table and indexes.


Using AWS CLI:

To add the auto scaling group to the DynamoDB table 

aws application-autoscaling register-scalable-target 
--service-namespace dynamodb 
--resource-id "table/TestTable/index/test-index" 
--scalable-dimension "dynamodb:index:WriteCapacityUnits" 
--min-capacity 5 
--max-capacity 10 


Back out Plan:

01: Sign in to the AWS Management Console.

02: Navigate to the DynamoDB dashboard at https://console.aws.amazon.com/dynamodb/.

03: In the left navigation panel, under Dashboard, click Tables.

04: Select the DynamoDB table that you want to reconfigure (see the Audit section part to identify the right resource).

05: Select the Capacity tab from the right panel to access the table configuration. 

6: Click on the Edit button of the read/write capacity

07: Click on the Off button on the auto-scaling.

08: Click on save changes 

Using AWS CLI:

To deregister the auto scaling group 

aws application-autoscaling deregister-scalable-target 
--service-namespace dynamodb 
--resource-id "table/TestTable" 
--scalable-dimension "dynamodb:table:WriteCapacityUnits"


References:

 Using the AWSManagement Console with DynamoDB Auto Scaling - Amazon DynamoDB 

Using the Amazon CLI to Manage DynamoDB Auto Scaling - Amazon DynamoDB 

 Managing Throughput Capacity Automatically with DynamoDB Auto Scaling - Amazon DynamoDB