This rule ensures that DynamoDB table auto scaling is enabled for optimal performance.
Rule | DynamoDB table auto scaling should be enabled |
Framework | CISA-cyber-essentials |
Severity | ✔ High |
DynamoDB Table Auto Scaling for CISA Cyber Essentials
Description
DynamoDB is a fully managed NoSQL database service provided by AWS. It allows users to create tables to store and retrieve any amount of data and serve any level of request traffic. DynamoDB offers the capability to automatically adjust provisioned capacity based on the application's demand with the help of DynamoDB Table Auto Scaling.
Auto Scaling is an important feature that helps in optimizing DynamoDB costs and performance. By enabling auto scaling, the provisioning of read and write capacity units is automatically adjusted based on the consumed capacity of the table, ensuring that the application never runs out of capacity or over-provisions unutilized capacity.
Enabling DynamoDB Table Auto Scaling for CISA Cyber Essentials ensures that the table can efficiently handle varying levels of read and write requests, and it prevents any performance degradation or resource wastage.
Troubleshooting Steps
Necessary Codes
No specific code is required to enable DynamoDB Table Auto Scaling. It can be enabled directly through the AWS Management Console, AWS CLI, or AWS SDKs.
Step-by-Step Guide for Remediation
To enable auto scaling for a DynamoDB table, follow the step-by-step guide below:
AWS Management Console:
AWS CLI:
Open the AWS CLI.
Run the following command to enable auto scaling for the 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>
Ensure you replace
<table-name>
with the actual name of the table and provide appropriate values for <min-capacity>
and <max-capacity>
.Run the following command to create a scaling policy:
aws application-autoscaling put-scaling-policy --policy-name <policy-name> --service-namespace dynamodb --resource-id table/<table-name> --scalable-dimension dynamodb:table:ReadCapacityUnits --policy-type TargetTrackingScaling --target-tracking-scaling-policy-configuration file://config.json
Replace
<policy-name>
with the name for your policy and <table-name>
with the actual name of the table.AWS SDKs:
Conclusion
Enabling DynamoDB Table Auto Scaling for CISA Cyber Essentials ensures that the table can dynamically adjust its provisioned capacity based on the application's demand, preventing both resource wastage and performance degradation. It optimizes cost and allows the application to handle varying levels of read and write requests efficiently. Regular monitoring and adjustment of scaling policies are recommended to ensure optimal performance.