> ## Documentation Index
> Fetch the complete documentation index at: https://help.nops.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Unused Secrets Manager Secrets

> Delete Secrets Manager secrets that no application has read in the last 90 days.

Secrets Manager bills a monthly fee for every secret it stores, whether or not anything reads it. Secrets for retired services, old database users and test environments often stay behind. nOps finds secrets that nothing has read for 90 days and groups them by account and region, with each secret listed.

| | |
| - | - |
| **Cloud** | AWS |
| **Category** | Security |
| **Service** | AWS Secrets Manager |
| **Action** | Delete |
| **Effort** | Low |
| **Restart needed** | No |
| **Can be rolled back** | Yes |
| **Analysis window** | Last 90 days |
| **Source** | nOps |

## Why it matters

The fee per secret is small, but accounts can hold hundreds or thousands of unused secrets, and the cost never stops on its own.

## How nOps finds it

nOps reads the last 90 complete days of Secrets Manager billing. A secret is flagged when it was billed on at least 88 of those days and had no GetSecretValue or BatchGetSecretValue calls. Secrets managed by other AWS services and secrets replicated to several regions are skipped. Each secret must cost at least \$0.30 a month, from the last 7 days scaled to a month. Secrets are grouped into one recommendation per account and region, up to 200 per group, and secrets with production in their name are grouped separately with a warning.

## Before you start

Permission to delete secrets (`secretsmanager:DeleteSecret`). Know which teams own the secrets.

## How to implement

1. Review the list of secrets in the recommendation and check each one's owner and tags.
2. Check for rare readers, such as quarterly jobs, break-glass credentials or a service that reads its secret only when it starts.
3. Delete each secret with a recovery window: `aws secretsmanager delete-secret --secret-id ARN --recovery-window-in-days 30`.
4. Watch for errors during the recovery window. If something fails, restore the secret.
5. Remove the secrets from Terraform or CloudFormation so they are not recreated.

## Risks and considerations

* A service that reads its secret only at start-up shows no reads if it has not restarted in 90 days. Be careful with production-named secrets.
* During the recovery window the secret can be restored with `aws secretsmanager restore-secret`. After it ends, deletion is permanent.
* Credentials in a deleted secret are not revoked. Rotate or remove them at the source too.

## FAQs

> [accordion] Do DescribeSecret or list calls count as use?
>
> No. Security scanners call those regularly, so nOps only counts reads of the secret value.

## Related

* [Supported recommendations](https://help.nops.io/inform/supported-recommendations.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.