We have a new redshift serverless cluster that created secrets for it's admin account. We deleted the cluster and it's supposed to take it's secrets with it but it did not.
When I try to delete the secret with this CLI command I get this error:
❯ aws secretsmanager delete-secret --secret-id 'arn:aws:secretsmanager:us-west-1:111111111111:secret:redshift!test-admin-sdxvUc' --force-delete-without-recovery --region us-west-1
An error occurred (InvalidRequestException) when calling the DeleteSecret operation: Operation is not allowed on secret owned by redshift
Thank you for your comment. We'll review and update the Knowledge Center article as needed.
Be careful to supply the secret name for the value of the --secret-id option and NOT the secret ID when attempting to delete.
If you have secret replication enabled and you supply the secret name, it will warn you that you can't delete while it still has replicas.
If you have secret replication enabled and you supply the secret ID, it will appear as though the delete succeeded but it really didn't.
If you don't have secret replication enabled and the secret is already scheduled for deletion and then you supply the secret ID in a delete-secret --force-delete-without-recovery command, it will appear as though the immediate delete succeeded but it really didn't.
When you try to view the status of a secret scheduled for deletion, the web console will show a Deleted on date and the CLI it will show a DeletedDate or DeletionDate. The date it shows is not the date that secret was actually deleted. The date it shows is the date that the schedule operation occurred. I have not found any way to determine the date that the secret is scheduled to be deleted on.
Once while trying to set the recovery window days to 30 on a secret that already had a DeletedDate value, the response showed a DeletionDate of the previous day. So, somehow, a secret that I just created minutes earlier was supposedly deleted one day before it was created. ¯\_(ツ)_/¯
Relevant content
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 6 months ago

