AWS Secrets Manager is a service to store sensitive information in a secure way. We interact with this service using the web console, using aws cli or using AWS SDK.
There is no direct option to delete an existing secret immediately from the web console. The web console asks for a recovery window and the secret will remain undeleted till the recovery window gets over. This will be a problem for people who wanted to do an immediate deletion.
There is a solution for this problem using the aws cli. The command is given below. This command will do an asynchronous deletion immediately after triggering the command.
aws secretsmanager delete-secret --secret-id your-aws-secret-name --force-delete-without-recovery --region your-aws-region
After triggering this command, verify the existence of the secret either using the AWS console or using the AWS cli. The command to describe the secret is given below.
aws secretsmanager describe-secret --secret-id your--aws-secret-name --region your-aws-region
I hope this tip is useful. Feel free to comment below this post if you have any queries or feedback.