aws secrets manager delete secret version

Delete AWS Secret Version: Step-by-Step Guide

By Kevin White
AD

Ever needed to remove a specific version of a secret in AWS Secrets Manager? Maybe you've discovered an error or want to improve security by replacing it with a better version. The process is straightforward, and we'll guide you through deleting a secret version in AWS Secrets Manager.

But first, why should you delete a secret version? Some reasons include fixing mistakes, enhancing security, or adhering to compliance and regulatory requirements, such as GDPR's right to be forgotten or PCI-DSS standards.

Understanding AWS Secrets Manager

AWS Secrets Manager is a fully managed service that helps you securely store, manage, and retrieve secrets like API keys, database credentials, and other sensitive data. It allows version control, so you can track changes and roll back if necessary.

AD
Create a Secret Manager from AWS Console
Create a Secret Manager from AWS Console
the info sheet for how to configure aws security best practices?
the info sheet for how to configure aws security best practices?
the aws basics poster is shown here
the aws basics poster is shown here

Before we dive into deleting a secret version, let's understand the basics of AWS Secrets Manager, including its secret versioning feature. This will help you better manage and control your sensitive data.

Secrets Manager Basics

In AWS Secrets Manager, a secret is a combination of a name, a secret value, and optional metadata. It supports rotation, automatic versioning, and recovery of deleted secrets. You can enable versioning to have a complete history of changes.

ColdFusion with AWS Secrets Manager: Securely Storing API Keys and Credentials
ColdFusion with AWS Secrets Manager: Securely Storing API Keys and Credentials
AWS (Amazon Web Services) Explained: Cloud Computing Made Simple ☁️🚀
AWS (Amazon Web Services) Explained: Cloud Computing Made Simple ☁️🚀
#45 - TECH SECRETS & SHORTCUTS
#45 - TECH SECRETS & SHORTCUTS

Secrets Manager automatically creates a new version whenever you update or rotate a secret. Each version has a unique VersionStage, which can be one of these: AWSCURRENT, AWSPREVIOUS, or a custom stage.

Secret Versioning

Secret versioning in Secrets Manager allows you to track changes, roll back to previous versions if needed, and retrieve past versions. It enables better control and adds an extra layer of security by making it harder to accidentally overwrite or delete important data.

AD

To manage secret versions effectively, you should understand the different version stages, how to retrieve past versions, and how to restore or replace versions when necessary.

the aws security management manual is displayed in this screenshote, which shows how to
the aws security management manual is displayed in this screenshote, which shows how to
the aws in plain english info sheet
the aws in plain english info sheet
☁️ AWS Security Explained Simply! | Essential AWS Security Services Every Beginner Should Know 🔐
☁️ AWS Security Explained Simply! | Essential AWS Security Services Every Beginner Should Know 🔐
AWS IAM Best Practices
AWS IAM Best Practices
Claude AI Secret Commands You Need to Know 🤖
Claude AI Secret Commands You Need to Know 🤖
the aws lamba cheat sheet
the aws lamba cheat sheet

Deleting a Secret Version in AWS Secrets Manager

Now that you're familiar with AWS Secrets Manager and its secret versioning, let's explore how to delete a specific secret version.

Deleting a secret version doesn't remove it permanently; it onlyunset the version. The deleted version remains in the Secrets Manager for 30 days (by default) before being permanently removed. During this retention period, you can recover the deleted version if needed.

AD

Unsetting a Secret Version

The first step in deleting a secret version is unsetting it. You're essentially removing the version's current status, making it unavailable for use. This process doesn't delete the version permanently, just marks it as AWSPREVIOUS.

Aws Cheat Sheet, Aws Services Cheat Sheet, Aws Cloud Computing, Aws Cloud, Aws Cloud Practitioner, Flow Chart Design, Aws Lambda, Enterprise Architecture, Relational Database
Aws Cheat Sheet, Aws Services Cheat Sheet, Aws Cloud Computing, Aws Cloud, Aws Cloud Practitioner, Flow Chart Design, Aws Lambda, Enterprise Architecture, Relational Database
the aws cloud services chart
the aws cloud services chart
AWS IAM Explained for Beginners | Identity, Access & Security Guide
AWS IAM Explained for Beginners | Identity, Access & Security Guide
AWS ROADMAP (2026)
AWS ROADMAP (2026)
the info sheet shows how to use aws iam for security and access management
the info sheet shows how to use aws iam for security and access management
AWS Cheat Sheet ☁️ Amazon Web Services Explained for Beginners
AWS Cheat Sheet ☁️ Amazon Web Services Explained for Beginners
the top 10 aws use cases
the top 10 aws use cases
12 AWS Services Every Cloud Engineer Should Know in 2026
12 AWS Services Every Cloud Engineer Should Know in 2026
AWS OUTAGE
AWS OUTAGE
AWS MESSAGING: SQS vs SNS. What, How & Use Cases
AWS MESSAGING: SQS vs SNS. What, How & Use Cases
screenshot of the new secret section in wordpress's search console, where you can select which type and how to use it
screenshot of the new secret section in wordpress's search console, where you can select which type and how to use it
TOP 20 AWS (Amazon Web Services) Services
TOP 20 AWS (Amazon Web Services) Services

To unset a secret version, follow these steps:

  1. Open the AWS Secrets Manager console and choose the secret whose version you want to delete.
  2. In the "Versions" tab, select the version you want to unset and choose "Actions" > "Unset".
  3. Confirm your choice, and the version will be marked as AWSPREVIOUS.

Deleting a Secret Version Permanently

After unsetting a secret version, you can delete it permanently if you're sure you won't need it in the future. This process can't be undone, so be cautious while deleting secret versions permanently.

AD

To delete a secret version permanently, follow these steps:

  1. In the "Versions" tab, find the version you unset and choose "Actions" > "Delete".
  2. Confirm your choice, and the version will be marked for permanent deletion.
  3. Recovered versions won't be permanently deleted and will remain in the Secrets Manager for 30 days before being deleted automatically.

Regularly auditing and managing your secret versions helps maintain a clean, organized, and secure environment in AWS Secrets Manager. Stay proactive in deleting outdated or unused versions to adhere to the principle of least privilege and enhance your security posture.

AD