This rule requires enabling auto scaling for DynamoDB tables.
Rule | DynamoDB table auto scaling should be enabled |
Framework | NIST 800-53 Revision 5 |
Severity | ✔ High |
Rule Description:
DynamoDB table auto scaling should be enabled to ensure compliance with NIST 800-53 Revision 5. Enabling auto scaling allows your DynamoDB tables to automatically adjust their capacity based on the current workload, ensuring efficient utilization of resources and the ability to handle sudden spikes in traffic.
Troubleshooting Steps:
If auto scaling is not enabled for DynamoDB tables, you may encounter performance issues during high traffic periods or resource wastage during low traffic periods. Follow the steps below to troubleshoot and enable auto scaling if necessary:
Necessary Codes:
The following AWS CLI commands can be used to enable auto scaling for DynamoDB tables:
List existing DynamoDB tables:
aws dynamodb list-tables
Describe a specific DynamoDB table to check if auto scaling is already enabled:
aws dynamodb describe-table --table-name <table_name>
Enable auto scaling for a DynamoDB table:
aws application-autoscaling register-scalable-target \ --service-namespace dynamodb \ --scalable-dimension dynamodb:table:ReadCapacityUnits \ --resource-id table/<table_name> \ --min-capacity <min_capacity> \ --max-capacity <max_capacity> aws application-autoscaling put-scaling-policy \ --service-namespace dynamodb \ --scalable-dimension dynamodb:table:ReadCapacityUnits \ --resource-id table/<table_name> \ --policy-name <policy_name> \ --policy-type TargetTrackingScaling \ --target-tracking-scaling-policy-configuration \ '{ "TargetValue": <target_utilization_percentage>, "ScaleInCooldown": <scale_in_cooldown_seconds>, "ScaleOutCooldown": <scale_out_cooldown_seconds>, "PredefinedMetricSpecification": { "PredefinedMetricType": "DynamoDBReadCapacityUtilization" } }' aws application-autoscaling put-scaling-policy \ --service-namespace dynamodb \ --scalable-dimension dynamodb:table:WriteCapacityUnits \ --resource-id table/<table_name> \ --policy-name <policy_name> \ --policy-type TargetTrackingScaling \ --target-tracking-scaling-policy-configuration \ '{ "TargetValue": <target_utilization_percentage>, "ScaleInCooldown": <scale_in_cooldown_seconds>, "ScaleOutCooldown": <scale_out_cooldown_seconds>, "PredefinedMetricSpecification": { "PredefinedMetricType": "DynamoDBWriteCapacityUtilization" } }'
Step-by-Step Guide for Remediation:
Follow the step-by-step guide below to enable auto scaling for DynamoDB tables:
List existing DynamoDB tables using the command:
aws dynamodb list-tables
Identify the tables for which auto scaling needs to be enabled based on workload and resource consumption patterns.
Describe a specific DynamoDB table to check if auto scaling is already enabled:
aws dynamodb describe-table --table-name <table_name>
Note: Skip the following steps if auto scaling is already enabled for the table.
Evaluate the required read and write capacity for the table during peak and off-peak periods.
Determine the desired auto scaling configuration for the table, including minimum and maximum capacity units, target utilization, and scaling policies.
Enable auto scaling for the table using the following commands:
aws application-autoscaling register-scalable-target \ --service-namespace dynamodb \ --scalable-dimension dynamodb:table:ReadCapacityUnits \ --resource-id table/<table_name> \ --min-capacity <min_capacity> \ --max-capacity <max_capacity>
aws application-autoscaling put-scaling-policy \ --service-namespace dynamodb \ --scalable-dimension dynamodb:table:ReadCapacityUnits \ --resource-id table/<table_name> \ --policy-name <policy_name> \ --policy-type TargetTrackingScaling \ --target-tracking-scaling-policy-configuration \ '{ "TargetValue": <target_utilization_percentage>, "ScaleInCooldown": <scale_in_cooldown_seconds>, "ScaleOutCooldown": <scale_out_cooldown_seconds>, "PredefinedMetricSpecification": { "PredefinedMetricType": "DynamoDBReadCapacityUtilization" } }'
aws application-autoscaling put-scaling-policy \ --service-namespace dynamodb \ --scalable-dimension dynamodb:table:WriteCapacityUnits \ --resource-id table/<table_name> \ --policy-name <policy_name> \ --policy-type TargetTrackingScaling \ --target-tracking-scaling-policy-configuration \ '{ "TargetValue": <target_utilization_percentage>, "ScaleInCooldown": <scale_in_cooldown_seconds>, "ScaleOutCooldown": <scale_out_cooldown_seconds>, "PredefinedMetricSpecification": { "PredefinedMetricType": "DynamoDBWriteCapacityUtilization" } }'
Replace
<table_name>
, <min_capacity>
, <max_capacity>
, <policy_name>
, <target_utilization_percentage>
, <scale_in_cooldown_seconds>
, and <scale_out_cooldown_seconds>
with the appropriate values for your DynamoDB table.Repeat steps 4 to 6 for each table that requires auto scaling.
By following these steps and enabling auto scaling for DynamoDB tables, you ensure compliance with NIST 800-53 Revision 5 and optimize the performance and resource utilization of your DynamoDB environment.