Clusters With High Disk Usage Should Be Scaled
More Info:
AWS Redshift clusters with high disk usage should be scaled to increase their storage capacity.
Risk Level
Low
Address
Reliability
Compliance Standards
- APRA CPS 234 (Australia)
- BSI C5 (Germany)
- Brazil LGPD
- CCPA / CPRA (California)
- CIS Critical Security Controls v8
- CMMC 2.0
- CSA Cloud Controls Matrix v4
- Cloudanix Best Practice
- DPDPA
- Digital Operational Resilience Act (EU)
- Essential 8
- ISO/IEC 27017
- ISO/IEC 27018
- ISO/IEC 27701
- KSA PDPL
- MAS Technology Risk Management (Singapore)
- MITRE ATT&CK (Cloud)
- NIS2 Directive
- NIST SP 800-171
- NYDFS 23 NYCRR 500
- SWIFT Customer Security Controls Framework
- Sarbanes-Oxley IT General Controls
- UK NCSC Cyber Assessment Framework
Triage and Remediation
- Remediation
Remediation
Using Console
To remediate high disk usage in an AWS Redshift cluster using the AWS Management Console, follow these steps:
-
Sign in to the AWS Management Console: Go to https://aws.amazon.com/ and sign in to the AWS Management Console using your credentials.
-
Navigate to Amazon Redshift Console: In the AWS Management Console, navigate to the Amazon Redshift service by either searching for it in the search bar or locating it under the "Analytics" section.
-
Select the Redshift Cluster: From the list of clusters, select the Redshift cluster that is experiencing high disk usage and needs to be scaled.
-
Modify the Cluster: Click on the "Cluster" name to access the cluster details. Then, click on the "Modify" button to make changes to the cluster configuration.
-
Adjust the Node Type or Number of Nodes: In the Modify Cluster section, you can either increase the node type (for more powerful nodes) or increase the number of nodes in the cluster to address the high disk usage issue. You can do this by selecting a different node type from the dropdown menu or adjusting the number of nodes in the "Cluster Configuration" section.
-
Apply the Changes: After making the necessary adjustments to the cluster configuration, scroll down and click on the "Apply Changes" button to apply the changes to the cluster.
-
Monitor the Cluster: Once the changes are applied, monitor the cluster to ensure that the disk usage has decreased and the cluster performance has improved.
By following these steps and scaling the AWS Redshift cluster to address the high disk usage, you can effectively remediate the issue and optimize the performance of your Redshift cluster.
Using CLI
To remediate high disk usage in AWS Redshift clusters using AWS CLI, follow these steps:
-
Check Disk Usage: First, you need to check the disk usage of your Redshift cluster to identify the extent of the issue. You can use the following AWS CLI command to describe the cluster and get information about its disk usage:
aws redshift describe-clusters --cluster-identifier YOUR_CLUSTER_IDENTIFIERReplace
YOUR_CLUSTER_IDENTIFIERwith the actual identifier of your Redshift cluster. -
Scale Cluster: If the disk usage is high, you can scale your Redshift cluster by modifying the cluster to increase the number of nodes or node type. To do this, use the following AWS CLI command:
aws redshift modify-cluster --cluster-identifier YOUR_CLUSTER_IDENTIFIER --node-type NEW_NODE_TYPE --number-of-nodes NEW_NUMBER_OF_NODESReplace
YOUR_CLUSTER_IDENTIFIERwith the actual identifier of your Redshift cluster,NEW_NODE_TYPEwith the new node type you want to use, andNEW_NUMBER_OF_NODESwith the desired number of nodes. -
Monitor Cluster: After scaling the cluster, monitor the disk usage to ensure that it has decreased to a manageable level. You can use the
describe-clusterscommand mentioned in step 1 to periodically check the disk usage.
By following these steps, you can effectively remediate high disk usage in AWS Redshift clusters using AWS CLI.
Using Python
To remediate high disk usage in AWS Redshift clusters using Python, you can automate the process by periodically checking the disk usage metrics and scaling the cluster up if the disk usage exceeds a certain threshold. Here are the step-by-step instructions to remediate this issue:
-
Install Boto3: Boto3 is the AWS SDK for Python, which allows you to interact with AWS services. You can install it using pip:
pip install boto3 -
Create a Python script: Create a Python script that will check the disk usage of the Redshift cluster and scale it up if the disk usage is above the threshold. Below is a sample script to get you started:
import boto3# Initialize the Redshift clientredshift = boto3.client('redshift')# Define the cluster identifiercluster_identifier = 'your-redshift-cluster-id'# Get the disk usage metrics for the clusterresponse = redshift.describe_cluster_performance(clusterIdentifier=cluster_identifier)# Check the disk space usagedisk_space_usage = response['ClusterPerformance']['DiskSpaceUsage']disk_space_threshold = 80 # Define your own threshold hereif disk_space_usage > disk_space_threshold:# Scale up the clusterredshift.modify_cluster(ClusterIdentifier=cluster_identifier, NumberOfNodes=2) # Increase the number of nodes as neededprint(f"Cluster {cluster_identifier} scaled up due to high disk usage.")else:print(f"Disk usage for cluster {cluster_identifier} is within the threshold.") -
Set up AWS credentials: Make sure you have set up your AWS credentials either by exporting them as environment variables or using AWS CLI
aws configurecommand. -
Schedule the script: You can schedule the script to run periodically using cron jobs or AWS CloudWatch Events to continuously monitor the disk usage of the Redshift cluster and scale it up when needed.
-
Monitor the remediation: After implementing the script, monitor the disk usage of the Redshift cluster regularly to ensure that it stays within the threshold and adjust the threshold or scaling logic if necessary.
By following these steps, you can automate the remediation of high disk usage in AWS Redshift clusters using Python.
Using Terraform
resource "aws_redshift_cluster" "THIS_CLUSTER" {
cluster_identifier = "EXISTING_CLUSTER_IDENTIFIER" # replace with your cluster ID
# Keep existing settings (db_name, master_username, iam_roles, etc.)
# ...
node_type = "NEW_NODE_TYPE" # e.g. "ra3.4xlarge"; set if you want a Classic-style resize
number_of_nodes = NEW_TOTAL_NODE_COUNT # e.g. 6; increase to scale disk capacity
# Other existing arguments...
}
Scaling by increasing number_of_nodes performs an Elastic Resize when supported; changing node_type and/or number_of_nodes together may result in a slower, more disruptive Classic Resize, and the cluster will experience downtime during the operation (data-copy/cutover), though Terraform will treat this as an in-place modification rather than a resource replacement.
Verification: terraform plan should show only an in-place update to aws_redshift_cluster.THIS_CLUSTER with changes to number_of_nodes (and node_type if you changed it), and no -/+ replacement for the resource.