⭐ Repository → 📁 Compliance Engine → 📁 CloudAware → 📁 Google → 📁 Cloud SQL
🛡️ Google Cloud SQL Instance is idle🟢
- Contextual name: 🛡️ Instance is idle🟢
- ID:
/ce/ca/google/sql/instance-idle
- Tags:
- Policy Type:
COMPLIANCE_POLICY
- Policy Categories:
COST
,PERFORMANCE
Logic
Description
Description
This policy identifies Google Cloud SQL Instances that are considered idle based on utilization metrics over the last 30 days. An instance is flagged as idle if its average CPU utilization is below 5% and it has an average of zero database connections.
Rationale
Idle database instances consume resources and incur costs without delivering business value. Identifying and addressing these instances helps optimize cloud spending and ensures efficient resource utilization.
Impact
Before taking any action, it is essential to validate the purpose of an instance to avoid unintended disruptions to applications or services.
Audit
This policy evaluates a Google Cloud SQL Instance based on its 30-day performance metrics.
The Instance is marked as
INCOMPLIANT
if all the following criteria are met:
Metrics: CPU Utilization, 30-Day
metric is less than 5%.Metrics: Cloud SQL Connections, 30-Day
metric is zero.The Instance is marked as
INAPPLICABLE
if it is not in an RUNNABLEState
or has been running for less than 30 days.... see more
Remediation
Remediation
Before taking any action, confirm that the instance is no longer required for production, development, or periodic workloads.
Verify the Instance is Unused
- Confirm with application owners and relevant teams that the SQL instance is no longer needed.
- Check for periodic jobs to ensure the instance is not used for infrequent tasks such as monthly or quarterly reporting.
- Review dependent services to verify that no applications or services still have connection strings pointing to this instance.
Stop the Instance (Recommended First Step)
From glcoud CLI
Stopping an instance preserves data and configuration while stopping billing for vCPU and memory.
gcloud sql instances patch {{instance-name}} --activation-policy=NEVER --region={{region}}
Delete the Instance (Permanent)
If the instance is confirmed to be unnecessary, deleting it stops all associated costs. This action is irreversible.
Create a Final Backup (Recommended)
From glcoud CLI
gcloud sql backups create \
... [see more](remediation.md)
policy.yaml
Linked Framework Sections
Section | Sub Sections | Internal Rules | Policies | Flags | Compliance |
---|---|---|---|---|---|
💼 Cloudaware Framework → 💼 Waste Reduction | 25 | no data | |||
💼 Cloudaware Framework → 💼 Workload Efficiency | 24 | no data |