Skip to main content

🛡️ Google Cloud SQL Instance is idle🟢

Stats​

not available

Logic​

Description​

Open File

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 RUNNABLE State or has been running for less than 30 days.

... see more

Remediation​

Open File

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.
From Google Cloud 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.

From Google Cloud CLI​
gcloud sql backups create \

... [see more](remediation.md)

policy.yaml​

Open File

Linked Framework Sections​

SectionSub SectionsInternal RulesPoliciesFlagsCompliance
💼 Cloudaware Framework → 💼 Waste Reduction30no data
💼 Cloudaware Framework → 💼 Workload Efficiency25no data